Skip to main content

Cumulative Review: Semesters 0 Through 3

This review mixes the orientation, math foundations, algorithms, and software design work completed so far. The goal is not to prove you can cram. The goal is to verify that design decisions still rest on fundamentals.


Format

  • 30 questions
  • 90 minutes
  • closed book
  • write short answers, diagrams, or pseudocode as needed
  • after finishing, tag every miss by semester and concept gap

Target: at least 24 correct with no catastrophic weakness in Semester 3.


Questions

  1. Explain the difference between an invariant and a precondition, then give one example of each from a data structure you studied in Semester 2.
  2. A class calculates discounts, formats invoices, and sends emails. Name the primary design problem and propose the first refactor move.
  3. Give the time complexity of binary search and explain why the proof idea depends on a shrinking search space.
  4. You see the same switch over payment type in four files. What smell is this, and which pattern is a likely candidate if the variation is stable?
  5. Define cohesion and coupling in one sentence each, then explain why a module can have one problem without the other.
  6. Write a short argument for why a comment that explains obvious code can still be harmful.
  7. A refactor changes names, extracts methods, and moves logic, but the behavior must stay the same. What kind of tests are most useful before starting, and why?
  8. In a graph problem, when would you choose BFS over DFS if the task is to find the shortest path in an unweighted graph?
  9. Explain what Liskov substitution is really testing. Do not define it using inheritance slogans.
  10. A teammate proposes three interfaces for a feature with one implementation and one caller. What principle should make you cautious?
  11. Give one example of a divide-and-conquer algorithm and state the core recurrence idea behind it.
  12. You inherit a class named DataManager with 900 lines of code. List three smells you would check for before making any design changes.
  13. Why is a priority queue a better fit than a plain queue for Dijkstra's algorithm?
  14. Distinguish Strategy from Command using one sentence about intent and one sentence about runtime behavior.
  15. What does dependency inversion protect, and what does it not automatically solve?
  16. State one reason dynamic programming can outperform naive recursion and one reason it can still be a bad design choice.
  17. When is Decorator preferable to subclassing?
  18. Give one example of a characterization test and explain what risk it reduces during refactoring.
  19. What is the difference between asymptotic complexity and practical performance on a real code path?
  20. A review comment says, "This feels over-engineered." Rewrite it into a useful, evidence-based comment.
  21. Explain why Adapter and Factory solve different problems even though both can reduce coupling.
  22. What is the engineering cost of shotgun surgery?
  23. Give one case where duplication is temporarily acceptable and one case where it is a design smell.
  24. What question should an ADR answer that code comments usually should not?
  25. Why is proving correctness on paper still useful even when you have tests?
  26. Name one design pressure that justifies Observer and one that makes Observer a poor choice.
  27. What is the difference between a data clump and a value object opportunity?
  28. A pull request passes tests but is hard to review because it mixes refactor and feature work. What process/design problem does that indicate?
  29. Explain how algorithmic thinking from Semester 2 improves software design decisions in Semester 3.
  30. In your own words, what is the difference between "clean-looking code" and maintainable code?

Review Procedure

After grading:

  1. Mark each miss with one or more tags: S0, S1, S2, S3.
  2. Add a second tag for the failure mode: forgot concept, mixed concepts, could not apply, weak justification, or sloppy reading.
  3. Restudy the weakest module before repeating the exam or moving on.

Error Log

Q#Semester tagFailure modeFix to apply
1
2
3
4
5

Add rows as needed. Keep this log because later semesters will depend on the same weak spots.