Data structures, algorithms, system design, and behavioral prep.
Add it to your projects to study it here with your progress saved. Try it plays a round and saves nothing. Clone makes your own copy that you can change.
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. What is the time complexity of: for i from 0 to n, for j from 0 to i, do O(1) work?
2. A loop starts at i = 1 and runs while i times i is at most n, adding 1 to i each time. What does it cost?
3. You loop once over array A of size n, then once over a separate array B of size m. What is the total cost?
1. In a 0-indexed binary heap stored in an array, the children of index i sit at 2i + 1 and ___.
Hint: One after the left child
2. The recurrence T(n) = 2T(n/2) + O(n) solves to O(n log n), which the ___ theorem gives you directly.
Hint: A general rule for divide-and-conquer recurrences
3. ___ notation gives a tight bound: the function is bounded above and below by the same growth rate.
Hint: A Greek letter