How a coding round is scored
The six moves that turn a correct idea into a hire signal: clarify, example, brute force, improve, code, test.
At Staff level the coding round is rarely the round that gets you hired, and often the round that gets you rejected. Interviewers are not grading whether you have seen the problem. They are grading whether they would trust your code in their repository on Monday.
OpenAI is the one lab that publishes its engineering bar: it looks for "well-designed solutions to the challenge, high-quality code, optimal performance, and good test coverage", plus communication and collaboration (official, Sources O3). Treat those four nouns as the rubric everywhere; most loops grade the same things whether or not they say so.
The six moves
- Clarify. Restate the problem in one sentence. Ask about input size, duplicates, negative numbers, empty input, and what to return when there is no answer. Two minutes, not ten.
- Work one example by hand. Small, but not trivial. Writing the expected output first is the cheapest test you will ever write.
- Say the brute force and its cost. "Every pair is
O(n²); withnup to10⁵that is too slow." This proves you can always produce something and sets up the improvement. - Name the pattern and the invariant. "A hash map of values seen so far turns the inner loop into a lookup." The invariant is the sentence you will use to debug later.
- Code it cleanly. Real names, a helper where it helps, no clever one-liners you cannot explain. Talk at the level of intent, not keystrokes.
- Test out loud. Walk your example through the code line by line, then the edge cases you listed in move 1. Fix bugs you find calmly; finding your own bug is a positive signal.
Language choice
Python is the default in third-party reports of Anthropic's loops, and it leads every 2026 posting count we found (Sources M4, A9). C# and .NET appear in none of the Anthropic or OpenAI engineering posts we counted (Sources §2.3). Every pattern on this site shows Python first and C# second. If C# is still faster for you under pressure, use it where the loop allows, and practise Python until the standard library (collections, heapq, bisect) is reflex.
| Need | Python | C# |
|---|---|---|
| Hash map with default | collections.defaultdict(int) | dict.GetValueOrDefault(k) / TryGetValue |
| Counter | collections.Counter(xs) | xs.GroupBy(x => x).ToDictionary(g => g.Key, g => g.Count()) |
| Queue / deque | collections.deque | Queue<T> / LinkedList<T> |
| Min-heap | heapq.heappush(h, x) | PriorityQueue<T, TPriority> (.NET 6+) |
| Sorted insert / search | bisect.bisect_left | Array.BinarySearch / List<T>.BinarySearch |
| Sort by key | sorted(xs, key=lambda x: x[1]) | xs.OrderBy(x => x[1]) or Array.Sort(a, (p, q) => p[1].CompareTo(q[1])) |
What a Staff candidate does differently
- States the trade-off before choosing: "I can sort for
O(n log n)withO(1)extra space, or hash forO(n)time andO(n)space. Memory is not constrained here, so I'll hash." - Separates the core algorithm from I/O and validation, the way production code would.
- Mentions what they would add with more time: property tests, input validation, a benchmark. One sentence each, not a lecture.
- Keeps the interviewer in the loop. Collaboration is a named criterion in OpenAI's guide, and pair-coding formats are listed there.
Practice
Written for this site to drill the lesson. Not reported interview questions.
- Take any pattern lesson in this track. Before reading it, run the six moves out loud on its problem with a 25-minute timer.
- Record yourself solving one problem. Count how long you were silent for more than 30 seconds.
- Write the test list for Two Sum before writing any code. Aim for six cases including empty input and duplicates.
Check yourself
What four things does OpenAI's published guide say it looks for in engineering solutions?
Well-designed solutions, high-quality code, optimal performance, and good test coverage; plus communication and collaboration.
Why say the brute force out loud?
It proves you can always produce a working answer, fixes the baseline cost, and makes the improvement a visible decision rather than a recalled trick.
When should you test?
Out loud, after coding: walk the hand example through the code, then each edge case you listed while clarifying.
Sources
- Official OpenAI interview guide
- Official Anthropic: Guidance on Candidates' AI Usage