Senior Software Engineer interview questions

Reviewed by Mark Dickie · Last updated

Senior Software Engineer interviews are assessments of production-level engineering depth across databases, backend code, distributed system design, and cloud infrastructure. The hardest rounds test whether you can reason about trade-offs under load, not just recall definitions. Expect to write and optimize SQL against a real schema, debug or extend Python under time pressure, design systems that scale to millions of requests, and answer probing follow-ups on AWS service selection and cost.

Preparation should weight system design and SQL the heaviest, since those rounds carry the most signal at senior level. Python and HTTP/API questions are often the coding screen, while AI Engineering questions check whether you understand LLM integration patterns well enough to ship them responsibly.

Competency areaWhat the round covers
Databases & SQLQuery optimization, indexing strategy, joins, window functions, transaction isolation
PythonIdiomatic patterns, concurrency (asyncio, threading), memory model, debugging
HTTP & APIsREST and RPC design, idempotency, caching headers, auth flows, rate limiting
System DesignScalability, data partitioning, consistency models, queue-based architectures
AI EngineeringRAG pipelines, prompt engineering, model evaluation, cost and latency trade-offs
AWSService selection (RDS vs DynamoDB, Lambda vs EC2), IAM, networking, cost control

How should you sequence your study for a Senior Software Engineer interview?

Work through the areas in order of interview signal, not alphabetical convenience:

  1. Start with system design, because it is the round where senior candidates are separated from mid-level. Practice designing a real system end-to-end: capacity estimates, data model, component diagram, and a verbal trade-off discussion.
  2. Sharpen SQL and database internals next. Write queries that join three-plus tables, use window functions, and explain query plans. Know when an index helps and when it does not.
  3. Lock down Python coding fluency. You should be able to implement a class hierarchy, handle concurrent I/O, and spot a memory issue in under 20 minutes.
  4. Review HTTP fundamentals and API design patterns: status codes, idempotency keys, pagination, and caching.
  5. Brush up on AWS service selection and AI Engineering patterns together, since both rounds ask you to pick the right tool and justify it.

The live quiz below pulls real interview questions across all six areas, and the salary and demand data underneath reflects current market figures for the role.

What to study, in order

For a senior Software Engineer interview, prioritise the role's most in-demand technologies first:

  1. Databases & SQL
  2. Python
  3. HTTP & APIs
  4. System Design
  5. AI Engineering
  6. AWS

What do Software Engineer roles pay in 2026?

From live job postings, the median Software Engineer salary is A$107,500, across 7,794 postings in November 2026. These figures are role-wide across all seniority levels, as of November 2026.

25th percentileA$79,500
Median (50th percentile)A$107,500
75th percentileA$154,875

Advertised base salary, from 2,430 job postings with pay data, as of December 2026.

We're not publishing a month-by-month series yet: the number of postings Tarmac collects each month is still growing, so a month-on-month change would measure our coverage rather than the job market.

Practice questions

Place the steps of a single ReAct agent loop iteration in the correct order, starting from when the model receives the current context.#

Put these in order

  • Model produces a Thought (internal reasoning chain)
  • Model emits an Action (tool name + arguments)
  • Environment executes the action and returns an Observation
  • Observation is appended to the context and the loop checks for a final answer / termination condition
Show answer
  1. Model produces a Thought (internal reasoning chain)
  2. Model emits an Action (tool name + arguments)
  3. Environment executes the action and returns an Observation
  4. Observation is appended to the context and the loop checks for a final answer / termination condition
Why:

In a ReAct-style agent loop, the canonical cycle is: (1) Reason — the model produces a Thought about what to do next; (2) Act — the model emits a tool call/action based on that thought; (3) Observe — the environment executes the action and returns an observation; then the loop repeats with the new observation appended to the context until a final answer is produced. Skipping or reordering these steps breaks the grounding that makes ReAct reliable.

Your service writes a brand-new object to S3 and, a millisecond later, issues a GET for that same key from another instance. What consistency does S3 guarantee for that read today?#

