Cumulative Review
note
Semester 0 is the first main semester in the public path, so this review mixes the three Semester 0 modules and a small amount of Launchpad integration.
Instructions
- Set a 45-60 minute timer and answer everything closed-book first.
- Use only blank paper or a blank editor for diagrams, traces, and short notes.
- After finishing, grade with the answer key and tag every miss by area:
L,M1,M2, orM3. - Turn each miss into one flashcard, one rewritten explanation, or one short re-trace the next day.
Mixed Questions (15)
Mix key: L = Launchpad integration, M1 = Algorithm Intuition, M2 = CS Fundamentals, M3 = Clean Code
- (
L) What habit or workflow from Launchpad most reduced friction during Semester 0, and why? - (
M1) Why does binary search require sorted data, and what kind of speedup intuition does halving create? - (
M2) Distinguish an algorithm, a data structure, and a database using one connected example. - (
M3) Why is a vague variable name expensive even when the code still "works"? - (
M1) CompareO(log n),O(n), andO(n^2)for a large input in plain language. - (
M2) What is the difference between an abstract data type and a concrete data structure? Use a stack as the example. - (
M3) Name two signs that a function is doing more than one job. - (
M1) Choose between an array, a linked list, and a hash table for three different jobs, and justify each choice briefly. - (
M2) Explain the path from source code to machine execution at a beginner level. - (
M3) Why are small tests useful during refactoring, not just after a project is "finished"? - (
M1) What are the base case and recursive case, and why do you need both? - (
M2) Compare relational and non-relational storage at a beginner tradeoff level. - (
M1) Explain why BFS uses a queue and a visited set when finding the shortest unweighted path. - (
M2) Name three strategy families for solving problems and give one situation where each fits. - (
M3) Give one small example of duplication or mixed concerns and describe a cleaner alternative.
Answer Key
info
Keep the answers concise when you self-grade. The point is not perfect wording; the point is whether you can explain the idea clearly and usefully.
- A good answer points to a real habit, review loop, or Git workflow that made consistent work easier, then explains the concrete effect.
- Binary search works only when order lets you rule out half the remaining possibilities after each comparison. Halving produces logarithmic growth intuition, which scales far better than checking one item at a time.
- Example: an algorithm is binary search, a data structure is a sorted array that makes binary search possible, and a database is the persistent store that keeps records between runs.
- A vague name hides intent, slows reviews, increases debugging time, and makes future changes riskier because the reader has to reconstruct meaning.
O(log n)grows slowly because each step removes a large fraction of work;O(n)grows in direct proportion to input size;O(n^2)grows much faster because work compounds across pairs or nested passes.- An ADT describes behavior and operations at a concept level; a data structure is one concrete implementation. A stack ADT means last-in, first-out behavior; it could be implemented with an array or linked list.
- Good signs include mixed levels of abstraction, multiple reasons to change, branch-heavy behavior that could be split, and a name that needs "and."
- Arrays fit indexed reads and compact ordered storage; linked lists fit frequent inserts or deletes when random access matters less; hash tables fit fast key-based lookup.
- Source code is interpreted or compiled into lower-level instructions, the operating system helps load and manage the program, and the CPU executes instructions while memory holds active data and code.
- Small tests protect behavior while code structure changes. They reduce fear, expose regressions early, and make refactoring reviewable in small steps.
- The base case stops recursion; the recursive case reduces the problem toward that stop. Without a base case the process never terminates; without a shrinking recursive step it does not converge.
- Relational storage emphasizes structured tables, relationships, and strong consistency patterns; non-relational storage often trades some rigidity for flexibility, scale patterns, or easier handling of certain data shapes.
- The queue preserves breadth-first order so nearer nodes are explored first. The visited set prevents repeated work and cycles. Together they let BFS find the shortest unweighted path.
- Example answers: brute force fits small search spaces, divide and conquer fits problems that split into similar subproblems, heuristics fit cases where a good-enough shortcut is acceptable, and dynamic programming fits overlapping subproblems.
- Good answers identify a real smell such as repeated condition logic, UI code doing storage work, or a function that validates, formats, and saves in one place, then propose a small separation of responsibilities.