| 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. In how many ways we can handle errors in any class?

Correct Answer is : References cannot refer to a constant value

2. Which type of heap is implemented in STL heap?

Correct Answer is : Copy Constructor

3. Which function is used to construct heap from given sequence of numbers?

Correct Answer is : 30

4. What is the use of front() function in heap?

Correct Answer is : Segmentation fault

5. Elements in STL heap are removed in ________________________

Correct Answer is : All of the mentioned

6. Which header file is required to use heap in your program?

Correct Answer is : A variable can have more than one references

7. Which of the following is correct syntax of making heap from a vector v?

Correct Answer is : All of the mentioned

8. What is the output of the following C++ code? #include #include #include using namespace std; int main(int argc, char const *argv[]) { vector v = {1,5,23,90,15,35}; make_heap(v.begin(),v.end()); cout<
Correct Answer is : It cannot be accessed by any standard mean

9. What is the output of the following C++ code? #include #include #include using namespace std; int main(int argc, char const *argv[]) { vector v = {1,5,23,90,15,35}; make_heap(v.begin(),v.end()); v.push_back(110); push_heap(v.begin(), v.end()); cout<
Correct Answer is : Segmentation fault

10. What is the output of the following C++ code? #include #include #include using namespace std; int main(int argc, char const *argv[]) { vector v = {1,5,23,90,15,35}; make_heap(v.begin(),v.end()); v.push_back(110); push_heap(v.begin(), v.end()); pop_heap(v.begin(), v.end()); v.pop_back(); cout<
Correct Answer is : 55

11. What is the use of sort_heap() function in heap?

Correct Answer is : TestTest

12. Which function is used to check whether a given sequence is heap or not?

Correct Answer is : 10

13. What is the use of is_heap_until() function?

Correct Answer is : segmentation fault

14. What is the output of the following C++ code? #include #include #include using namespace std; int main(int argc, char const *argv[]) { vector v = {1,5,23,90,15,35}; cout<
Correct Answer is : The form of automatic memory management

15. What is the output of the following C++ code? #include #include #include using namespace std; int main(int argc, char const *argv[]) { vector v = {90, 47, 34, 23, 4, 35, 67}; auto it = is_heap_until(v.begin(), v.end()); for(auto i = v.begin(); i != it; i++) cout<<*i<<" "; }

Correct Answer is : both new & delete

16. What is meant by sequence point?

Correct Answer is : smart pointers

17. Pick out the correct statement about sequence point.

Correct Answer is : Information about an object’s data type at runtime

18. In sequence point, how will the overloaded operators behave like?

Correct Answer is : both dynamic_cast() & typeid

19. What do input and output objects support?

Correct Answer is : Polymorphic

20. What kind of execution does sequence point allow?

Correct Answer is : Null pointer on second type-cast