Hiring for this role?

Start free with this plan

Free for your first open role.

Why Hirezen?
  • Every interviewer runs the same script and marks the same signals.
  • AI drafts the write-ups, and the debrief puts every read side by side.
  • No ATS to set up first, and no bot in the call.

Site Reliability Engineer (SRE) interview questionsCoding Test round

A 60 min interview plan with a time-boxed script, what each question is for, and the signals to score against. Key skills: SRE coding test on a fleet restart script that has to stop itself: reading what it does to production before it runs again, working out how many instances each zone can lose, adding a dry run, readiness checks and an abort on the error ratio, and asking whether the script should exist at all.

Opening

Who is interviewing, how the round will run, and a question to settle the candidate in. The standard opening

Read it before it runs again

14 min
What this part is for

Purpose

Runs in an editor over a small repository, in whichever language the candidate prefers for operational scripts; Python is what the starter is written in. Build the pack so you know exactly what is in it. `inventory.json` lists the 180 instances of `checkout-api`, 60 in each of `zone-a`, `zone-b` and `zone-c`. `fleet.py` is a client with `list_instances()`, `drain(id)`, `restart(id)`, `wait_healthy(id, timeout)` and `error_ratio(zone, window)`, backed by `fake_fleet.py`, a local stub whose behavior you change from a config file while the candidate works. `restart_stale.py`, about sixty lines, restarts every instance that has been up for more than fourteen days, because the service leaks memory. Plant five things in it. First, `--dry-run` is parsed by argparse and `args.dry_run` is never read. Second, `list_instances()` returns instances sorted by zone and then id, and the script cuts the stale list into batches of 20 in that order; 112 instances are stale — 41 in zone-a, 38 in zone-b, 33 in zone-c — so the first two batches are entirely zone-a. Third, it calls `restart()` without calling `drain()`. Fourth, the wait after each batch calls `wait_healthy()`, which polls `/healthz`; that endpoint answers 200 as soon as the process accepts connections, about 90 seconds before `/ready` does, because the service warms a cache first — and the function's `False` on timeout is ignored. Fifth, each restart sits in `try: … except Exception: log.warning(…); continue`, and the last line prints "restarted 112 instances" from the length of the stale list, not from anything that succeeded. One thing is deliberately right: the stale filter compares `started_at` in UTC and skips anything not `in_service`. Put three facts in the README and nothing else: traffic is split evenly across zones and stays in its zone unless a zone is lost, when the other two share it; at the Monday 09:00 peak a zone needs 40 ready instances to hold its latency target, and traffic at 03:00 is 35% of that peak; the last run was started by hand at 09:12 on Monday and finished at 09:16, and p99 latency alerts fired for zone-a at 09:13, zone-b at 09:14 and zone-c at 09:15, each clearing within about five minutes. The batch size of 20 looks alarming and is not the problem, which is worth knowing before a candidate spends five minutes on it. Send nothing ahead; the reading is the first part of the round. Book 70 minutes, with the close outside the 60.

•

I'm [YOUR_NAME], and I work on reliability for the checkout service at [COMPANY_NAME]. This is a coding round, but the first thing I want from you is reading. A teammate wrote this script after an incident, it has run against production twice, and it will run again next Monday.

What this line is for

Purpose

Tells a candidate who prepared for algorithm problems that the hour is about operational code, and that the script is real enough to have consequences.

•

Take a few minutes with the script, the client and the README before saying anything. Run it against the stub if you like — the stub is harmless. Look anything up. I care about what you notice, not about what you can recite.

What this line is for

Purpose

Makes running the code and searching explicitly allowed, so reading time is not mistaken for hesitation.

•

Someone runs this script again next Monday. Before they do, tell me everything it does to production that you would not let it do — in the order users would feel it — and point at the line where you saw each one.

What this question is for, and what to listen for

Purpose

Safe automation is read here. Separates a candidate who reads the script as an operation on a live fleet from one who reviews it as code. The first reads the batch order against the inventory and the health check against the README; the second finds the bare `except` and the unused flag and stops.

Signals to score

  • Runs the script against the stub, or reads `list_instances()`, to learn what order the batches come out in rather than assuming it
  • Connects the zone-sorted batches to the README's latency alerts, which fired one zone at a time, without being pointed at it
  • Names the missing drain as requests failing on restarted instances, not as a style problem
  • Notices that `/healthz` answers before the instance is ready, and that the script moves on to the next batch while the last one is still warming
  • Notices that the `False` from `wait_healthy()` is thrown away
  • Says that the swallowed exception and the final count together mean the script reports success whatever happened
  • Finds that `--dry-run` is parsed and never read, and says why that is worse than having no flag
  • Orders the findings by what a checkout customer feels first, and can say why that order
  • Says the stale filter is correct rather than rewriting it
  • Does not spend long on the batch size of 20 once the order and the readiness wait are understood

Follow-up questions

  • The README's p99 alerts fired for zone-a, then zone-b, then zone-c, a minute apart. Which lines explain that?
  • `wait_healthy()` returned for every instance. What was each instance doing for the next minute and a half?
  • An instance fails to restart. What does the script do next, and what does it print at the end?
  • Someone runs it with `--dry-run` to check the plan first. What happens?
  • Twenty instances at a time is 11% of the fleet. Is that the problem?

How much can be out at once

10 min
What this part is for

Purpose

A capacity question, asked before any code is written so that the limit the candidate codes in the next section is one they derived. The README's numbers are enough to answer it; nothing else is needed.

•

At 09:00 on a Monday, how many `checkout-api` instances can be out of service at once in each zone? Work it out from the README, then tell me whether you would run the script at that hour at all.

What this question is for, and what to listen for

Purpose

Capacity and dependencies are read here. Tests whether the candidate treats capacity as a number with a failure scenario attached rather than as headroom to spend. The separator is whether they ask what happens if a zone is lost while the script is running.

Signals to score

  • Derives 20 per zone at peak from 60 instances and a need of 40, and says it out loud
  • Asks what happens if a zone is lost mid-run, and works out that the other two zones then need 60 ready instances each at peak
  • Concludes that at peak any instance out of service turns a zone failure into an outage for someone
  • Moves the run to the daily low and redoes the arithmetic with the 35% figure — 14 ready per zone normally, 21 if a zone is lost
  • Counts every instance that is not ready against the limit, including one that failed to come back, not only the current batch
  • Wants the limit computed from the live ready count and live traffic when the script runs, not copied from the README
  • Proposes working one zone at a time, and says why that keeps a failure to one zone
  • Leaves a margin for instances that do not return, and says how big and why

Follow-up questions

  • Zone-b is lost at 09:13, halfway through the run. How many ready instances does zone-a need now?
  • Would you rather this ran at 09:00 or at 03:00, and what does the arithmetic say at 03:00?
  • Three instances from the first batch never came back. Do they count against your limit?
  • Where does the script get these numbers the day the traffic doubles?
  • Why one zone at a time rather than an even spread across all three?

Make it stop itself

26 min
What this part is for

Purpose

The writing. Before the round, prepare three stub settings you can switch without touching the candidate's code: `ck-a-017` restarts but never reports ready; zone-a's `error_ratio` over five minutes climbs to 1.8%; `error_ratio` times out once. Give the candidate two numbers when the section starts — checkout's SLO is 99.9% of requests succeeding over 30 days, and its normal error ratio is about 0.05% — and say that the metric trails reality by about a minute. Switch on the hanging instance once their loop restarts anything, the error ratio once they have any stop condition, and the timeout last. The code is scored on whether it would behave on Monday, not on style or completeness; a candidate who gets three of the settings right in plain code has done better than one who builds a framework.

•

Now change it. I will be switching the stub underneath you as you go, and I will tell you each time I do. Run it whenever you like.

What this line is for

Purpose

Warns that the environment will change on purpose, so a candidate does not spend minutes doubting their own code when an instance hangs.

•

Make this script safe for someone who did not write it to run next Monday. Start with the change that prevents the worst outcome, tell me why that one, and run it against the stub as you go.

What this question is for, and what to listen for

Purpose

Safe automation is read here. The load-bearing exercise. Most engineers who have run fleet operations have written a script like this and learned its missing safeguards one incident at a time; the separator is whether the stop conditions are built in before the stub forces them, and whether the script leaves the fleet in a known state when it stops.

Signals to score

  • Makes a dry run the default and needs an explicit flag to act, and the dry run prints the whole plan: which instances, in what order, per zone
  • Drains each instance before restarting it and bounds how long it waits for the drain
  • Waits on `/ready` rather than `/healthz`, with a timeout, and treats the timeout as a failure rather than carrying on
  • Enforces the per-zone limit by reading the zone's live ready count before each restart, not by choosing a batch size
  • Stops the run when an instance does not come back, or after a failure budget small enough to state and defend
  • Takes the zone's error ratio as a baseline before starting and checks it before each restart, with a threshold tied to the SLO rather than to zero
  • Stops when the metrics call fails, and says why continuing blind is the wrong default
  • Leaves nothing drained and forgotten when it stops, and prints what it did, what it did not do, and which instance needs a human
  • Keeps a rerun safe — instances already restarted are no longer stale, so the filter skips them — and says so
  • Reports counts from what happened rather than from the plan

Follow-up questions

  • `ck-a-017` never becomes ready. What does your script do next, and what state is zone-a in when it exits?
  • Zone-a's error ratio is 1.8% and the next restart is due. What happens?
  • The metrics call just timed out. Carry on or stop?
  • The run stopped halfway at 03:20. What does the person who started it see, and what do they do?
  • Why that threshold and not zero?

Every Monday, for how long

10 min
What this part is for

Purpose

The question behind the script. A safe workaround is still a workaround, and the better it works the less anyone looks at the leak it exists for. Scored under the same competency as the code, because deciding what automation should not become is part of writing it.

•

The script is safe now, and it restarts about a hundred instances every week because `checkout-api` leaks memory. Should it still exist in six months? What do you do about that this week?

What this question is for, and what to listen for

Purpose

Safe automation is read here. Tests whether the candidate treats recurring operational work as a cost to be driven down or as a job to be done well forever. A candidate who has owned a service's toil has an answer with a date and an owner in it; one who has not proposes to schedule the script.

Signals to score

  • Says the script treats a symptom, and that making it safe also makes the leak easier to live with
  • Wants the leak measured — memory growth per instance per day, and how long an instance would last without restarts
  • Hands the leak to the team that owns `checkout-api`, with that data, rather than absorbing it quietly
  • Puts a condition or a date on deleting the script and writes it down beside the script
  • If restarts must continue, restarts on memory crossing a threshold rather than on age, and says what that changes
  • Counts what the restarts cost: someone's time each week, and requests put at risk against the error budget on every run
  • Asks how anyone would notice the leak getting faster after a release, since the weekly restart hides the trend
  • Says what has to alert if the script is scheduled and quietly stops running

Follow-up questions

  • The checkout team says the leak is low priority because your script handles it. What do you say to them?
  • Next month's release doubles the leak rate. How would you find out, and when?
  • What would have to be true for you to delete this script?
  • It moves from someone's Monday to a scheduler. What has to page when it fails?
  • Age or memory — which should decide when an instance restarts, and why?

Closing

That is the end of the exercise. Before we stop, what do you want to ask me about how changes reach production here — who runs operations against the fleet, what stops them, and what went wrong last time?

What this line is for

Purpose

A candidate who has run operations against a live fleet asks about the safeguards and the last bad run; one who has not asks about the tooling stack. Naming the topics makes what they choose the signal.

One honest thing before you go: [name one true, specific weakness in how your team changes production — a script with no dry run, a runbook step done by hand at peak, a workaround that has outlived its reason]. It would be yours to fix. I would rather you heard it from me today.

What this line is for

Purpose

Ends on a true, specific, unflattering fact about the team's own operations. For the candidate this round is meant to find it is the strongest reason to join, and for one who wanted the fixing already done it is a fair warning. Check it is still true before you say it.

Their questions for you, and what happens next. The standard closing

Site Reliability Engineer (SRE) interviews — common questions

Who is this Site Reliability Engineer (SRE) interview plan for?
It is written for the interviewer, not the candidate: the hiring manager, engineer or panel member running the Coding Test round for a Site Reliability Engineer (SRE) role. It gives you a 60 min script to follow in the conversation — 4 questions with what each one is for and the signals to score against — so you are not writing the round from scratch the night before.
What does the Coding Test round assess?
This round is focused on: SRE coding test on a fleet restart script that has to stop itself: reading what it does to production before it runs again, working out how many instances each zone can lose, adding a dry run, readiness checks and an abort on the error ratio, and asking whether the script should exist at all. It works through Read it before it runs again, How much can be out at once, Make it stop itself and Every Monday, for how long, scoring against 36 observable signals, with follow-up prompts on all 4 questions for going deeper where an answer is thin.
How is the 60 min split up?
60 min on 4 questions. The questions take in Read it before it runs again (14 min), How much can be out at once (10 min), Make it stop itself (26 min) and Every Monday, for how long (10 min). The timings are there so the round stays on schedule and every candidate gets the same shape of interview — which is what makes two candidates comparable afterwards.
What other rounds should I run for a Site Reliability Engineer (SRE)?

A single round does not cover a whole role. The other rounds in this library for a Site Reliability Engineer (SRE):

Hiring for this role?

Open this plan in Hirezen and make it a position in one click.

  • Every interviewer runs the same script and marks the same signals.
  • AI drafts the write-ups, and the debrief puts every read side by side.
  • No ATS to set up first, and no bot in the call.
Start free with this plan

Free for your first open role.