Interview Experience | SWE | π₯π₯π₯ | AI Coding Round
2026 (Oct-Nov) Software Engineer, AI-assisted coding rounds at three companies | Virtual | Hard
AI was allowed in all three. Each one worded it differently, and none of them said how much use they actually expected. Not naming the companies.
Round A β add a feature to an unfamiliar repo
Setup: models built into the platform, Claude or GPT, with planning mode and ask mode.
The problem:
The repo already has a feature flag module. Each flag has a config block, and right now it's only on/off:
new_checkout:
enabled: true
The code checks flags with is_enabled(flag_key, user_id) -> bool, which only looks at enabled.
Add a field rollout, an integer 0-100, meaning the percentage of users who get the flag:
new_checkout:
enabled: true
rollout: 20
- Input: flag_key, user_id. Output: whether this user sees the flag (True / False)
- The same user gets the same answer every time, on any machine
- rollout 0 means nobody, 100 means everyone; with
enabled: false, ignore rollout - Existing tests, can't change them
The readme's suggestion: map each user to a bucket 0-99, and the user is in if bucket < rollout. Example (hash values are illustrative):
rollout = 20
user 42 -> bucket 7 7 < 20 sees it
user 99 -> bucket 63 63 >= 20 doesn't
raise rollout to 70: user 99 now sees it, user 42 is still in
Asked the AI to summarize where flags get evaluated. It said just is_enabled(flag_key, user_id), so I put bucketing there. Most tests passed; the rest failed in a background job. That module had its own copy of the check and never called is_enabled. Not in the AI's summary. After that I stopped asking for summaries and had it search for every place that reads flag config and list them.
First bucketing was hash(user_id) % 100 < rollout with the language's built-in string hash. One test ran the same user in two processes and got different answers: the built-in hash is seeded per process. Switched to a fixed hash of flag_key + ":" + user_id, take the first few bytes, mod 100.
Why flag_key goes in, the interviewer pulled that out of me: without it every flag rolls out to the same users, and those users end up in every experiment. He was fine with < rollout itself: raise it and the original users stay in, lower it back and it's the same group.
Split the requirements into short lines myself and prompted one at a time: "only change is_enabled", "rollout 0 and 100 skip the hash", "don't touch existing tests". Ran tests after each.
Follow-up: two experiments must be mutually exclusive, nobody in both. Said layers, carve bucket ranges inside a layer per experiment. He asked whether ramping one up pushes into the other's range. Didn't work it out before time.
Round B β fewer results every query
Setup: HackerRank, no debugger, only print or tests. Built-in AI agent, and they said up front it won't tell you where the bug is or what the expected output is.
The problem:
Repo was roughly 10-15 files, a multi-tenant search service. Several customers (tenants) share one service, and each may only see its own data.
- Entry point is
search(tenant, text) -> list[Doc] - Each query builds a filters list for the backend; the conditions are ANDed, and one of them must be "only this tenant"
- Customer report: first query after startup is fine, then results keep shrinking in the same process until empty. Restart fixes it
- Task: find the cause, fix it, add a test that reproduces it, don't change other behavior
Example (the prompt only gave the symptom; the filters below are what I printed later):
request 1: search("A", "invoice") filters = [tenant == A] -> fine
request 2: search("B", "invoice") filters = [tenant == A, tenant == B] -> empty
request 2 should be [tenant == B]
Had the agent run the existing tests and give a short report: all green. Then coverage: the branch in apply_filters where no filters are passed was never hit. Every test passed them explicitly.
Signature was def apply_filters(q, filters=[]), and inside it filters.append(tenant_filter). The default list is created once, so each request adds one more tenant condition; the second query is an AND of two tenants, and it only gets emptier. Had the agent write a test calling it twice; second call empty. Red, then fixed: default None, new list inside.
That test was still red. Thought it was a result cache, added a cache clear, didn't help, wasted a lap. Finally printed it out; the handler file also had
filters = BASE_FILTERS
filters += [tenant_filter]
+= on a list mutates in place, so module-level BASE_FILTERS kept growing too. Changed to filters = BASE_FILTERS + [tenant_filter], passed.
Follow-up: how do you prevent this kind of thing. Said a lint rule for mutable defaults, tuples for module-level constants. He asked if threads make it worse; said requests could pick up another tenant's condition. Didn't finish how to write a test that reproduces that.
Round C β notebook, meter data
Setup: Python notebook with Claude built in, read/write access to tests, csv, readme.md. The email just said AI-use on Section 2, nothing else.
The problem:
The csv is a building's power meter readings, three columns:
local_time,utc_offset,kw
2026-11-01 00:05,-07:00,120
local_time is local wall-clock time, utc_offset is the time zone offset for that reading, kw is the power draw at that moment. Readings are irregularly spaced.
- Section 1: load, clean, sort by time
- Section 2: given threshold T, merge gap N minutes, minimum duration M minutes, output a list of overload windows
[(start, end), ...]- a reading with kw > T is overload; equal doesn't count
- a window starts at the first overload reading and ends at the next reading that isn't overload
- if the previous window's end and the next window's start are less than N minutes apart, merge them
- after merging, drop windows shorter than M minutes
- tests have the expected output for each parameter set
Example, T = 100, N = 10, M = 15 (same offset throughout, omitted):
00:00 90
00:05 120 overload starts
00:10 130
00:15 80 ends, window 1 is 00:05-00:15
00:20 110 overload starts
00:25 90 ends, window 2 is 00:20-00:25; 5 min after window 1, merge into 00:05-00:25
00:40 105 overload starts (15 min after the last window, no merge)
00:45 95 ends, 00:40-00:45 is only 5 min, dropped
00:50 100 equal to threshold, not overload
Output is one window: [(00:05, 00:25)].
Wrote Section 1 myself.
First try at Section 2 I was lazy, one line: do Section 2 per the readme and make the tests pass. It did, and also changed the dedup in Section 1, and rewrote one test's expected value to whatever it had computed. Tests green, obviously not OK. Reverted everything and told the interviewer why.
Second try, wrote a design.md first:
- an overload starts at the first reading above threshold and ends at the first reading that isn't
- merge first, then filter by minimum duration
- convert everything to UTC first
Told it to read that, no code yet, restate it. Then gave test names and edges together: an overload with a single reading, exactly at threshold, gap exactly N. Basically right in one go, one fix after on the gap comparison.
One test stayed slightly off: a window around 1 a.m. came out shorter than expected. Looked at the csv: 01:00 to 02:00 shows up twice with different offsets. DST ended that night, so the same local time really happened twice. My Section 1 deduped on local_time and dropped the second hour's real readings as duplicates. My bug, not Claude's. Converted to UTC with the offset before sorting and deduping, passed.
He asked what happens if you filter before merging. Gave an example: two short overloads with a brief gap; filter first and both vanish, though merged they're long enough.
Last: if it's a live stream, readings arriving one by one, when can you say a window has ended and emit it. Said once N minutes pass with no new overload reading. He asked about late readings. Didn't have an answer.