Options

  • Strong read-after-write: the GET is guaranteed to return the just-written object
  • Eventual consistency: the GET may return a 404 until replication settles
  • Strong consistency only if you enable Versioning on the bucket
  • Strong consistency only within a single Availability Zone
Show answer

S3 guarantees strong read-after-write consistency: a GET issued after a successful PUT always returns the latest object. Since December 2020 this applies automatically to all GET, PUT, LIST, and tag/ACL/metadata operations, in every Region, with no extra cost or configuration. The earlier eventual-consistency model — and the read-your-own-write workarounds built around it — no longer applies. It does not require Versioning and is not limited to one Availability Zone.

Why:

Since December 2020, S3 provides strong read-after-write consistency automatically for all GET, PUT, LIST, and tag/ACL/metadata operations, in every Region, at no extra cost. A read issued after a successful write always sees the latest data. The old eventual-consistency model (and the read-your-own-write workarounds people built around it) is gone — but a lot of legacy advice and interview prep still teaches it, which is the trap here. Versioning and AZ scope are unrelated to this guarantee.

A PostgreSQL table orders has 10 million rows. A B-tree index exists on the status column. The following query ignores the index and performs a sequential scan:#

Options

  • The index statistics are stale, so the planner underestimates index selectivity and falls back to a sequential scan.
  • The planner's cost model determines that fetching ~9.4 million heap rows via random index lookups is more expensive than a single sequential pass over the heap.
  • PostgreSQL never uses a B-tree index on low-cardinality columns like status; a partial index or GIN index is required.
  • The fillfactor of the index is too high, causing excessive index page splits that inflate the estimated index scan cost.
Show answer

The planner correctly chooses a sequential scan because fetching ~9.4 million rows via random index lookups would be far more expensive than one sequential pass over the heap. PostgreSQL's cost model weights random I/O (random_page_cost) higher than sequential I/O (seq_page_cost), so when a predicate matches a large fraction of rows the index offers no benefit.

Why:

PostgreSQL's query planner chooses between a sequential scan and an index scan based on cost estimates derived from statistics (pg_statistic). When a predicate matches a large fraction of rows (e.g., a low-selectivity condition like status = 'active' on a table where 95% of rows are active), the planner correctly decides that reading the entire heap sequentially is cheaper than random index lookups plus heap fetches. The planner uses the page-level cost model: random I/O has a higher cost constant (random_page_cost) than sequential I/O (seq_page_cost). An index is only beneficial when selectivity is high (few rows returned). Options about outdated statistics (ANALYZE not run) and fillfactor are distractors — the described behavior is correct planner behavior, not a bug.

You are designing a webhook consumer endpoint that receives order-created events from a third-party payment provider. The provider retries delivery up to 5 times with exponential back-off if it does not receive an HTTP 2xx within 10 seconds. Processing each event involves writing to a database and sending an email, which can take up to 30 seconds.#

Options

  • Process the database write and email inline, then return 200 OK. Add a unique constraint on the event ID to prevent duplicates caused by retries.
  • Verify the HMAC signature, process everything inline, and return 200 OK. Retries are only a concern if the signature check fails.
  • Verify the HMAC signature, persist the raw payload to a durable queue/store, return 200 OK immediately, and process asynchronously — using the event ID to deduplicate before acting.
  • Return 202 Accepted immediately without any verification, then process inline in a background thread within the same HTTP request lifecycle.
Show answer

The correct strategy is to verify the webhook's HMAC signature, persist the raw payload to a durable queue or store, return 200 OK right away, and process the event asynchronously — using the event ID to deduplicate before taking any action. This matters because the provider expects a 2xx within its 10-second timeout window, but the actual work (database write, email send) can take up to 30 seconds. If you do that work synchronously, the provider times out and retries, producing duplicate deliveries. Storing the raw payload first and processing it later is the standard accept-then-process pattern; checking the event ID before acting prevents duplicate side effects across retries.

