Explain time and space complexity of Merge Sort and when it’s preferred over Quick Sort.
2. How does a HashMap work internally? Discuss hash collisions and rehashing.
3. Design a data structure that supports O(1) insert, delete, and getRandom.
4. Implement LRU Cache from scratch using appropriate data structures.
5. Compare DFS and BFS. When would you choose one over the other in graph problems?