Live coding
Лайвкодинг
In this interview format, you write or modify code in real time while an interviewer watches and asks questions. They can assess how you reason about the problem and check your work, not just the code you finish with.
Also known as: livecoding, алгоритмическая секция
What live coding means in an interview
A live coding interview usually takes place in a shared editor or over a screen share. You might implement a function from scratch, fix a bug in starter code, or add a feature and test it. Unlike a take-home assignment, the session lets the interviewer see what you do when the requirements are unclear, a test fails, or a follow-up changes the problem.
An algorithms round is about what you solve; live coding is about how the session is run. A live session can focus on debugging rather than algorithms, and an algorithms interview can ask you to explain an approach without implementing it.
How to work through the prompt
First, agree on what the code should do. If the prompt says to find duplicates, for example, ask whether to return a Boolean, the duplicate values, or their positions. These are different tasks. Check input limits if they affect the design, and find out whether you can run the code or consult documentation.
State a workable approach before typing. If you can see a straightforward solution but not a faster one, explain its cost and use that to identify the bottleneck. The interviewer doesn't need a running commentary on every keystroke; explain decisions they can't infer from the code, such as why you're keeping extra state or what assumption lets you stop early.
Example: find whether a value repeats
Suppose the input is a list of integers and the function must return True if any value occurs twice. Comparing each pair takes O(n²) time in the worst case. A set trades extra memory for faster membership checks:
def contains_duplicate(values):
seen = set()
for value in values:
if value in seen:
return True
seen.add(value)
return False
Walk through [4, 2, 4]: the first two values go into the set, and the last 4 is already there. On [4, 2] and [], the loop finishes without a match. With average-case constant-time hash-set operations, the solution takes O(n) time on average and uses up to O(n) extra space, where n is the number of values.
What interviewers look for
The criteria depend on the exercise. In an algorithms round, expect questions about correctness, time and space complexity, and how the approach changes under tighter constraints. In a debugging exercise, expect to show how you narrowed down the failure and how you'd test the fix. If the editor can't run code, trace one ordinary case and one boundary case by hand. If time runs out, say which behavior you've checked and what still needs work rather than claiming the solution is finished.