Why:

Webhook reliability requires the consumer to respond quickly (within the provider's timeout window, often 5–30 s) with a 2xx status to acknowledge receipt, then process asynchronously. If the consumer does heavy work synchronously and times out, the provider may retry, causing duplicate deliveries. Idempotency keys/event IDs let consumers deduplicate retries. Signature verification (HMAC) guards against spoofed payloads but does not help with duplicate delivery. Storing the raw payload before processing is the correct 'accept-then-process' pattern. The strategy of verifying the HMAC signature, persisting the raw payload to a durable queue/store, returning 200 OK immediately, and processing asynchronously — using the event ID to deduplicate before acting — describes returning a 200 immediately and queuing the work — the correct pattern — while the others describe anti-patterns or incomplete solutions.

Assume CPython 3.13 and that the module is run as __main__. What exact line is printed by the following code?#

from __future__ import annotations
from typing import Optional, get_type_hints

class Node:
    def __init__(self, val: int, next: Optional[Node] = None) -> None:
        self.val = val
        self.next = next

hints = get_type_hints(Node.__init__)
print(hints['next'])
Show answer
typing.Optional[__main__.Node]
Why:

Under from __future__ import annotations, every annotation in Node.__init__ is stored as a string, so the next annotation is the string 'Optional[Node]'. typing.get_type_hints() evaluates those strings in the function's global namespace, where Optional and Node are both defined by the time the call runs (Node is fully defined before the call). The result is the object Optional[Node], which is Union[Node, None]. On CPython 3.13, the repr of this typing object is typing.Optional[__main__.Node], because the class Node defined in the __main__ module is shown with its module-qualified name. The __annotations__ dictionary, by contrast, would still hold the raw string, which is why get_type_hints() is needed to get the evaluated type.

You are designing a multi-region active-active key-value store for shopping carts. Each region accepts reads and writes and replicates asynchronously to the others. A user updates their cart from two regions nearly simultaneously, before either update has replicated. Which mechanism lets the system detect that the two updates were concurrent (neither causally preceded the other) without relying on wall-clock ordering and without silently discarding either update?#

Options

  • Last-Write-Wins using each node's local wall-clock timestamp
  • Two-phase commit coordinated across all regions before acknowledging each write
  • Version vectors attached to each write, where writes whose vectors are incomparable are flagged as concurrent siblings
  • A single leader region that assigns a global sequence number to every write
Show answer

Version vectors detect concurrent writes in active-active replication. Each write carries per-replica counters, and if neither version's vector dominates the other, the writes are flagged as concurrent siblings instead of one silently overwriting the other. Last-Write-Wins drops data, and two-phase commit or a single global sequencer needs cross-region coordination that undermines availability.

Why:

The requirement has three parts: detect concurrency, avoid wall-clock ordering, and keep both updates. Version vectors (vector clocks) record per-replica counters on each write; if neither vector dominates the other, the writes are concurrent and the system keeps both as siblings for a later merge. Last-Write-Wins orders writes by wall-clock time and drops the losing update, so it fails the no-discard requirement and cannot detect concurrency at all. Two-phase commit and a single global sequencer both require cross-region coordination before acknowledging writes, which conflicts with active-active availability and does not model concurrent writes. Vector clocks detect the conflict; the merge itself is a separate application step.

An AI agent framework separates memory into four tiers: in-context (working) memory, episodic/external memory (vector store), semantic memory (knowledge base), and procedural memory (learned skills/tool policies).#

Options

  • In-context memory is bounded by the LLM's context-window length and is lost between independent agent sessions unless explicitly reconstructed.
  • Episodic memory stored in a vector database allows an agent to retrieve semantically similar past observations without reprocessing the entire history in the prompt.
  • Procedural memory is best represented as a large JSON object appended to every system prompt so the agent can recall its own tool-call patterns.
  • Semantic memory (e.g., a knowledge graph or document store) can be updated at runtime without retraining the underlying model weights.
  • In-context memory persists transparently across independent agent sessions because transformer attention caches the KV state on the server.
Show answer

The correct statements are: in-context memory is bounded by context length and is lost between sessions unless rebuilt; a vector-DB episodic store enables efficient semantic retrieval without stuffing full history into the prompt; and semantic memory in an external store can be updated at runtime without touching model weights. Procedural memory encoded as a JSON blob in every prompt is wasteful and brittle, and KV caches are not session-persistent across independent API calls.

Why:

Agent memory architectures are typically decomposed into four distinct tiers that serve different temporal and functional purposes. In-context (working) memory is the active prompt window — cheap to read but bounded by context length. External/episodic memory (e.g., a vector store of past episodes) allows retrieval across unlimited history but requires an explicit lookup step. Semantic/knowledge memory stores structured facts the agent can query. Procedural memory encodes learned skills or tool-use policies, often baked into weights or fine-tuned adapters — NOT the in-context window, which is stateless across sessions. The statement that in-context memory persists across independent agent sessions is false: a fresh invocation starts with an empty context unless explicitly reconstructed from an external store.

You need a strongly consistent read in DynamoDB (read the latest committed write). Select all access patterns where a strongly consistent read is actually available.#

Options

  • GetItem on a base table with ConsistentRead: true
  • A Query on a local secondary index (LSI) with ConsistentRead: true
  • A Query on a global secondary index (GSI)
  • A read from a DynamoDB Stream
Show answer

Strongly consistent reads are available only on a base table and on local secondary indexes, opted into per request with ConsistentRead: true (reads are eventually consistent by default). Global secondary indexes keep their own asynchronously-replicated copy and are eventually consistent only — requesting a strong read on a GSI is rejected. DynamoDB Streams deliver change records eventually, not as consistent point reads. Routing a read path through a GSI when you need the latest write is the common design mistake.

Why:

Strongly consistent reads are supported only on base tables and local secondary indexes, because an LSI shares the partition's storage with the table. Reads default to eventually consistent; you opt into strong consistency per-request with ConsistentRead: true. Global secondary indexes maintain their own asynchronously-updated copy of the data, so they are eventually consistent only — passing ConsistentRead: true to a GSI query is an error. DynamoDB Streams deliver change records eventually, not as consistent point reads. The GSI limitation is the classic gotcha: people design a read path through a GSI and then discover they can't get a strong read there.

Consider relation R(A, B, C, D) with the following functional dependencies (FDs):#

Options

  • 1NF only
  • 2NF but not 3NF
  • 3NF but not BCNF
  • BCNF
  • 4NF
Show answer

The relation R satisfies 3NF but not BCNF. The dependency C → B violates BCNF because C is not a superkey (C⁺ = {C, B}, which does not cover all attributes). However, it satisfies 3NF because B is a prime attribute (part of candidate key AB), exempting C → B from the 3NF violation rule that applies only when the right-hand side is a non-prime attribute.

Why:

A relation is in BCNF if for every non-trivial functional dependency X → Y, X is a superkey. The given relation R(A, B, C, D) has FDs: AB → C, C → B, and AB → D. Check each: AB → C: AB is a superkey? AB → C and AB → D means AB determines all attributes (AB → ABCD), so yes, AB is a superkey. AB → D: same reasoning, valid. C → B: Is C a superkey? C+ = {C, B} ≠ {A,B,C,D}, so C is NOT a superkey. Therefore C → B violates BCNF. This relation is in 3NF (because B is a prime attribute — it's part of the candidate key AB), but NOT in BCNF. The relation is NOT in 4NF either because it first fails BCNF, and 4NF requires BCNF. The correct answer is 3NF but not BCNF.

A public REST API currently returns the following response for GET /users/{id}:#

Options

  • Renaming the field full_name to name
  • Adding a new optional field avatar_url to the response
  • Removing the field internal_score from the response
  • Changing the type of id from integer to UUID string (e.g., "id": "a1b2-...")
  • Returning HTTP 200 with an empty object {} instead of HTTP 404 when the user is not found
Show answer

The breaking changes that call for a new major version are: renaming full_name to name, removing internal_score from the response, changing id from an integer to a UUID string, and returning a 200 with {} instead of a 404 when a user is not found. Each of these can make a correctly written client behave differently without any code change — a field rename or removal breaks readers of the old key, the type swap on id breaks numeric handling, and the status change breaks clients that branch on 404 to detect a missing resource. Adding a new optional field, by contrast, is an additive, non-breaking change under most REST contracts.

Why:

Breaking changes are those that can cause existing well-written clients to behave incorrectly without modification. Renaming full_name to name breaks clients that read full_name. Removing internal_score breaks clients that depend on it. Changing id's type from integer to string breaks clients that store or compare it as a number. Returning 200 instead of 404 for a missing resource breaks clients that branch on HTTP status codes to detect absence. Adding a new optional field is generally considered a non-breaking, additive change under most REST versioning contracts.

You have a pytest test that should be skipped when the environment variable CI is not set OR is set to an empty string (i.e., when CI is falsy). Which decorator achieves this correctly?#

Options

  • Option A — os.getenv("CI") is None: skips only when CI is completely absent, but runs when CI=""
  • Option B — not os.getenv("CI"): skips when CI is absent or set to an empty string, treating both as 'not usefully set'
  • Option C — @pytest.mark.skip: unconditionally skips the test regardless of any environment variable
  • Option D — os.getenv("CI") is not None: skips when CI is set, which is the opposite of the intended behaviour
Show answer

The correct decorator is @pytest.mark.skipif(not os.getenv("CI"), reason="Only run in CI"). pytest.mark.skipif skips the test when its condition is True, and not os.getenv("CI") is True both when CI is unset and when it is set to an empty string. Checking is None would miss the empty-string case, since os.getenv("CI") returns "" rather than None when CI is exported as empty.

Why:

pytest.mark.skipif skips the test when its condition evaluates to True. The requirement here is to skip when CI is falsy — meaning absent or set to an empty string (e.g., CI=). not os.getenv("CI") is True in both of those cases, making Option B correct. Option A (is None) only returns True when the variable is entirely absent; if CI is exported as an empty string, os.getenv("CI") returns "" (not None), so is None is False and the test would run despite CI being empty — missing the falsy case. Option D inverts the logic and skips when CI is present. Option C unconditionally skips, ignoring the environment variable entirely.

A team is horizontally scaling a stateless web service behind a round-robin load balancer. Some user sessions break when requests land on different instances, so they enable sticky sessions (session affinity) at the load balancer.#

Options

  • Sticky sessions increase TLS handshake overhead per request; the remedy is to terminate TLS at the load balancer instead of at origin servers.
  • Sticky sessions re-couple users to specific instances, reintroducing per-instance state and uneven load distribution; the remedy is to externalise session state to a shared distributed store (e.g., Redis) so any instance can serve any request.
  • Sticky sessions cause the load balancer to skip its health checks; the remedy is to add application-level heartbeat endpoints on each instance.
  • Sticky sessions trigger a cache thundering herd on cold starts; the remedy is to pre-warm each instance with a read-through cache before it receives traffic.
Show answer

Sticky sessions pin each user to one instance, which brings back per-instance session state and uneven load across the fleet. The standard fix is to move session data into a shared store such as Redis, so any instance can handle any request and the service stays horizontally elastic.

Why:

Sticky sessions (session affinity) make the load balancer route a given user's requests to the same instance. That reintroduces per-instance state, because the session lives on one server, and it skews load, because heavy or long-lived users stay concentrated on particular instances instead of being spread evenly. The standard remedy is to externalise session state into a shared distributed store such as Redis, so any instance can serve any request and the stateless design is restored. The distractors are wrong for reasons unrelated to this mechanism: TLS termination location does not depend on affinity and sticky sessions add no per-request handshakes; the load balancer still runs its health checks under affinity; and cold-start cache thundering herds are not caused by session pinning.

You are building an automated evaluation pipeline that uses GPT-4 as an LLM-as-a-judge to score candidate model responses. Which of the following are systematic judge biases that have been documented in published LLM-as-a-judge studies (for example, Zheng et al. 2023 on MT-Bench)?#

Options

  • Position bias: in a pairwise comparison, the judge's verdict can change depending on which response is shown first.
  • Verbosity bias: the judge tends to prefer longer responses even when they are not more accurate or helpful.
  • Self-enhancement bias: a judge model rates outputs from its own model family disproportionately higher.
  • Reverse-order preference: the judge always favors the response presented second in a pairwise comparison.
Show answer

Position bias, verbosity bias, and self-enhancement bias are all documented systematic biases of LLM judges such as GPT-4. Position bias means verdicts can shift with presentation order, verbosity bias favors longer responses regardless of quality, and self-enhancement bias favors outputs from the judge's own model family. A reverse-order rule that always favors the second response is not a documented finding.

Why:

Three biases are documented in published LLM-as-a-judge work. Zheng et al. (2023) report position bias, where the verdict depends on presentation order; the direction varies by judge (GPT-4 mostly favored the first position, and Claude-v1 showed a strong first-position preference), so the bias is framed as order sensitivity rather than a fixed direction. They also report verbosity bias, where longer answers are favored regardless of correctness, and self-enhancement bias, where a model rates outputs from its own family higher. The claim that the judge always favors the second-presented response is clearly wrong, since the documented finding is a first-position preference for GPT-4 and Claude-v1, and it is not a universal rule for any judge.

A standard SQS queue can deliver the same message more than once, so consumers of a standard queue should be written to handle duplicate processing idempotently.#

Options

  • True
  • False
Show answer

True. Standard SQS queues provide at-least-once delivery — because messages are stored redundantly across servers, a transient failure during a delete can cause the same message to be received again, so consumers must process messages idempotently. FIFO queues are the option that suppresses duplicates and preserves order (exactly-once processing) at the cost of throughput. Treating a standard queue as exactly-once is a common cause of double-applied side effects like duplicate charges.

Why:

True. Standard queues guarantee at-least-once delivery: because SQS stores messages redundantly across servers, a server being briefly unavailable during a delete can cause the same message to be received again. So consumers must be idempotent. If you need duplicates suppressed and strict ordering, you use a FIFO queue, which provides exactly-once processing and ordered delivery (at lower throughput). Assuming a standard queue delivers exactly once is a frequent source of double-charged payments and duplicated side effects in production.

Which ACID property is directly responsible for defining the four standard isolation levels (READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE), and what problem does each level mitigate?#

Options

  • Atomicity — it ensures partial writes from concurrent transactions are rolled back, defining how much of another transaction's work is visible.
  • Consistency — it ensures concurrent transactions always leave the database in a valid state, which requires progressively stricter rules about what data each transaction can read.
  • Isolation — it controls the degree to which an in-progress transaction is shielded from changes made by other concurrent transactions, addressing anomalies such as dirty reads, non-repeatable reads, and phantom reads.
  • Durability — it ensures that once committed data is visible to all transactions, the engine must choose how long uncommitted data remains hidden from others.
Show answer

Isolation is the ACID property that controls how concurrent transactions interact with each other's uncommitted data. The four standard isolation levels (READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE) are all refinements of this guarantee, each trading off anomaly protection (dirty reads, non-repeatable reads, phantom reads) against concurrency throughput.

Why:

ACID's Isolation property is the one that governs how concurrent transactions see each other's in-progress changes. The four standard isolation levels (READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE) are all refinements of the Isolation guarantee. Atomicity ensures all-or-nothing completion; Consistency ensures data remains valid after a transaction; Durability ensures committed changes survive crashes. None of the other three properties concern themselves with concurrency anomalies like dirty reads, non-repeatable reads, or phantoms — those are isolation concerns.

Keep reading

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.