Cumulative Review: Semesters 0, 1, and 2
Learning Technique
Use this as an interleaved review set. Mix retrieval from orientation, math foundations, and algorithms instead of restudying one topic at a time.
Instructions
- Work under a 90-minute limit.
- Use paper first for traces, recurrences, and proof sketches.
- Do not open notes until the first full pass is done.
- Mark each question with one of three statuses:
clear,slow, ormissed. - After grading, turn every
slowormissedanswer into either a flashcard, a code kata, or a short written explanation.
Questions
- [S0 + S2] A function scans an array once and then sorts it with merge sort. Write the overall asymptotic runtime and explain which part dominates.
- [S1 + S2] Give a short proof sketch that binary search is correct. State the invariant you rely on.
- [S2M1] Solve the recurrence
T(n) = 2T(n/2) + nand explain what algorithm shape usually produces it. - [S2M1] Compare divide-and-conquer and dynamic programming. What shared structure do they have, and what key difference changes the implementation strategy?
- [S1 + S2] Why is logarithmic growth dramatically different from linear growth in practice? Give a concrete example involving search.
- [S2M2] Compare merge sort, quicksort, and heap sort on stability, memory use, and worst-case runtime.
- [S2M2] Explain when a heap is a better fit than a sorted array and when it is worse.
- [S0 + S2M2] A programmer uses linear search on a sorted list because the list is "not that large." What follow-up questions should you ask before accepting that choice?
- [S2M2] Describe average-case hash-table lookup and the main assumptions that make it fast in practice.
- [S2M3] Explain the difference between BFS and DFS using both traversal behavior and typical use cases.
- [S2M3] Why does Dijkstra's algorithm fail with negative-weight edges?
- [S2M3] Compare adjacency lists and adjacency matrices in terms of storage cost and the operations each makes efficient.
- [S1 + S2M3] A graph problem asks whether two users are connected within three introductions. Which representation and traversal would you reach for first, and why?
- [S2M3] Distinguish shortest-path problems from minimum-spanning-tree problems. Why is using one algorithm family for the other a category error?
- [S2M4] Define overlapping subproblems and optimal substructure in your own words.
- [S2M4] Convert a recursive Fibonacci-style solution into memoized and tabulated forms. What changes in runtime and why?
- [S2M4] Give one example where a greedy strategy is correct and explain the property that makes it safe.
- [S2M4] Give one example where a greedy-looking choice fails and dynamic programming is needed instead.
- [S1 + S2M4] Why does writing the recurrence carefully often expose the actual state you need for dynamic programming?
- [S2M5] Explain amortized analysis using dynamic array growth or another concrete example.
- [S2M5] What problem does union-find solve, and why is it especially useful in connectivity-heavy workflows?
- [S2M5] Compare balanced search trees with hash tables when you need ordering, range queries, or predictable worst-case behavior.
- [S0 + S1 + S2] When you benchmark two implementations and the faster result contradicts your asymptotic expectation, what are the first three things you should inspect?
- [S2 Integrated] A problem requires frequent "find minimum," repeated inserts, and occasional deletes. Which structure would you choose first, and what alternative would you evaluate if ordering queries later become necessary?
- [S2 Integrated] Pick one algorithm from each module and explain how the semester builds from analysis to implementation to tradeoff judgment.
Scoring guide
22-25 clear: ready for the exam and checkpoint gate18-21 clear: acceptable, but revisit slow areas before moving on14-17 clear: repeat the review after focused remediation0-13 clear: do not treat Semester 2 as complete
Error log
Use this after grading.
| Q# | Status | What failed | Fix action |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 |