| Snaprecruit.com

| Snaprecruit.com

Interview question based on skill :

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. All the operators can be overloaded using the member function operator overloading.

Correct Answer is : FALSE

2. Which operator among the following must be overloaded using the friend function?

Correct Answer is : Both << and >> operators

3. What does memory allocation for objects mean?

Correct Answer is : Actual creation and memory allocation for object members

4. Where is the memory allocated for the objects?

Correct Answer is : RAM

5. When is the memory allocated for an object?

Correct Answer is : When object constructor is called

6. Using new is type safe as _______________________

Correct Answer is : It doesn’t require to be specified with type of data

7. Which of the following function can be used for dynamic memory allocation of objects?

Correct Answer is : malloc() and calloc()

8. How much memory will be allocated for an object of class given below? class Test { int mark1; int mark2; float avg; char name[10]; };

Correct Answer is : 22 Bytes

9. Which keyword among the following can be used to declare an array of objects in java?

Correct Answer is : new

10. When is the memory allocated for an object gets free?

Correct Answer is : When object goes out of scope

11. Which among the following keyword can be used to free the allocated memory for an object?

Correct Answer is : either delete or free

12. Which function is called whenever an object goes out of scope?

Correct Answer is : Destructor function

13. Which operator can be used to check the size of an object?

Correct Answer is : sizeof(objectName)

14. The memory allocated for an object ____________________

Correct Answer is : Can be static or dynamic

15. If an object is declared in a user defined function __________________

Correct Answer is : Its memory is allocated in stack

16. In java, ____________________ takes care of managing memory for objects dynamically.

Correct Answer is : Garbage collector

17. Which operator can be used to free the memory allocated for an object in C++?

Correct Answer is : delete

18. Which among the following best defines multilevel inheritance?

Correct Answer is : Classes being derived from other derived classes

19. If there are 5 classes, E is derived from D, D from C, C from B and B from A. Which class constructor will be called first if the object of E or D is created?

Correct Answer is : A

20. If there are 3 classes. Class C is derived from class B and B is derived from A, Which class destructor will be called at last if object of C is destroyed.

Correct Answer is : A