1.  What is a class?
2.  What is an object?
3.  What is the difference between an object and a class?
4.  What is the difference between class and structure?
5.  What is public, protected, and private?
6.  What are virtual functions?
7.  What is friend function?
8.  What is a scope resolution operator?
9.  What do you mean by inheritance?
10.  What is abstraction?
11.  What is polymorphism? Explain with an example.
12.  What is encapsulation?
13.  What do you mean by binding of data and functions?
14.  What is function overloading and operator overloading?
15.  What is virtual class and friend class?
16.  What do you mean by inline function?
17.  What do you mean by public, private, protected and friendly?
18.  When an object created and what is its lifetime?
19.  What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.
20.  Difference between realloc() and free?
21.  What is a template?
22.  What are the main differences between procedure oriented languages and object oriented languages?
23.  What is R T T I ?
24.  What are generic functions and generic classes?
25.  What is namespace?
26.  What is the difference between pass by reference and pass by value?
27.  Why do we use virtual functions?
28.  What do you mean by pure virtual functions?
29.  What are virtual classes?
30.  Does c++ support multilevel and multiple inheritances?
31.  What are the advantages of inheritance?
32.  When is a memory allocated to a class?
33.  What is the difference between declaration and definition?
34.  What is virtual constructors/destructors?
35.  In c++ there are only virtual destructors, no constructors. Why?
36.  What is late bound function call and early bound function call? Differentiate.
37.  How is exception handling carried out in c++?
38.  When will a constructor executed?
39.  What is Dynamic Polymorphism?
40.  Write a macro for swapping integers. 





C- Questions
  1. What does static variable mean?
  2. What is a pointer?
  3. What is a structure?
  4. What are the differences between structures and arrays?
  5. In header files whether functions are declared or defined? 
  6. What are the differences between malloc() and calloc()?


Prepare the fallowing subjects for your technical interview       (for CSE & IT students)
C &C++ programs:
practice the fallowing programs before the interview:
Factorial, Fibonacci, prime number, palindrome for strings and numbers, swap with out using temporary variables, string copy, concatenate, matrix multiplications, single double linked list by using pointers. Fahrenheit to Celsius conversion program, and practice all simple programs


1. #define dprintf(expr) printf(#expr="%d",exp);

 main()

{int x=7, y=3;

 dprintf(x/y);}


SYNONYMS ASKED IN TCS N KANBAY TILL NOW :


Admonish= usurp
Adhesive = tenacious, sticky, glue, gum, bonding agent
Alienate = estrange
Bileaf = big screen, big shot, big success
Belief = conviction
Baffle = puzzle
Brim = edge
Covet = to desire


                                                              Coding Decoding

TEST-2

1. Which should be the seventh letter to the right of 18th letter from the right if second half of the alphabet is reversed.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1) X 2) W 3) L 4) Y 5) V

2) In A Certain Code language "APPROACH" is written as "YQNSMBAI" then "VERBAL" will be written as

1) TFPCYN 2) TFPCYM 3) TFPYCM 4) TFPCNY 5) TPFCYM

 Coding Decoding
What is Coding Decoding :
A 'Code' is a system of conveying a message through signals. It is a method of sending a message between sender and the receiver in such a way that only the sender and the receiver can know its meaning. However 'Coding' is done according a certain pattern in the mind of the sender. Therefore, its meaning can be deciphered by a third person. Only if he carefully studies this pattern . This process is called 'Decoding'. This capability is important in many fields of application.

   The 'Coding- Decoding' test is set up to judge the candidates's ability to decipher the pattern which goes behind a coded message or statement. There are many types of coding:


                                                         Compound Interest

Compound Interest: sometimes it so happens that the borrower and the lender agree to fix up a certain unit of time, say yearly or half-yearly or quarterly to settle the previous amount.

            In such case, the amount after first unit of time becomes the principal for the second unit, the amount after second unit becomes the principal for the third unit and so on.

            After a specified period, the difference between the amount and the money borrowed is called the compound Interest (abbreviated as C.I.) for that period.



  SIMPLE INTEREST  

