Semester 2 Exam
Required Output Classification
| Required output | Classification | Public/private guidance |
|---|---|---|
| Timed written answers, diagrams, code snippets, and design responses | Checkpoint evidence | Keep raw exam work private so it remains useful for assessment and retake calibration. |
| Post-exam review notes, missed-answer repairs, and Feynman explanations | Practice artifact | Use for spaced review; publish only rewritten explanations that no longer reveal exam solutions wholesale. |
| Capstone-defense or architecture-defense packets created from exam prompts | Portfolio candidate | Polish publicly only when they are original to your project, sanitized, and framed as engineering rationale rather than exam answers. |
tip
Take this as a two-hour written assessment. Closed notes is ideal. A one-page handwritten formula sheet is acceptable if that matches your study contract.
Format
| Section | Duration | Points |
|---|---|---|
| Analysis, recurrence, and correctness reasoning | 30 minutes | 25 |
| Sorting, searching, and structure tradeoffs | 25 minutes | 20 |
| Graph algorithms | 25 minutes | 20 |
| Dynamic programming and greedy judgment | 20 minutes | 20 |
| Advanced structures and amortized analysis | 20 minutes | 15 |
Total: 100 points
Coverage map
- Module 1: Asymptotics, recurrences, proof sketches, divide-and-conquer reasoning
- Module 2: Sorting/searching behavior, heaps, hash-backed vs ordered structures
- Module 3: Traversals, shortest paths, spanning trees, graph representation choices
- Module 4: DP state design, memoization/tabulation, greedy-vs-DP tradeoffs
- Module 5: Balanced trees, union-find, amortized reasoning, operation-cost comparisons
Exam paper
Section A: Analysis and correctness
- A recursive algorithm splits the input into two equal halves, solves both, and spends linear time merging results. Write the recurrence, solve it, and name a concrete algorithm from this semester with the same shape.
- Compare
O(n log n)andO(n^2)sorting behavior forn = 10^3andn = 10^6. You do not need exact counts; give order-of-growth reasoning and the engineering consequence. - Write a short correctness argument for binary search or merge sort. Your answer must name the invariant or structural idea doing the real work.
Section B: Sorting, searching, and structures
- Compare merge sort, quicksort, and heap sort on stability, extra memory, worst-case runtime, and when you would choose each in practice.
- You need repeated insertion plus frequent access to the current minimum item. Choose a structure, justify the choice, and explain what operation becomes weak compared with a balanced tree.
- A team wants a hash table because "lookup is constant time." List the assumptions hidden inside that statement and one case where an ordered structure is the better choice.
Section C: Graph algorithms
- A graph models cities connected by weighted roads. Explain when BFS is correct, when Dijkstra is required, and when a minimum spanning tree algorithm is solving the wrong problem.
- Compare adjacency lists and adjacency matrices for sparse and dense graphs. Include both storage and traversal implications.
- A social graph question asks whether two users are connected within at most three hops. Choose an algorithm, show the stopping logic, and explain why it fits better than DFS for this task.
Section D: Dynamic programming and greedy choice
- Define overlapping subproblems and optimal substructure. Then describe a problem from this semester where both are present.
- Start from a recursive solution to a classic DP problem of your choice. Show how you would convert it into memoization and then tabulation.
- Give one example where a greedy strategy works and one where it fails. For each, explain the property that makes the conclusion valid.
Section E: Advanced structures and amortized analysis
- Explain union-find, the operations it supports, and one concrete workflow where it is the natural tool.
- Compare balanced search trees with hash tables for ordered iteration, range queries, and worst-case guarantees.
- Explain amortized analysis using either dynamic arrays, path compression, or another structure from the semester. The answer must distinguish amortized cost from average-case cost.
Performance standard
85-100: ready to advance70-84: pass, but revisit the missed module before Semester 3 deep work60-69: weak pass only if the project and checkpoint evidence are strongBelow 60: repair gaps and retake
Reflection after grading
Write a short post-exam note with:
- the two questions you solved confidently
- the two questions that exposed weak pattern recognition
- the one module you need to keep alive during Semester 3
Added Implementation-Reasoning Prompts
Use these prompts when the exam needs more evidence than final answers:
- Analyze three loop snippets, including one additive and one multiplicative nested loop. Give exact counts for small
nand asymptotic bounds. - Given a list problem, choose between sorting, hashing, two pointers, or brute force. Defend the choice with runtime, memory, and correctness reasoning.
- Implement BFS path reconstruction in pseudocode and state which data structure guarantees FIFO behavior.
- Convert a recurrence into a DP state, then state whether memoization or tabulation fits the problem constraints better.
- Compare a heap and a hash table for one workload where each is the right tool.
Mastery Rubric
| Level | Evidence |
|---|---|
| Beginner pass | Can answer direct questions and complete familiar exercises with light notes. |
| Solid pass | Can solve new variants, explain choices, and connect the work to Semester 1 Mathematical and CS Foundations. |
| Strong pass | Can defend tradeoffs, identify failure modes, and produce clean evidence in the portfolio artifact. |
| Not ready | Relies on copied solutions, cannot explain mistakes, or lacks durable artifacts. |
Retake and Repair Rule
If a section is weak, do not only reread. Repair it by producing new evidence: a corrected solution, a fresh implementation, a rewritten proof, a benchmark, a diagram, a runbook, or a short teaching note.
Answer-Quality Examples
Use these examples when grading written answers or spoken explanations.
| Quality | Example pattern |
|---|---|
| Weak | Names a concept but gives no example, constraint, or failure case. |
| Acceptable | Defines the concept and applies it to a familiar exercise. |
| Strong | Applies the concept to a new variant and explains why an alternative would fail. |
| Portfolio-ready | Connects the concept to Semester 1 Mathematical and CS Foundations, current project evidence, and a future capstone decision. |
Interleaving Prompt
For any missed answer, add one sentence starting with: This depends on an earlier skill because...
Calibration Materials
Use these learner-visible calibration materials before self-grading or requesting review: