Agent skill
LC Coach
the other side of the table
Every practice tool grades your answer. This one grades you โ the way the person across the table actually does it: a six-point verdict, the packet they would file, the input that breaks your code, the line that sets your complexity, and the one change that moves you a rung.
VERDICT โ LH. O(n) via a monotonic deque, matching optimal.
Right structure, but I had to ask for the trace.
CORRECTNESS
โ
empty input, k = 1, k = n, all-equal
โ k > len(nums) โ fails on [1], k=2 โ IndexError, want []
BOTTLENECK
none โ each index is pushed once and popped once
SIGNALS
Communication H approach stated before coding
Problem solving LH found the deque after L3
Coding H clean; one boundary bug, self-caught
Verification LNH traced only when asked
DRILL
Trace before I ask. That single habit is the rung.
A real review, in the shape it always comes back in: verdict first, evidence second, one drill last.
What you actually get scored on
Six rungs, not two
Real packets are not โhire / no hireโ. They are one of six calls, and almost every real candidate lands on one of the two borderline rungs โ which is exactly the distinction that practice feedback throws away. Pick a rung to see what it means, and what moves it. The same six codes score each individual signal too, against its own anchors โ your Coding score does not drop because the follow-up went badly.
Two rules that surprise people
| Rule | Why |
|---|---|
| A round is not an average | One signal at NH caps the round at LNH. Anything at SNH is SNH for the round, however well the rest went. |
| Hints cost a rung | Reaching optimal alone is H or better. After L3 it is at best LH; after L4 the problem-solving signal is LNH no matter how clean the code that follows. |
Eight modes, one loop
Ask in your own words
There is no command syntax to learn. The coach picks the mode from what you asked, says which one it picked, and works.
โwould this pass?โ
Verdict, the failing input, complexity vs optimal, the bottleneck line, four signals, one drill.
โwhy is this slow?โ
The single line that sets the bound, and the structure that removes the repeated work.
โwalk me through itโ
A state table, one row per iteration, stopping at the row that breaks the invariant.
โI don't get monotonic stacksโ
Brute force โ what repeats โ what structure kills it โ the invariant โ only then the template.
โinterview me on LC 239โ
35 minutes in character. It asks, then goes quiet โ because silence is data.
โclean this upโ
An interview-grade rewrite โ a different bar from production โ plus what changed and why.
โwhat do I do after LC 239?โ
A ladder of related problems grouped by what the difference teaches โ including the look-alike that isn't one.
โhow would an interviewer see this?โ
The packet as it would be filed: timestamped notes, signal by signal, the call, and the one-rung move.
Fixed shape, every time
What comes back
Verdict first, evidence second, exactly one drill last. Any section with nothing to say is dropped rather than padded. Here are the three that matter most.
VERDICT โ LNH. O(n*k) vs O(n) optimal. Correct, but the window max is
recomputed from scratch every step and there was no route to
better when asked.
CORRECTNESS
โ k > len(nums) โ fails on [1], k=2 โ IndexError, want []
COMPLEXITY
time O(n*k) because max(nums[i:i+k]) rescans the whole window
space O(1) besides the output
optimal O(n) via a monotonic deque of indices
BOTTLENECK
line 6 โ consecutive windows overlap in k-1 elements, so almost the
same range is rescanned every step โ a deque holding indices in the
window with decreasing values keeps the max at the front.
SIGNALS
Communication LH approach stated before coding
Problem solving LNH brute force reached, bottleneck not named (hints: L4)
Coding H clean, one boundary bug
Verification NH no trace, complexity given as "about O(n)"
DRILL
Redo it with a deque. Before writing a line, state the one-sentence
invariant that makes the front of the deque the window maximum.
Nobody in committee reads your code. They read this.
DEBRIEF โ LC 239, 35 min, as I would have filed it
WHAT I WROTE DOWN
00:00 asked for n's range before anything else โ good, it set the target
03:10 stated brute force O(n*k) and said it was too slow. Safety net exists.
06:40 went quiet. 4 minutes. I had nothing to write for this stretch.
10:30 I asked "what's repeated?" (L3). Got the deque a minute later.
22:00 clean code, good names, one off-by-one on the expiry check
29:00 I had to ask for the trace. Found their own bug once tracing.
SIGNALS
Communication LH strong open, then a 4-minute silence I could not score
Problem solving LH right structure, but L3 was mine, not theirs
Coding H one boundary bug, clean otherwise
Verification LNH did not trace until asked; complexity recalled, not derived
VERDICT โ LH (Lean Hire)
Positive, but it needs a second positive packet to survive committee.
The deque is right and the code is clean; what I could not write down
is a candidate who found the bottleneck or checked their own work.
WHAT WOULD HAVE MOVED IT ONE RUNG
Narrating the 4 quiet minutes. Not solving faster โ just saying
"two-pointers doesn't fit because the max isn't monotonic, let me try
a heap" turns an unscoreable gap into a problem-solving note, and L3
would have been theirs instead of mine.
Grouped by what the difference teaches โ never a tag dump.
LC 239 Sliding Window Maximum โ monotonic deque, extremum over a moving range
SAME INVARIANT, EASIER start here if 239 was a struggle
LC 496 Next Greater Element I the stack without the window [solved here]
LC 155 Min Stack "remember the extremum", 1-D [solved here]
ONE TWIST AWAY the actual drill
LC 862 Shortest Subarray, Sum โฅ K deque over prefix sums, not values
LC 1425 Constrained Subsequence Sum the deque lives inside a DP recurrence
SAME STORY, DIFFERENT STRUCTURE know why the deque wins here
LC 480 Sliding Window Median two heaps; a deque can't do order statistics
LOOKS LIKE A SIBLING, ISN'T
LC 84 Largest Rectangle monotonic stack, but nothing ever leaves
a window โ different invariant, don't
drill them together
Why it won't just tell you
Five rungs, and code is the last one
A solution you did not derive shows up in the real loop as โNo Hire โ memorisedโ. So hints climb, one rung at a time, and stop the moment you move. The ladder is numbered because the number is what a real interviewer writes down โ and what it costs you.
- L1A question about your own code โ
what does
Costs nothing. Still SH territory.lohold when the loop exits? - L2A failing input, no diagnosis โ
try
Ceiling drops to H: the counterexample was mine, the diagnosis yours.[3,3], target = 6. - L3The category of the fix โ
you recompute a max you have already seen.
Ceiling LH โ โgot there after I pointed at the recomputationโ. - L4The invariant, or the template's name.Ceiling LNH โ I named the structure, not you.
- L5Code โ only after L4 was tried, or you asked outright.In a real round this is NH. Here it is a teaching tool; know the difference.
Four markdown files, no dependencies
Install
Nothing to build and no network calls, so the same source runs on any agent that takes a system prompt. Pick yours.
Drop the skill directory into your user-level skills folder and it loads in every repo:
git clone --depth 1 https://github.com/yennanliu/CS_basics.git /tmp/cs_basics
mkdir -p ~/.claude/skills
cp -r /tmp/cs_basics/.claude/skills/lc-coach ~/.claude/skills/
Already installed inside this repo at .claude/skills/lc-coach/, so a clone
of CS_basics needs no setup at all. Claude Code matches it on the description, or you
can call /lc-coach by name.
Zip the directory, then Customize โ Skills โ + โ + Create skill โ Upload a skill:
cd .claude/skills && zip -r lc-coach.zip lc-coach
Leave the YAML frontmatter in SKILL.md intact. description is
what Claude matches your request against when deciding to load the skill on its own;
name is the display label, and the directory name is what supplies the
slash command.
Codex reads AGENTS.md at the repo root automatically. Point it at the skill:
## Interview coaching
When asked to review a solution, run a mock interview, teach a pattern,
suggest what to practise next, or write an interviewer debrief, follow
`.claude/skills/lc-coach/SKILL.md` and the files under its `references/`.
A pointer, not a copy โ one source of truth means a fix reaches every agent at once.
Same shape in GEMINI.md, or point at it for a single session:
gemini -p "Act as the coach defined in \
.claude/skills/lc-coach/SKILL.md. Review @solution.py"
Paste SKILL.md in as the system prompt. It is self-contained; the
references/ files are optional depth, and the coach works without them
with shallower pattern recall. For Cursor or Windsurf, put the Codex pointer above into
a rule file (.cursor/rules/interview-coach.mdc or the editor's equivalent).
curl -sL https://raw.githubusercontent.com/yennanliu/CS_basics/master/.claude/skills/lc-coach/SKILL.md
Then just talk to it
/lc-coach review leetcode_python/Sliding_Window/sliding_window_maximum.py
/lc-coach mock interview me on LC 239, 35 minutes
/lc-coach how would an interviewer have scored that? give me the packet
/lc-coach what should I drill after LC 239?
/lc-coach teach me monotonic deques โ I keep memorising the template
Under the hood
What is inside
SKILL.md is the whole coach. The three reference files load on demand, so the prompt stays small until depth is actually needed.
- SKILL.md The coach โ eight modes over one review loop, the six-point scale, the hint ladder, the siblings and debrief protocols, the output contract, and what it must never do.
- references/rubric.md Every signal anchored at all six levels, what each hint rung costs, how a packet becomes a committee decision, and a 90-second self-score card.
- references/patterns.md Every core pattern as recognition cue, invariant, target complexity and the classic off-by-one โ plus the three questions that resolve most mediums when the pattern will not come.
- references/talk-track.md The sentences to actually say, phase by phase, and the phrases that cost you the signal.
- INSTALL.md The install notes above, kept next to the skill so they travel with it.
Every one of these is gated in CI by check_skills.py โ frontmatter, orphaned references, and whether the links on this page still resolve.
The rest of the loop
Where it fits
The coach is the interviewer's side. The rest of this site is the study side: the roadmap says what to learn next and what it needs first, the cheatsheets hold the templates, the complexity quiz drills the analysis, the review plan schedules what keeps coming back, and LC Add โ the other skill here โ files the solution once you are done with it. This page is for the part none of those cover: whether the thing you just wrote would actually pass.