Debrief, and what to do from here

Final checkpoint: mixed interview rounds

Debrief, and what to do from here

Which unit each problem came from, how to read your own result, and how to keep this from decaying.

Key idea

Round one

The circular stretch was Unit 16's running-value argument applied twice. A wrapping selection is exactly the complement of a non-wrapping one, so the best wrapping total is the overall total minus the smallest contiguous stretch, and the answer is the better of that and the ordinary non-wrapping best. The trap is an input where every value is negative: the smallest stretch is then the whole sequence, so the formula returns zero, and zero means selecting nothing, which the problem forbids. The fallback in that case is the ordinary best, which is the largest single value.

The connection pool was Unit 6's overlap question answered with Unit 9's structure. Requests arrive in start order, so the only thing worth tracking is the set of end times currently held, and the earliest of those is the only one that can be released next. That is a min-heap: pop while the smallest end time has already passed, then accept if what remains is under the limit. The wrinkle is that a rejected request must never be pushed, which means each decision changes what later requests see and rules out anything that classifies all the requests up front.

Key idea

Round two

Trading with a fee was Unit 15's state machine. Two states, holding and not holding, with the transitions between them, and the fee charged on exactly one of the two crossings. Charging it on both, or on neither because you meant to subtract it later, is the usual way to lose it. Which crossing you pick does not matter as long as you pick one and stay consistent.

The two-source count was a search rather than a table walk, which is the part that catches people. Because characters may be skipped in either source, the source positions do not advance in lockstep with the target the way they do in Interleaving String. A state has to say where in each source you may next look, how much of the target is left, and whether each source has been used at all, since that last part is the only thing that can enforce the at-least-one-from-each rule. Memoize on the whole tuple. Both source positions have to be in it for the same reason they do in Unit 15: two different sets of chosen indices are two different ways, even when they spell the same target.

Key idea

Round three

The run-limited count was Unit 14 with a state that carries how long the current vowel run is. A position alone cannot express a constraint about consecutive characters, so the state is a pair, which makes this a two-dimensional table wearing a one-dimensional costume. A consonant resets the run to zero and multiplies by twenty-one, a vowel extends it and multiplies by five, and a run that would exceed the limit simply has nowhere to go. The empty string counts as one, not zero.

The ledger was Unit 17's systematic style. There is no idea in it. There are several rules, a per-charge running total of how much has already been refunded, and a boundary case attached to each rule, and the only way through is to write them all down before writing code.

Why it works

Reading your own result honestly

Four or more of the six inside their time, with narration throughout, means the material has landed. Keep the review queue running and spend the rest of your preparation on behavioral answers and on the companies you are actually targeting.

Two or three means one or two units need another pass rather than more problems. Look at which units the failures came from; if they cluster, that is the unit to reread. The notes above say which unit each problem belonged to.

Fewer than two, or consistently running out of time, usually points at recognition rather than knowledge. The fix is the naming habit: thirty seconds at the start of every problem naming the pattern and saying why, before any code. That is worth more than another fifty problems.

Key idea

Keeping this from decaying

Skill here fades fast without contact. The review queue is already scheduling everything you have solved, and keeping it running at twenty minutes a day is the single highest-value thing you can do.

Beyond that, the useful practice is not more problems. It is picking one already-solved problem a week and rebuilding it from nothing while explaining it aloud. That trains the two things interviews actually measure, retrieval and narration, and it costs half an hour.

Tip

What the interview grades that this course does not

Clarifying questions before starting. Nothing here punishes you for skipping them, and every real interview does.

Taking a hint gracefully, which means incorporating it rather than defending the approach you already had.

Writing code another person can read under time pressure: real names, small functions, no single-letter variables outside a tight loop.

Those three are learned with a person, not a problem set. If you can arrange mock interviews with someone, that is where the remaining gains are.

That is the course

One hundred and fifty problems, in an order built so that each one arrived after the ideas it needed and never after a solution to it.

If anything outlasts the details, make it the three questions rather than any particular algorithm. What is this recomputing. What has to be remembered. Why is this choice safe.

The guard in the wrapping problem

The best wrapping total equals the overall total minus the smallest contiguous stretch. Why does that formula need a guard?

What is worth continuing

Select the practices most likely to keep this skill from decaying over the next few months.

← PreviousThat is the end of what is written so far.