CSCD 211 Midterm 1 Review CTF

Practice for the Thursday midterm. Points count for participation credit. Study by capturing flags.


How to play

  1. Register an account (top right) with your EWU username and your EWU email. That is how your points count for participation credit.
  2. Open Challenges and solve Enter the Password with the password from class. That unlocks the whole board.
  3. Read a prompt, work the problem on paper or in your editor, and submit the answer. Trivia answers are just the answer: a word, a number, or a short sequence like 2-5-6-9. Capitalization does not matter, and the prompt states the exact shape. Two-choice questions give you one attempt, so think before you submit.
  4. Write Code challenges link out to code.jdoner.me. Sign in with GitHub, write the method where the TODO is, and run it. A correct run shows a flag. Paste it back here, exactly as shown.
  5. Every category unlocks in a chain: solve one and the next appears. The first in each chain is the easiest; later ones expect you to know the moves and are worth more. If you want the steps spelled out in plain English first, the Warm Up category walks every linked-list method one line at a time.
  6. Watch your rank on the Scoreboard. Rank is just for fun; the participation credit comes from your total points, not your rank.

What this covers

Everything on Midterm 1 is fair game, and the exam is mostly linked lists. Points scale with difficulty: warm-ups are worth the least, problems that tie two ideas together the most. Weakest category is where to spend your time.

Write Code chains (one flag per solved method)

CategoryWhat it drills
Linked Lists: Add OperationsaddFirst, append, add at an index. Empty list first, connect before you rewire, size on every path.
Linked Lists: Remove OperationsremoveFirst, removeLast, remove all occurrences. The prev and cur walk, save the data before you unlink.
Linked Lists: Retrieveget by index with real guards.
Linked Lists: Order-RelatedaddOrdered, selection sort on a list, linear search.
compareTo and compareThe multi-key cascade, Integer.compare and Double.compare, a Comparator as its own class.
Class Design: Find and FixA broken equals, a hashCode that breaks HashSet, a toString that prints the wrong format. Find the bug, fix it.
Copying and Defensive CopiesCopy constructors, the leaked getter, defensive copies in and out.
Exceptions and GuardsGuard clauses that throw the right exception with the right message.

Review board (trivia, one flag each)

CategoryWhat it drills
Linked ListsTrace a list, predict the result, the no-dummy-head and dummy-head empty checks, and the two-dot crash.
SortingSelection sort by hand: count the comparisons and swaps, predict the array between passes.
Comparable and ComparatorMulti-key compareTo, Integer.compare over subtraction, and when to use each interface.
Composition and CopyingDeep versus shallow copy, the leaked getter, defensive copies, and has-a relationships.
Reference Semantics and IdentityAliasing, the equals and hashCode contract, and the wrong-signature equals overload.
File IORead with Scanner, write with PrintStream, guard for a missing file, and what hasNext really promises.

The board stays open until Wednesday 11pm. Every challenge is midterm material: capturing the board is studying.