20 role-specific questions
Full Stack Developer Interview Questions & Answers
Full stack interviews check that you can deliver a feature end to end: an accessible, fast UI, a well-designed API, a sensible data model, and the judgement to know where logic belongs.
Free, no sign-up. 120 questions in this role's practice pool, including behavioural, HR and situational questions.
HTML, CSS & the browser interview questions
Semantics, accessibility, CSS layout, web performance and how browsers render — the fundamentals behind every front-end role.
1.
Why does semantic HTML matter? Give examples.
BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Accessibility and quality awareness, not just visual output.
Key points a strong answer covers
- Meaningful elements. Use elements for their meaning:
<nav>,<main>,<button>,<article>. - Accessibility. Assistive technology relies on semantics for landmarks, roles and keyboard behaviour.
- SEO / machines. Search engines and other tools understand the structure better.
- div button problem. A clickable
<div>isn't focusable or keyboard operable;<button>is, for free.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Using headings for font size rather than structure.
- Building buttons from divs.
Likely follow-up questions
- What does a
<button>give you that a<div onClick>doesn't? - How should heading levels be structured on a page?
Example strong answer
Semantic HTML means using elements for what they are, not how they look:
<header>,<nav>,<main>,<article>,<button>, a single logical heading outline. It matters mostly for accessibility: screen-reader users jump between landmarks and headings, and a real<button>is focusable, announced as a button and works with Enter and Space automatically — a<div onClick>gives you none of that. It also helps search engines understand the page and makes the code easier to read. Accessibility audits I've done usually find most problems come from non-semantic markup, so fixing that first is cheap and effective.- Meaningful elements. Use elements for their meaning:
2.
How do you make a web application accessible?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Practical accessibility knowledge beyond buzzwords.
Key points a strong answer covers
- Semantics first. Native elements and proper labels before ARIA.
- Keyboard. Everything usable by keyboard with a visible focus; manage focus in dialogs.
- Contrast / text. Sufficient contrast, alt text, text that resizes.
- ARIA used carefully. ARIA only when there's no native equivalent; live regions for updates.
- Testing. Test with axe/Lighthouse and a real screen reader; follow WCAG 2.2 AA.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Adding ARIA to everything instead of using native elements.
- Relying only on automated tools.
Likely follow-up questions
- How would you build an accessible modal dialog?
- What can automated tools not catch?
Example strong answer
I start with semantics: native elements, labelled form fields and a sensible heading structure — that solves most issues. Then keyboard: every action reachable by Tab, a visible focus style, and focus managed properly in modals and menus — moved in on open, trapped, returned on close. Colour contrast of at least 4.5:1 for body text, meaningful alt text, and layouts that survive 200% zoom. ARIA only where there's no native option —
aria-livefor toast messages,aria-expandedon a disclosure. I test with axe in CI, then manually with the keyboard and VoiceOver or NVDA, because automated tools catch maybe a third of issues. WCAG 2.2 AA is the usual target.3.
Explain the CSS box model and
box-sizing: border-box.BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Whether you understand how element sizes are calculated — the root of many layout bugs.
Key points a strong answer covers
- Four layers. Every box is content, padding, border and margin.
- content-box default. By default width applies to the content, so padding and border make it wider.
- border-box. border-box makes width include padding and border — easier to reason about.
- Margin collapse. Vertical margins between blocks can collapse.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Not knowing why an element with width: 100% and padding overflows.
- Forgetting margin collapsing.
Likely follow-up questions
- When do vertical margins collapse?
- How does
box-sizingaffect a flex item's size?
Example strong answer
Every element is a box made of content, then padding, then border, then margin outside. With the default
box-sizing: content-box,widthsets only the content, so awidth: 100%element with 20px padding ends up wider than its parent and overflows. Withborder-box,widthincludes padding and border, so the element is exactly the width you set — that's why most resets apply*, *::before, *::after { box-sizing: border-box }. Margins sit outside the border and don't count, and adjacent vertical margins between blocks can collapse into one, which surprises people.4.
When would you use Flexbox and when CSS Grid?
BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Whether you choose the layout tool that fits the problem rather than forcing one everywhere.
Key points a strong answer covers
- Flexbox one dimension. Flexbox lays items out along one axis.
- Grid two dimensions. Grid controls rows and columns together.
- Content vs layout first. Flex is content-driven; Grid defines the layout and places content into it.
- Examples. Flex for toolbars and nav bars; Grid for page layouts, galleries, card grids.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Using Grid or Flex dogmatically for everything.
- Not knowing
gapworks in Flexbox too.
Likely follow-up questions
- How would you build a responsive card grid without media queries?
- How do you centre an element both ways?
Example strong answer
Flexbox is for one dimension — a row or a column — and it's content-driven: items size themselves and you distribute space, which is perfect for a nav bar, a toolbar, or aligning an icon with text. Grid is two-dimensional: you define rows and columns and place items into them, so it suits page layouts, dashboards and card galleries —
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr))gives a responsive card grid without media queries. They combine well: a Grid page layout with Flexbox inside each card. Both supportgap, and centring is justdisplay: grid; place-items: center.5.
What happens between typing a URL and seeing the page? Focus on how the browser renders it.
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
End-to-end understanding of loading and rendering.
Key points a strong answer covers
- Network. DNS lookup, connection (TCP/TLS), HTTP request, response.
- Parse HTML / DOM. The browser parses HTML into the DOM.
- CSSOM / render blocking. CSS builds the CSSOM; CSS and synchronous scripts block rendering.
- Layout and paint. DOM + CSSOM → render tree → layout → paint → composite.
- Scripts. Use defer/async so scripts don't block parsing.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Skipping the network part entirely.
- Not mentioning what blocks rendering.
Likely follow-up questions
- What's the difference between
asyncanddefer? - What causes a layout (reflow), and why is it expensive?
Example strong answer
First the network: a DNS lookup, then a TCP and TLS connection, then the HTTP request — often served by a CDN. As the HTML streams in, the browser parses it into the DOM and discovers other resources. CSS is render-blocking: the browser builds the CSSOM before it paints. A plain
<script>blocks parsing too, which is why I usedeferor modules. The DOM and CSSOM combine into a render tree; layout calculates each box's position and size; paint fills pixels; and compositing assembles layers on the GPU. To speed it up: small critical CSS, deferred scripts, preloading the LCP image and fonts, and avoiding layout-triggering work after load.6.
What are Core Web Vitals, and how would you improve each one?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Measurable performance knowledge.
Key points a strong answer covers
- LCP. LCP measures loading — when the largest content element appears (good ≤ 2.5s).
- INP. INP measures responsiveness to interactions (good ≤ 200ms). It replaced FID.
- CLS. CLS measures visual stability (good ≤ 0.1).
- Fixes. LCP: optimise and preload the hero; INP: break up long tasks; CLS: reserve space for media and ads.
- Field data. Measure with field data (CrUX, RUM), not only Lighthouse.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Still citing FID as the responsiveness metric.
- Only quoting Lighthouse lab scores.
Likely follow-up questions
- What's the difference between lab and field data?
- What usually causes a poor INP?
Example strong answer
Core Web Vitals are Google's user-centred metrics. LCP, Largest Contentful Paint, measures loading — good is 2.5 seconds or less; I improve it by serving a compressed, correctly sized hero image, preloading it, using a CDN and removing render-blocking resources. INP, Interaction to Next Paint, replaced FID and measures responsiveness — good is 200 ms or less; it's usually hurt by long JavaScript tasks, so I split work up, defer non-essential scripts and reduce hydration cost. CLS measures layout shift — good is 0.1 or less; I reserve space for images, ads and embeds and avoid font swaps that shift text. I track field data from real users, not just Lighthouse.
7.
What is CORS, and why do you get CORS errors?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Understanding of the same-origin policy and where to fix CORS issues.
Key points a strong answer covers
- Same-origin policy. Browsers block reading responses from a different origin by default.
- Server opts in. The server opts in with Access-Control-Allow-Origin and related headers.
- Preflight. Non-simple requests trigger an OPTIONS preflight first.
- Fix on the server. It's fixed on the server (or via a proxy), not in front-end code.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Trying to fix CORS in the frontend fetch call.
- Setting
Access-Control-Allow-Origin: *with credentials.
Likely follow-up questions
- Why doesn't Postman show CORS errors?
- What changes when the request includes cookies?
Example strong answer
CORS is a relaxation of the browser's same-origin policy. By default a page on
app.example.comcan send a request toapi.other.com, but the browser won't let the JavaScript read the response unless the server says it's allowed, with headers likeAccess-Control-Allow-Origin. For non-simple requests — say a PUT, or a JSON content type, or a custom header — the browser first sends an OPTIONS preflight to ask permission. So a CORS error is fixed on the server: allow the specific origin, methods and headers, or route through a same-origin proxy. Tools like Postman don't enforce it because it's a browser rule. With cookies you needcredentials: 'include'and a specific origin, not*.8.
Compare cookies, localStorage, sessionStorage and IndexedDB.
BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Choosing client storage safely.
Key points a strong answer covers
- Cookies sent to server. Cookies go with every request to their domain; httpOnly cookies are invisible to JavaScript.
- localStorage persists. localStorage persists, is synchronous, string-only, ~5MB per origin.
- sessionStorage per tab. sessionStorage is cleared when the tab closes.
- IndexedDB. IndexedDB is async and stores large structured data and blobs.
- Security. Don't keep auth tokens where XSS can read them; prefer httpOnly cookies.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Storing JWTs in localStorage without considering XSS.
- Storing large data in cookies.
Likely follow-up questions
- Why is localStorage a poor place for an auth token?
- When would you reach for IndexedDB?
Example strong answer
Cookies are small and sent automatically with every request to their domain, which makes them the right place for a session — as httpOnly, Secure and SameSite, JavaScript can't read them, which protects against token theft through XSS. localStorage persists across sessions, is synchronous and string-only with roughly 5 MB per origin — fine for preferences like the theme, but any script on the page can read it, so not for tokens. sessionStorage is the same but per tab and cleared when it closes — handy for a form draft. IndexedDB is asynchronous and stores large structured data and files, which is what offline apps and editors use.
9.
How do you protect a front-end application against XSS and CSRF?
AdvancedTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Security awareness for the client side.
Key points a strong answer covers
- XSS = injected script. XSS is untrusted content executing as script in your page.
- Escape / avoid raw HTML. Frameworks escape by default; avoid raw HTML or sanitise it (DOMPurify).
- CSP. A Content Security Policy limits which scripts can run.
- CSRF. CSRF tricks a logged-in browser into sending a request.
- CSRF defences. SameSite cookies, CSRF tokens and checking the Origin header.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Thinking React makes XSS impossible.
- Confusing CSRF with XSS.
Likely follow-up questions
- How can XSS still happen in a React app?
- Why do SameSite cookies help against CSRF?
Example strong answer
XSS is when untrusted content runs as script in your page — a comment containing
<script>or anonerrorattribute. React and other frameworks escape text by default, so the risks are the escape hatches:dangerouslySetInnerHTML,innerHTML, andjavascript:URLs in links. I avoid raw HTML, and when I must render it — rich text from a CMS — I sanitise it with DOMPurify. A Content Security Policy is a second layer that blocks inline and unknown scripts. CSRF is different: another site makes the user's browser send a request with their cookies. SameSite=Lax or Strict cookies block most of it, and for sensitive actions I add CSRF tokens or check the Origin header.10.
How do you build a responsive layout?
BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Practical mobile-first CSS.
Key points a strong answer covers
- Mobile first. Start with the small-screen layout and add breakpoints with min-width.
- Fluid units. Use fluid units, clamp() and fr instead of fixed pixels.
- Flexible layout. Grid and Flexbox that wrap naturally.
- Responsive media. Images with max-width: 100% and srcset/sizes.
- Container queries / testing. Container queries for components; test on real devices.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Designing desktop first and patching mobile.
- Fixed-width containers causing horizontal scroll.
Likely follow-up questions
- What do container queries solve that media queries don't?
- Why use rem for font sizes?
Example strong answer
I work mobile first: base styles for small screens, then
min-widthbreakpoints where the content needs them rather than for specific devices. Layouts use Grid and Flexbox that wrap on their own —repeat(auto-fill, minmax(…))handles a lot without breakpoints — with fluid units like %, fr and rem, andclamp()for typography that scales smoothly. Images getmax-width: 100%andsrcsetwithsizesso phones download smaller files. For components that appear in different widths, like a card in a sidebar or main column, container queries are better than viewport media queries. I check for horizontal scrolling and test on real phones, not just DevTools.
APIs & back-end architecture interview questions
API design, HTTP, caching, queues, microservices, reliability and observability — language-agnostic back-end questions.
1.
Design a REST endpoint for creating an order. Which method, status codes and error responses would you use?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Clean, predictable API design.
Key points a strong answer covers
- POST to a collection. POST /orders creates an order.
- 201 + Location. Return 201 Created with the new resource (and a Location header).
- Validation errors. 400/422 with a consistent error body listing field errors.
- Auth errors. 401 if not authenticated, 403 if not allowed.
- Idempotency. An Idempotency-Key header prevents duplicate orders on retries.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Returning 200 with
{ success: false }for errors. - Using GET or verbs in URLs like /createOrder.
Likely follow-up questions
- How would you make this safe to retry if the client times out?
- How would you version this API?
Example strong answer
I'd use
POST /orderswith a JSON body of items and a shipping address. On success,201 Createdwith the created order and aLocation: /orders/{id}header. Invalid input returns 422 (or 400) with a consistent error body — I like RFC 9457 problem details listing each field error. Unauthenticated requests get 401, and 403 if the user can't order for that account. A product that's out of stock might be 409 Conflict. Because clients retry on timeouts, I'd accept anIdempotency-Keyheader: the server stores the key with the result, and a retry with the same key returns the original order instead of creating a duplicate.2.
What's the difference between PUT and PATCH, and what does idempotent mean?
BeginnerTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Precise understanding of HTTP semantics, which decides how safe retries are.
Key points a strong answer covers
- PUT replaces. PUT replaces the resource with the representation sent.
- PATCH partial. PATCH applies a partial update.
- Idempotent meaning. Idempotent: repeating the same request leaves the server in the same state.
- Which are idempotent. GET, PUT and DELETE are idempotent; POST isn't; PATCH may or may not be.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Saying POST is idempotent.
- Confusing idempotent with safe (no side effects).
Likely follow-up questions
- Is DELETE idempotent if the second call returns 404?
- Why does idempotency matter for retries?
Example strong answer
PUT replaces the whole resource with what you send — fields you leave out are effectively removed or reset. PATCH sends only the changes, like
{ "status": "shipped" }. Idempotent means making the same request once or ten times leaves the server in the same state. GET, PUT and DELETE are idempotent; POST is not, because each call usually creates something new; PATCH can be either, depending on the operation — 'set status to shipped' is, 'add 1 to quantity' isn't. DELETE stays idempotent even if the second call returns 404, because the state is the same. It matters because networks fail and clients retry, and idempotent requests are safe to retry.3.
Where and how would you add caching to a slow API?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Caching strategy and the invalidation problem.
Key points a strong answer covers
- Layers. Cache at the HTTP/CDN layer, in the app (Redis), or in the database.
- Cache-aside. Cache-aside: check the cache, on a miss load and store.
- Expiry & invalidation. Choose TTLs and invalidate on writes.
- What not to cache. Be careful with per-user and strongly consistent data.
- Stampede. Prevent stampedes with locks, jitter or stale-while-revalidate.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Adding a cache without an invalidation plan.
- Caching per-user responses publicly.
Likely follow-up questions
- What is a cache stampede and how do you prevent it?
- How do Cache-Control headers interact with a CDN?
Example strong answer
First I'd confirm what's slow and how often the data changes. For public, rarely changing responses, HTTP caching with
Cache-Controllets the CDN and browsers serve them without touching the server. For expensive queries I'd use cache-aside in Redis: check the cache, on a miss load from the database and store the result with a TTL. On writes I invalidate or update the affected keys, so users don't see stale data for long. I'm careful with per-user data — it must never be cached under a shared key. And for very hot keys I'd prevent a stampede when they expire, with a short lock, TTL jitter or serving stale while one request refreshes.4.
When would you use a message queue, and what problems does it introduce?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Asynchronous architecture and its trade-offs.
Key points a strong answer covers
- Decouple / async work. Queues move slow or non-urgent work out of the request path and decouple services.
- Absorb spikes. They absorb traffic spikes so workers process at their own pace.
- Delivery guarantees. Most queues are at-least-once, so consumers must be idempotent.
- Failure handling. Retries with backoff and a dead-letter queue for failed messages.
- Examples. RabbitMQ, SQS, Kafka, BullMQ.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Assuming each message is delivered exactly once.
- No plan for messages that keep failing.
Likely follow-up questions
- How do you make a consumer idempotent?
- When would you choose Kafka over RabbitMQ?
Example strong answer
I'd use a queue when work doesn't need to finish inside the request — sending emails, generating reports, processing uploads — or to decouple services, so the order service publishes 'order placed' and billing and shipping consume it independently. Queues also absorb spikes: workers drain the backlog at their own pace. The trade-offs: most queues guarantee at-least-once delivery, so a message can arrive twice and consumers must be idempotent, for example by recording processed message ids. Messages that keep failing need retries with backoff and then a dead-letter queue to inspect. You also need monitoring of queue depth and age, and the system becomes eventually consistent.
5.
Monolith or microservices? How would you decide?
AdvancedTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Architectural judgement rather than following trends.
Key points a strong answer covers
- Monolith benefits. A monolith is simpler to build, deploy, debug and keep consistent.
- Microservices benefits. Microservices allow independent deployment and scaling and suit many autonomous teams.
- Costs of distribution. They add network failures, eventual consistency, and operational and observability overhead.
- Modular monolith / boundaries. Start with a modular monolith with clear boundaries; extract services when there's a real need.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Choosing microservices for a small team on a new product.
- Splitting services that share a database.
Likely follow-up questions
- What is a distributed monolith?
- How would you extract the first service from a monolith?
Example strong answer
It depends on the team and the problem more than the technology. A monolith is one codebase and one deployment: simpler to build, test, debug and keep consistent, which is usually right for a new product or a small team. Microservices pay off when several teams need to deploy independently, or parts of the system have very different scaling or reliability needs. But they bring network failures, eventual consistency, distributed tracing and much more operational work. My default is a modular monolith with clear domain boundaries and no cross-module database access, and extracting a service only when there's a concrete reason, like an image-processing workload that needs to scale separately.
6.
How do you make a back-end service observable in production?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Operational maturity.
Key points a strong answer covers
- Logs. Structured logs with request/correlation ids.
- Metrics. Metrics for latency, traffic, errors and saturation.
- Tracing. Distributed tracing (OpenTelemetry) across services.
- Alerting / SLOs. Alerts on user-facing symptoms tied to SLOs.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Logging unstructured text without request ids.
- Alerting on every CPU spike instead of user impact.
Likely follow-up questions
- What would you alert on for an API?
- How do traces help debug a slow request across services?
Example strong answer
I cover the three pillars. Logs are structured JSON with a request or correlation id on every line, so one request can be followed end to end, and no sensitive data. Metrics track the golden signals — latency percentiles, request rate, error rate and saturation — on dashboards in something like Prometheus and Grafana. Distributed tracing with OpenTelemetry shows where time goes inside a request across services and the database. Alerts fire on user-facing symptoms tied to SLOs — for example p95 latency over 500 ms or error rate over 1% for five minutes — rather than every CPU spike, and each alert links to a runbook.
7.
How would you implement rate limiting for an API?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Protecting services from abuse and overload.
Key points a strong answer covers
- Algorithms. Token bucket, fixed or sliding window.
- Key. Limit per API key, user or IP.
- Shared store. Store counters in Redis so limits work across instances.
- Response. Return 429 with Retry-After and rate-limit headers.
- Where. Enforce at the gateway/edge as well as in the app for sensitive endpoints.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Keeping counters in each instance's memory behind a load balancer.
- Returning 500 instead of 429.
Likely follow-up questions
- How does a token bucket allow short bursts?
- What extra limits would you put on a login endpoint?
Example strong answer
I'd identify clients by API key or user id, falling back to IP for anonymous traffic, and pick an algorithm — a token bucket is a good default because it allows short bursts while enforcing an average rate; a sliding window is simpler to explain. Counters live in Redis, often with an atomic Lua script, so the limit holds across all instances. Over the limit, the API returns 429 Too Many Requests with a Retry-After header and the usual rate-limit headers so clients can back off. Coarse limits belong at the edge — the API gateway or CDN — and stricter, specific limits go on sensitive endpoints like login and password reset.
8.
How do you evolve an API without breaking existing clients?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Backward compatibility discipline.
Key points a strong answer covers
- Additive changes. Prefer additive, backward-compatible changes.
- Versioning. Version breaking changes (URL or header).
- Deprecation. Deprecate with notice, headers and a timeline.
- Contracts / monitoring. Document with OpenAPI, test contracts and monitor who still uses old versions.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Renaming fields in place.
- Removing a version without checking usage.
Likely follow-up questions
- Is adding a new enum value a breaking change?
- What are consumer-driven contract tests?
Example strong answer
Most changes can be additive: new optional fields, new endpoints, new optional parameters — clients ignore what they don't know. I avoid renaming or removing fields and changing types or meanings in place. When a breaking change is unavoidable, I introduce a new version —
/v2/in the URL or a version header — and run both side by side. The old version is deprecated with clear notice,DeprecationandSunsetheaders, a migration guide and a timeline, and I monitor usage so I know who still calls it before removing it. An OpenAPI spec and contract tests catch accidental breaking changes in CI. Even adding an enum value can break strict clients, so I document how clients should treat unknown values.9.
How do you keep data consistent when one operation updates several services?
AdvancedTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Distributed transactions and practical patterns.
Key points a strong answer covers
- No distributed ACID. Two-phase commit is rarely practical across services.
- Saga. A saga runs local transactions with compensating actions on failure.
- Outbox. The transactional outbox writes the event in the same DB transaction as the change.
- Idempotency / eventual consistency. Consumers are idempotent; the system is eventually consistent.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Writing to the DB and publishing to a queue as two separate steps.
- Ignoring partial failures.
Likely follow-up questions
- What goes wrong if you save the order and then publish the event separately?
- Choreography or orchestration for sagas?
Example strong answer
Across services you can't rely on one ACID transaction, and two-phase commit is usually too fragile and slow. Instead I use a saga: each service performs a local transaction and emits an event, and if a later step fails, earlier steps are undone with compensating actions — for an order, payment is refunded and stock released. To avoid the classic bug of saving the order but crashing before publishing the event, I use the transactional outbox: the event is written to an outbox table in the same database transaction as the order, and a relay publishes it. Consumers are idempotent because events can arrive twice, and the business accepts eventual consistency, with the UI showing states like 'payment pending'.
10.
How would you design file uploads for large files (for example, videos)?
IntermediateTechnicalPractise this question and get feedbackWhat the interviewer is evaluating
Practical design for heavy payloads.
Key points a strong answer covers
- Direct to object storage. Store files in object storage, not the database or app server.
- Pre-signed URLs. Clients upload directly with pre-signed URLs, bypassing your servers.
- Multipart / resumable. Multipart or resumable uploads for large files.
- Validation & security. Validate size and type, and scan files.
- Processing. Process asynchronously (transcoding, thumbnails) via events.
Suggested answer structure
- Define it in one sentence.
- Explain how it works underneath.
- Give a practical example from code or a project.
- Close with a trade-off, pitfall or when you'd use it.
Common mistakes
- Streaming gigabytes through the API server.
- Trusting the file extension.
Likely follow-up questions
- How does a pre-signed URL stay secure?
- How would you show upload progress and resume after a dropped connection?
Example strong answer
I wouldn't stream large files through the API servers. The client asks the API for permission, the API validates the user, size and type and returns pre-signed URLs, and the browser uploads directly to object storage like S3. For large videos I'd use multipart upload so chunks upload in parallel and a dropped connection only retries one chunk, with progress shown per part. When the upload completes, storage emits an event that triggers background jobs: verify the real file type, virus-scan, then transcode and generate thumbnails. The database stores metadata and the object key, never the file itself, and files are served through a CDN.
Ready to answer them out loud?
Run a timed full stack developer mock interview, type or speak your answers, and get a score breakdown with what to improve.