Technical Questions asked in Zomato

  1. What will be output of following program?
    #include
  2.  What is meaning of following declaration? int(*ptr[5])();
    1. ptr is pointer to function.
    2. ptr is pointer to array of function.
    3. ptr is pointer to such function which return type is array.
    4. ptr is pointer to array of function.
    Answer: Option B.
    Here ptr is array not pointer.
  1. What will be output if you will compile and execute the following c code? #include
  2. Analyse the following code snippet and choose the answer:-
    #include Class Temp { private:
    int m_ival;
    public:
    Temp()
    {
    Cout<<"OBJECT CREATED\n"< }
    ~Temp()
    {
    Cout<<"OBJECT DESTROYED\n"< }
    };
    void fnRead()
    {
    Temp oTempObj;
    }
    int main()
    {
    fnRead();
    cout<<"IN MAIN \n"< return 0;
    }
    1. OBJECT CREATED OBJECT DESTROYED
    2. OBJECT CREATED OBJECT DESTROYED IN MAIN
    3. OBJECT CREATED IN MAIN
    4. Compilation Error
    Answer: Option B.
  3. Observe the following code and chose the correct statement(s)
    class Name
    {
    const char *s ;.
    };
    class Table
    {
    Name *p; size_t sz ; public :
    Table(size_ts = 15) {p = new Name [sz = s]; }
    ~Table() {delete [ ]p ;}
    Name * lookup(const char *);
    bool insert(Name *);
    };
    1. ~Table() is a destructor
    2. p is of Table type
    3. Both A and B
    4. insert() is a method which returns nothing
    Answer: Option A
  4. Which of the following are essential features of object-oriented programming languages? 
    • Abstraction and encapsulation
    • Strictly-typedness
    • Type-safe property coupled with sub-type rule
    • Polymorphism in the presence of inheritance
    1. 1. 1 and 2 only
    2. 1 and 4 only
    3. 1,2 and 4 only
    4. 1,3 and 4 only
    Answer: Option B.
    Object oriented programming language is Object based PL+Abstraction + Inheritance. The last two (abstraction and inheritance) are must for any L to be OOPL.
Views:5254