General Concepts :
 Principal or Sum : The money borrowed or lent out for a certain period is called the principal or the sum.
Interest: Extra money paid for using other's money is called interest.
Simple Interest: If the interest on a sum borrowed for a certain period is reckoned uniformly, then it is called simple interest.
FORMULAE: Let Principal = P, Rate = R% per annum
And Time = years. Then,
(l) S.I. = [P x R x T/100]
(ii) P = [(100 x S.I.) / (R x T)],    R= [(100 x S.I.)/ (P x T)]   and  T= [(100 x S.I)./ (P x R)]

 Alligation or Mixture
Alligation : It is the rule that enable us to find the ratio in which two or more ingredients at the given price must be mixed to produce a mixture at a given price.
Mean Price : The cost price of a unit quantity of the mixture is called the mean price.
Rule of Alligation : If two ingredients are mixed, then :
    c = Cost price of a unit quantity of cheaper
     d= C.P. of a unit quantity of dearer

(Quantity of Cheaper) / (Quantity of dearer) = 
                                                             {(C.P. of Dearer) - (Mean Price)}
                                                             { (Mean Price) - (C.P. of Cheaper)}


      (Cheaper quantity) : (Dearer quantity) = (d - m) : (m - c)

  Ratio  & Proportion             
Ratio:The ratio of two quantities in the same units is a fraction that one quantity is of the other.
      The Ration a : b represents a fraction a/b,
The First term of a ratio is called antecedent while the second term is known asconsequent.
      Thus, the ratio 5 : 7 represents 5/7 with antecedent 5 and consequent 7.
Proportion : The equality of two ratios is called proportion
If  a : b = c : d, we say that a,b,c,d are in proportion
In a proportion, the first and fourth terms are known as extremes , while second and third terms are known as means
we have Product of Means = Product of Extremes.
Fourth Proportional : If a : b = c : d then d is called the fourth proportional to a, b, c,
Compound Ratio :The compound ratio of the ratios
                    (a : b), (c : d), (e : f) is (ace : bdf)

  Time and Distance
Answers to these questions are at the bottom of the page
1.. Walking at the rate of 4 kmph a man covers a certain distance in 2 hours 45 min. Running at a speed of 16.5 kmph, the man will cover the same distance in :
(a) 40 min. (b) 45 min. (c) 100 min. (d) 41 min. 15 sec.

2. A car can finish a certain journey in 10 hours at a speed of 48 kmph. In order to cover the same distance in 8 hours, the speed of the car must be increased by :

(a) 6 km/hr (b) 7.5 km/hr (c) 12 km/hr (d) 15 kmIhr .
3. A train covers a certain distance in 50 minutes, if it runs at a speed of 48 kmph on an average. The speed at which the train must run to reduce
the time of journey to 40 minutes, will be: 


(a) 50 km/hr (b) 55 km/hr (c) 60 km/hr (d) 70 km/hr

4. A car takes 6 hours to cover a journey at a speed of 45 kmph. At what speed must it travel in order to complete the journey in 5 hours? 

(a) 55 km/hr (b) 54 km/hr (c) 53 km/hr (d) 52 km/hr

5. If a man running at 15 kmph crosses a bridge in 5 minutes, then the length of the bridge is : 
(a) 1333.33 m (b) 1000 m (c) 7500 m (d) 1250 m

  •                                                              Time and Distance

    (i) Speed = [distance / time] ,
  • (ii) Time = [ distance/ speed]
    (iii) Distance = (Speed x Time).
    (iv) 1 km/hour = 5/18 m/sec.
    (v) 1 m/sec. = 18/5 km/hr.
    (vi) If the ratio of the speeds of A and B is a : b, then the ratio of the times taken by them to cover the same distance is 1/a : 1/b or b: a .
    (vii) Suppose a man covers a certain distance at x Kmph and an equal distance at y Kmph. 
Then, the average speed during the whole journey is [ 2 xy/ (x + y)] Kmph

PIPES & CISTERNS

Inlet: A pipe connected with a tank or a cistern or a reservoir, that fills it, is known as an inlet.
Outlet: A pipe connected with a tank or a cistern or a reservoir, emptying it, is known as an outlet. 

