CSCD 211 Review CTF
Practice for the final. Points count for participation credit. Study by capturing flags.
How to play
- Log in with GitHub (top right). That is how your points count for participation credit.
- Open Challenges and solve Enter the Password with the password from class. That unlocks the whole board.
- 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. - 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.
- 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 the core methods one line at a time, linked lists and recursion both.
- 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
The final on Thursday, August 13 is cumulative: linked lists, sorting, comparators, copying, identity, exceptions, and recursion. 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)
| Category | What it drills |
|---|---|
| Linked Lists: Add Operations | addFirst, append, add at an index. Empty list first, connect before you rewire, size on every path. |
| Linked Lists: Remove Operations | removeFirst, removeLast, remove all occurrences. The prev and cur walk, save the data before you unlink. |
| Linked Lists: Retrieve | get by index with real guards. |
| Linked Lists: Order-Related | addOrdered, selection sort on a list, linear search. |
| compareTo and compare | The multi-key cascade, Integer.compare and Double.compare, a Comparator as its own class. |
| Class Design: Find and Fix | A broken equals, a hashCode that breaks HashSet, a toString that prints the wrong format. Find the bug, fix it. |
| Copying and Defensive Copies | Copy constructors, the leaked getter, defensive copies in and out. |
| Exceptions and Guards | Guard clauses that throw the right exception with the right message. |
Review board (trivia, one flag each)
| Category | What it drills |
|---|---|
| Linked Lists | Trace a list, predict the result, the no-dummy-head and dummy-head empty checks, and the two-dot crash. |
| Sorting | Selection sort by hand: count the comparisons and swaps, predict the array between passes. |
| Comparable and Comparator | Multi-key compareTo, Integer.compare over subtraction, and when to use each interface. |
| Composition and Copying | Deep versus shallow copy, the leaked getter, defensive copies, and has-a relationships. |
| Reference Semantics and Identity | Aliasing, the equals and hashCode contract, and the wrong-signature equals overload. |
| File IO | Read with Scanner, write with PrintStream, guard for a missing file, and what hasNext really promises. |
| Recursion | Write the base case, trace prints on both sides of the call, read the frames on the stack, and count the calls. |
| Recursion on Lists | Recursive traversal, the null base case, and building the answer on the way back. |
The board stays open through Friday, August 14 at 11:59 pm. Every challenge is exam material: capturing the board is studying.