C++ Construction and initialization test
Table of Contents
1. What does std::set::lower_bound(key) return?
2. What does std::set::upper_bound(key) return?
3. Which property defines a Binary Search Tree?
4. Why are balanced trees preferred over naive BSTs?
5. Which condition must always hold for an AVL tree?
6. Which condition is NOT a Red-Black Tree invariant?
7. What operation is used to rebalance binary search trees?
8. Which of the following breaks aggregate initialization?
9. Which initialization syntax performs aggregate initialization?
10. What is direct initialization?
11. What is copy initialization?
12. What famous parsing problem does this trigger? MyClass m(List(), List());
13. Which syntax avoids Most Vexing Parse?
14. Why is an initializer list preferred over assignment in the constructor body?
15. Which member must be initialized in the initializer list?
16. In what order are members initialized?
17. What is a delegating constructor?
18. Why is a recursive tree destructor dangerous?
19. Is delete nullptr valid?
20. Why is setting members to nullptr inside a destructor usually useless?
21. What does int x{}; perform?
22. What value does int x{} contain?
23. What value does int x; contain?
24. What is the purpose of a copy constructor?
25. Which signature is the canonical copy constructor?
26. What is assignment?
27. What should operator= normally return?
28. Why do we check if (this != &other) in operator=?
29. When should a custom copy constructor usually be written?
30. What does '= delete' on a copy constructor do?