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.

/lc-coach review sliding_window_maximum.py
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

RuleWhy
A round is not an averageOne signal at NH caps the round at LNH. Anything at SNH is SNH for the round, however well the rest went.
Hints cost a rungReaching 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.

Review

โ€œwould this pass?โ€

Verdict, the failing input, complexity vs optimal, the bottleneck line, four signals, one drill.

Bottleneck

โ€œwhy is this slow?โ€

The single line that sets the bound, and the structure that removes the repeated work.

Dry run

โ€œwalk me through itโ€

A state table, one row per iteration, stopping at the row that breaks the invariant.

Teach

โ€œI don't get monotonic stacksโ€

Brute force โ†’ what repeats โ†’ what structure kills it โ†’ the invariant โ†’ only then the template.

Mock

โ€œinterview me on LC 239โ€

35 minutes in character. It asks, then goes quiet โ€” because silence is data.

Polish

โ€œclean this upโ€

An interview-grade rewrite โ€” a different bar from production โ€” plus what changed and why.

Siblings

โ€œ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.

Debrief

โ€œ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.

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.

  1. L1A question about your own code โ€” what does lo hold when the loop exits?Costs nothing. Still SH territory.
  2. L2A failing input, no diagnosis โ€” try [3,3], target = 6.Ceiling drops to H: the counterexample was mine, the diagnosis yours.
  3. L3The category of the fix โ€” you recompute a max you have already seen.Ceiling LH โ€” โ€œgot there after I pointed at the recomputationโ€.
  4. L4The invariant, or the template's name.Ceiling LNH โ€” I named the structure, not you.
  5. 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.

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.