← Interview Prep

Live Coding — How to Approach

A meta guide to performing in a codepad / live-coding interview for a network-automation engineer role: talk through your process, pick the right structure, and dodge the language-specific traps that silently sink people.

In a live-coding round the interviewer is grading your process at least as much as the finished code. A blank editor with no interpreter, no linter, and no autocomplete is a hostile environment — and the way you narrate your thinking is what separates a hire from a pass. The single most important habit to internalize:

Silence reads worse than imperfect code. If you are stuck, say out loud exactly where you are stuck and propose a temporary fix (// TODO: linear for now, speed up below). An interviewer can work with a narrated, half-optimal solution; they cannot grade a silent, frozen screen.

The think-aloud protocol

Rehearse these five moves until they are automatic — say them while you code, not after. They are the phrases the interviewer is listening for.

  1. Clarify inputs / outputs & edge cases before coding. "Is the input always valid or do I need to validate it? What do I do with duplicates? Does IPv6 need to work?" Pin down the contract before you type a single line.
  2. State the plan and the complexity before writing. "I'll go in two passes: first parse into a structure, then compute. That's O(n log n) because of the sort." Announce the shape of the solution and its cost up front.
  3. Say the edge cases out loud. "Empty input, a single element, everything contiguous, counter wrap-around." Naming them proves you thought about them even if you don't code every one.
  4. State tradeoffs explicitly. "I'm writing a linear scan for now — O(n). If there are millions of routes, this wants a patricia trie and I can rewrite it." Make the interviewer see that you know the cheap solution's limits.
  5. Name the tests you'd write. "I'd cover four cases: happy path, empty input, duplicates, and bad input." Name them even if there's no time to actually write them — this is exactly what a process-focused interviewer values.

How to answer

The winning strategy is boringly reliable:

Python — common codepad mistakes

These are the "on dry paper, no interpreter" traps that bite when there's no linter to catch them:

Go — common mistakes

Go concurrency pitfalls (run with -race)

Half the point of the concurrency drills is getting the race detector to stay silent — go test -race ./...:

Practice method

The training that actually transfers to a codepad:

Live-coding drills are from the network-automation domain (VLAN ranges, MAC normalization, counter deltas, LLDP graphs, prefix aggregation, worker pools) but solve as pure functions — no devices, no network, stdlib only.