Chapter 2, page 20
The same code, narrated two ways
To make that difference audible, take two of the six and listen to them in a real round.
Safety and robustness, the moment a candidate finishes a network call.
Weak: “Okay, that fetches the profile and updates the view. Done, moving on.” Senior: “That fetches the profile. Before I move on, two things: this can fail, so I want an error path that doesn’t leave the view spinning forever, and if the user backs out mid-request I should cancel it. Let me handle the error case now and leave a note on cancellation.”
Same code, ten seconds apart. The second version is the entire safety signal, and it costs one sentence. The interviewer writes down “raised errors and cancellation unprompted,” a phrase that moves a scorecard.
Trade-off reasoning, the moment a candidate picks a collection type.
Weak: (types var seen = Set<String>() and keeps going) Senior: “I’ll use a set for the seen IDs so membership checks are O(1). A dictionary would let me store metadata too, but I don’t need the values here, so a set is the leaner choice.”
The weak version might be the exact same, correct line of code. But a silent good decision reads as luck, and a narrated one as judgment.
