I had an interview with CSC chennai last week, following are the questions asked to me:
- Which desing pattern you follows?
- What is kept in desing document?
- Which default functions are created in empty class?
- What is the need of overloading a copy constructor?
- Does default constructor invoked by default copy constructor?
- How to limit number of instances of class? or How to track running instances of a class?
- Three overloaded constructors:
    class A
    {
          A();
          A(int i);
          A(int i = 10);
     }
     Is there any problem with this?
     What will happen if 'A()' is removed due to ambiguity and 'A a2(10);' will invoke which constructor?
- How to print a linked list in reverse order?
- Inheritance:
   class A
   {
     virtual void f1();
    }
    class B : public A
    {
      virtual void f1();
      virtual void f2();
     }
   B *b = new A;
   b->f1();
   b->f2();
 What will be the problem? How to invoke 'f2()' using using object of class A.
  [ Actually this question was wrong or I heard this question as wrong]
- Two buckets of 5 liter and 3 liter. How to major 4 liter of water?
Monday, March 2, 2009
Subscribe to:
Comments (Atom)