Formulae: (i) If a pipe can fill a tank in x hours, then:

(i) Part filled in 1 hour = 1/x
(ii) If a pipe can empty a full tank in y hours, then: Part emptied in hour = 1/y

(iii) If a pipe can fill a tank in x hours and another pipe can empty the full tank in y hours (where y > x), then on opening both the pipes, the net part filled in 1 hour = [ 1/x – 1/y].

SOLVED PROBLEMS

Ex. 1. Two pipes A and B can fill a tank in 36 hours and 45 hours respectively. If both the pipes are opened simultaneously, how much time will be taken to fill the tank?

Sol. Part filled by A In 1 hour = 1/36
Part filled by B in 1 hour = 1/45
Part filled by (A + B) In 1 hour = [1/36 + 1/45] = 9/180 = 1/20
Hence, both the pipes together will fill the tank in 20 hours.

Ex. 2. A pipe can fill a tank in 16 hours. Due to a leak in the bottom,it is filled in 24 hours. If the tank is full, how much time will the leak take to empty it ?
Sol. Work done by the leak in 1 hour = [ 1/16 – 1/24 ]=1/48
:. Leak will empty the full cistern in '48 hours.

Problems on Time and Work
Answers are at the bottom of the Page
1. A can do a piece of work in 30 days while B alone can do it in 40 days. In how many days can A and B working together do it ?
(a) 17 1/7 (b) 27 1/7 (c) 42 3/4 (d) 70

2. A and B together can complete a piece of work in 35 days while A alone can complete the same work in 60 days. B alone will be able to complete
the same work in : 


(a) 42 days (b) 72 days (c) 84 days (d) 96 days

3. A can do a piece of work in 7 days of 9 hours each and B can do it in 6 days of 7 hours each. How long will they take to do it, working together 8 2/5 hours a day ?

(a) 3 days' (b) 4 days (c) 4 1/2 days (d) None of these
4. A can do a piece of work in 15 days and B alone can do it in 10 days. B works at it for 5 days and then leaves. A alone can finish the remaining work in :

(a) 13/2 (b) 15/2 days (c) 8 days (d) 9 days
5. A can do 1/3 of the work in 5 days and B can do 2/5 of the work in 10 days. In how many days both A and B together can do the work?
(a) 7 ¾ (b)8 4/5 (c) 9 3/8 (d) 10 

  Time & Work

General Rules
(i) If A can do a piece of work in n days, then A's 1 day's work = 1/n.

(ii) If A's 1 day's work = 1/n, then A can finish the work in n days.
(ii) If A is thrice as good a workman as B, then:
Ratio. of work done by A and B = 3 : 1,
Ratio of times taken by A & B to finish a work = 1 : 3.
 Solved Problems 
Ex. 1.A can do a piece of work in 10 days which B alone can do in 12
days. In how many days will they finish the work, both working together?

Sol. A's 1 day's work = 1/10, B's 1 day's work = 1/12
       (A + B)'s 1 day's work = (1/10 +1/12)= 11/60
       :. Both will finish the work in 60/11= 5 5/11days.

Ex. 2. Two persons A and B working together can dig a trench in 8 hours while A alone can dig it in 12 hours. In how many hours B alone can dig such a trench?

Sol. (A + B)'s 1 hour's work = 1/8, A's 1 hour's work = 1/12
        :. B's 1 hour's work=(1/8-1/12 )=1/24
         Hence B alone can dig the trench in 24 hours.

Chain Rule

Direct Proportion : Two quantities are said to be directly proportional if on the increase (or decrease) of the one, the other increases (or decreases) to the same extent
1. The cost of articles is directly proportional to the nuber of articles
2. The work done is directly proportional to the number of men working at it.
Indirect Proportion : Two quantities are said to be indirectly proportional if on the increase of the one, the other decreases to the same extent and vice versa.
1. Time taken to cover a distance is inversely proportional to the speed of the car.
2. Time taken to finish a work is inversely proportional to the number of persons working at it.
Remarks : In solving questions on chain rule, we make repeated use of finding the fourth proportional. We compare every item with the term to be found out.