← All topics

Engineering Decisions Interview Questions and Answers

Realistic scenarios with constraints and three workable options: caching, API styles, rendering, resilience, data storage, observability and releases. Each review explains when the other options would fit.

40 questions for Engineering Decisions interviews with answers and explanations - Junior, Middle and Senior levels. Sample questions, online quizzes and coding tasks.

Questions by level

Sample questions

A few questions from each level with the correct answer and an explanation.

Engineering Decisions · Junior

  1. A server-rendered site lets guests pick a dark theme. The very first HTML must already use the right theme, with no flash. Where do you keep the choice?
    Show the answer

    Correct answer: In a cookie the server reads on each request

    Only a cookie reaches the server with the request, so the HTML can be rendered in the right theme straight away. localStorage fits client-only apps, or if a small inline script may set the theme before paint. A database table fits signed-in users who want the setting on every device, but guests have no account.

  2. A search box calls an API billed per request. Results should appear while the user types, but not on every keystroke. What fits?
    Show the answer

    Correct answer: Debounce: request after a short pause in typing

    Debounce sends one request once typing pauses, so a burst of keystrokes costs a single call while results still appear without extra action. Throttle fits continuous streams like scroll or resize, where regular updates during the activity matter, but it would bill for half-typed words. Searching on Enter is the cheapest and fits expensive searches, but it breaks the requirement to show results while typing.

  3. A popular blog gets its articles edited a few times a day. Search traffic matters, and text up to an hour old is fine. How do you render the pages?
    Show the answer

    Correct answer: Pre-render them and revalidate about hourly

    Pre-rendering with periodic revalidation serves fast cached HTML to readers and crawlers, and an hour of staleness is allowed here. Per-request rendering fits personalized pages or data that must be current on every visit, and here it would only add load. Client-side rendering fits private dashboards, but it makes the first paint slower and is a poor match for pages that depend on search.

  4. An online store's catalog has 10,000 products. Shoppers compare items, share links to a position and need the footer. How do you display the list?
    Show the answer

    Correct answer: Numbered pages with the page number in the URL

    Numbered pages give each position a shareable URL and keep the footer reachable, which is what this catalog needs. Infinite scroll fits feeds that people browse without a goal, where a position doesn't matter. A virtualized list fits a data-heavy tool, where all rows are needed in the client, but downloading the whole catalog is wasteful here.

All 12 questions with answers →

Engineering Decisions · Middle

  1. A news feed serves 1M users, may lag by a minute, and every call to the upstream API is paid. What's the main approach?
    Show the answer

    Correct answer: A shared server cache with a TTL of about 60 seconds

    One shared entry means all users cost a single upstream call per minute, and the minute of lag is allowed. A browser cache fits personal data and saves repeat visits, but with 1M users each one still pays for an upstream call. Fetching on every visit fits data that must be exact, like a balance, and here it would multiply the bill for no benefit.

  2. After a transfer, the user opens their balance. The number must be exact, while the rest of the banking app reads from replicas. Where does this read go?
    Show the answer

    Correct answer: To the primary, with no cache in between

    Money shown right after a write must reflect that write, and the primary is the one place that guarantees it. A replica fits lists and history, where a second of lag is harmless. A cache with invalidation fits frequently read data with rare writes, but a missed invalidation here would show a wrong balance, which costs more than the extra read.

  3. You're publishing an API for external partners who use many languages. Responses should work with CDNs, and a partner's first call should take minutes. Which style?
    Show the answer

    Correct answer: REST over HTTP with an OpenAPI description

    REST needs nothing beyond an HTTP client, and GET responses work with CDNs out of the box. GraphQL fits clients with very different data needs, though caching usually takes more work because queries often go by POST. gRPC fits fast internal calls between services you control, but it needs generated clients and doesn't work directly from a browser.

  4. Web and mobile apps need very different data from the same services. Each client has its own team, and mobile suffers from large payloads. What do you add?
    Show the answer

    Correct answer: A separate BFF owned by each client team

    A BFF lets each team shape responses for its own screens and release without waiting for others. A ?fields= parameter fits small differences in one resource, but it won't aggregate several services for a screen. Direct calls fit a very small system, while here they would add round trips on mobile and expose the internal service layout.

All 14 questions with answers →

Engineering Decisions · Senior

  1. A social feed serves mostly users with a few hundred followers, plus some accounts with 50M. Reads must be fast. How do you build timelines?
    Show the answer

    Correct answer: A hybrid: fan-out on write, except for huge accounts

    Precomputed timelines make reads fast for most accounts, and merging huge accounts at read time avoids millions of writes per post. Pure fan-out on write fits a network with no extreme accounts, but one celebrity post would flood the write path. Pure fan-out on read fits low-read systems and stays simple, but assembling each feed on every open gets too slow at this scale.

  2. A store serves product pages from a global CDN. Descriptions rarely change, but a corrected price must appear within seconds. What's the caching strategy?
    Show the answer

    Correct answer: A long CDN TTL plus tag-based purges on change

    A long TTL keeps the hit rate high, and purging by tag applies a price fix everywhere within seconds. A short TTL fits content with no change events to hook into, but it sends far more traffic to the origin. Skipping the CDN fits fully personalized pages, and here it would give up speed for visitors around the world.

  3. A six-person startup is still searching for product-market fit, and domain boundaries keep moving. What architecture do you start with?
    Show the answer

    Correct answer: A modular monolith with clear internal boundaries

    A modular monolith keeps refactoring cheap while boundaries move, and clean modules can become services later. Microservices fit many teams that need independent releases, but six people would spend their time on network and deployment concerns. Per-endpoint functions fit spiky, isolated workloads, while spreading a changing domain across them makes shared logic hard to evolve.

  4. After saving an order, the service must publish an event to a broker. Events must not be lost, and the broker can't join a database transaction. What do you do?
    Show the answer

    Correct answer: A transactional outbox, published by a relay

    Writing the event in the same transaction as the order means both exist or neither does, and a relay delivers it later. Publishing after commit fits events you can afford to lose, but a crash between the two steps drops the event. Publishing first fits nothing that must stay consistent, because a failed commit leaves consumers reacting to an order that doesn't exist.

All 14 questions with answers →

Coding tasks

Write your solution right in the browser, and tests check it instantly. JavaScript interview classics (debounce, deepClone, Promise.all, an LRU cache), TypeScript tasks on generics, narrowing and utility types checked by the real compiler, Node.js backend logic (middleware, rate limiters, job queues), SQL queries in real PostgreSQL, and React components and hooks like a todo list, tabs, useDebounce and useInterval.

Open tasks →