Data structures, algorithms, system design, and behavioral prep.
You’re reading a free preview. Sign up to see every topic and question — and to play this deck as games.
Time/space complexity and when to reach for each structure.
46 total questions
Card #1
Time to access an array element by index?
Card #2
Average search time in a balanced BST?
Card #3
Search time in an unsorted array?
1. Average-case time to insert into a hash table?
2. Which structure gives O(1) enqueue and dequeue?
3. The best general-purpose comparison sort runs in:
1. Mergesort runs in O(n log n) in every case, but requires O(___) auxiliary space.
Hint: Proportional to the input size
2. A sort that preserves the relative order of equal elements is described as ___.
Hint: Equal elements do not move past each other
3. Building a heap from n unsorted elements takes O(___) time.
Hint: Cheaper than the n log n most people guess