Step-by-Step Architecture Defense of an AI Infrastructure System

Hard · Behavioral & Leadership · Software Engineer · Technical Screen

Prompt

Rather than solving a hypothetical design prompt, this technical interview inspects a real production system from your past work—ideally within AI or machine-learning infrastructure (such as pipelines feeding training clusters, distributed model training, or low-latency inference serving).

Pick a system you understand thoroughly from end to end and sketch its complete execution flow from initial request or raw input to final output. Step through your diagram sequentially, explaining for every stage:

  • The runtime service or compute process operating at that stage.
  • The exact data contracts entering and leaving it, plus how work is handed off to the downstream stage.

Expect the interviewer to pause you at any box or arrow to challenge your engineering rationale, probe viable alternatives you ruled out, examine the costs of your trade-offs, and drill into low-level implementation details of components you personally built. Before diving in, align briefly with your interviewer on scope: whether to present one system directly or pitch two options, whether to depict the real production compromises as shipped versus a clean-slate redesign, which subsystem (data ingestion, training, serving, or deployment and observability) warrants the deepest focus, and whether to start at component boundaries or code-level mechanics.

Scope & Expectations

  • End-to-end data-flow clarity: Present a numbered or clearly ordered pipeline diagram with explicit inputs, outputs, network protocols, and buffering or handoff boundaries at every stage.
  • First-principles trade-off defense: Justify each architectural decision with a concrete rejected alternative, a supporting benchmark or production metric, and the operational cost you accepted.
  • Accelerator & hardware fluency: Demonstrate practical command of GPU or compute bottlenecks—such as memory capacity, data-loading stalls, batching efficiency, and tail latency—wherever accelerators participate.
  • Poise under live interruption: Answer pointed deep-dive challenges concisely and resume your sequential walkthrough cleanly without losing track of the overall system tour.

Step-by-step walkthrough

  1. Understand why this round interrupts you on purpose

    Unlike a greenfield system design interview, this round puts a system from your own résumé under a microscope. Drawing the architecture is only the warm-up; the real test happens when the interviewer interrupts mid-sentence to challenge a single arrow or queue. They are checking five things:

    • Genuine hands-on depth: for every stage on your diagram, you know the exact process running inside, its incoming and outgoing payloads, and where it hits hardware limits.
    • Explicit trade-offs: every design choice had a reasonable alternative you rejected, backed by a measurement and an honest downside.
    • Grounded numbers: latency percentiles, throughput, memory budgets, and accelerator utilization come from real benchmarks rather than guesses.
    • Composure under challenge: treating "Why didn't you just use X?" as an invitation to share context, answering crisply, and returning cleanly to your diagram.
    • Candor about shortcuts: naming compromises you took to ship on time before the interviewer spots them.

    Bitdeer is publicly known for operating large-scale cryptocurrency mining data centers and expanding into AI cloud and GPU compute infrastructure. Expect interviewers to push hardest on accelerator efficiency: how data reaches GPUs without stalling, how GPU memory is budgeted, where accelerators sit idle, and how new model versions roll out safely.

    Open the session with a quick sixty-second scoping check before drawing: confirm one project to explore in full depth, commit to showing the real system as shipped with shortcuts flagged openly, ask whether they want extra focus on ingestion, training, serving, or rollout, and start at component boundaries before zooming into code wherever they probe.

  2. Prepare a defense card for every box before you draw

    Pick a focused AI infrastructure project where you can defend every single component over a sprawling platform you only partly touched. Before we sketch an inference serving example, let's define four core AI-serving terms in plain English so every piece of the diagram clicks:

    • LLM inference: running a trained large language model to generate output text (tokens) for live user requests.
    • KV cache (key-value cache): GPU memory storing intermediate attention vectors from earlier tokens in a conversation so the GPU does not recompute the whole prompt on every new word—and paged KV cache allocates that memory in small fixed-size blocks (like operating-system virtual memory) so fragmented gaps are not wasted.
    • Continuous batching: slotting newly arrived requests into an active GPU batch right between token-generation steps, rather than making short requests wait until the longest request in a fixed batch finishes.
    • Tensor parallelism: splitting each neural-network layer's weight matrices across multiple GPUs so they read memory and compute together on every step.

    Before the interview, write out a seven-line defense card for each step on your diagram:

    Component        Service/library + hardware (e.g., vLLM on 2 x A100-80GB)
    Input / Output   Payload format and protocol (HTTPS JSON -> SSE token stream)
    Hand-off         Queue, gRPC call, Kafka topic, or shared storage
    Decision         Choice made vs. the strongest rejected alternative
    Evidence         Load-test or production number that justified the choice
    Cost accepted    What got harder or slower as a trade-off
    Weak spot        What breaks first at scale, or shortcut you would redo today
    
  3. Draw a numbered flow diagram so interruptions never derail you

    Number every box [1] through [6], placing the live request path top-to-bottom and the slower deployment control path to the side. Numbering gives you an effortless bookmark after a three-minute tangent: "That covers [2] the router; moving down to [3] the GPU replicas..."

    5 Internal Product Teams (document summarization & JSON extraction)
           |  HTTPS POST (JSON prompt, deadline header)
           v
    [1] API Gateway: auth, per-team token/min quotas, request trace ID
           |
           v
    [2] Token-Aware Router: per-model queue, admission control (HTTP 503 if wait > deadline),
           |                routes to replica with fewest in-flight tokens
           v
    [3] GPU Serving Replicas: vLLM serving 13B FP16 model across 2 x A100-80GB (tensor parallel),
           |                  continuous batching + paged KV cache
           |  streamed tokens
           v
    [4] Streaming Post-Processor: stop sequences, PII redaction, JSON schema check (1 retry)
           |
           +---> SSE stream back to caller
           |
           v
    [5] Async Telemetry: Kafka -> Data Warehouse (latency, token counts, per-team GPU cost)
    
    Control Plane (off critical path):
    [6] Model Registry -> Offline Eval Gate -> 5% Canary via Router Weights -> Full Ramp / Instant Rollback
    

    Whenever the interviewer interrupts at step [k], answer with a tight three-part loop—(1) decision vs. alternative, (2) measured number, (3) accepted cost—and step right back onto [k + 1].

  4. Full first-person sample answer

    Below is the ~345-word uninterrupted spine for a Software Engineer candidate interviewing at Bitdeer. In a live interview, expect challenges after almost every paragraph.

    I'll walk through the internal LLM inference platform I led at my previous company, serving a 13-billion-parameter model to five product teams for document summarization and structured JSON extraction. I'll draw the system as built, including one compromise I'd reverse today.

    Step 1 is our HTTPS gateway. It authenticates the calling service, enforces per-team token-per-minute quotas, and attaches a trace ID. Enforcing quotas at the edge rejects runaway batch scripts before they consume any GPU cycles.

    Step 2 is our token-aware router. Instead of round-robin routing by request count, it estimates prompt tokens and picks the replica with the fewest queued tokens, because one 8,000-token contract costs dozens of times more GPU work than a short note. It also runs admission control: if estimated queue wait exceeds the caller's deadline header, it fails fast with HTTP 503 rather than burning GPU time on a response the caller has already timed out.

    Step 3 is the GPU replica pool, running vLLM with tensor parallelism across two 80-GB A100 GPUs per replica and paged KV-cache memory. Switching from static batching to continuous batching lifted throughput 2.5x at the same 95th-percentile latency in load tests. Because co-batched requests share memory bandwidth, the router caps total active tokens per replica to protect tail latency.

    Step 4 handles streaming post-processing: stop rules, sensitive-data filtering, and a JSON schema check with one automatic retry for malformed extraction calls. Step 5 logs latency and token counts asynchronously through Kafka to our warehouse for per-team cost attribution.

    Step 6 is our rollout control path: new model bundles pass an offline evaluation gate, take 5% canary traffic via router weights, and roll back in seconds by resetting weights if error rates rise.

    The shortcut I'd flag upfront is running replicas on a fixed day/night schedule instead of autoscaling, because loading 26 GB of weights took four minutes. Average GPU utilization sat around 45%—and at an infrastructure company like Bitdeer, reclaiming idle accelerator hours is the exact problem I'd solve next.

  5. Defend hardware math and edge cases under deep questioning

    Prepare crisp, physically accurate answers for the hardest infrastructure challenges:

    • "A 13B model in 16-bit precision is ~26 GB of weights, which fits on one 80 GB A100. Why spend two GPUs per replica?" Show the exact hardware breakdown rather than hand-waving:
    Layout               Weight RAM   Free HBM (pre-overhead)   Compute & HBM Bandwidth per Replica
    1 x A100-80GB        26 GB         54 GB (~48 GB usable)    1x FLOPs, ~2 TB/s bandwidth
    2 x A100-80GB (TP=2) 26 GB total  134 GB (~122 GB usable)   2x FLOPs, ~4 TB/s combined bandwidth
    
    In benchmarks, single-GPU replicas gave ~15% higher cluster-wide throughput, but two-GPU tensor parallelism cut long-prompt tail latency enough to meet our **p95 SLO** (95th-percentile service level objective, the response-time target 95% of requests must beat). Two GPUs halve compute time during **prefill** (processing thousands of input tokens in parallel), double memory bandwidth when reading weights during **decode** (generating output tokens one by one), and leave ~2.5x as much KV-cache headroom per replica (`134 GB` vs. `54 GB` before runtime overhead).
    
    • "Why pay CPU cost to tokenize inside the router instead of plain round-robin?" Prompt lengths varied 100x across teams. Replaying a full day of production logs showed token-aware routing cut p95 latency by ~33% by preventing three 8,000-token documents from piling onto one replica, while fast CPU tokenization added only ~2 milliseconds.
    • "What happens when a GPU replica crashes halfway through streaming a response?" Router health checks evict dead replicas within seconds; in-flight streams error out cleanly and clients retry with the same trace ID. Checkpointing mid-generation KV state across nodes would add constant network overhead to optimize for rare hardware faults.
    • "Why retry failed JSON outputs instead of using constrained decoding?" At build time, our serving version lacked constrained decoding (masking invalid vocabulary tokens at each generation step so outputs are guaranteed to match a JSON schema). Schema checks failed on only ~1% of calls, so a 1% GPU retry tax was cheaper than forking the engine; today I would enable constrained decoding natively.

Intuition & how it works

Think of this interview round like walking a chief plant engineer along a factory assembly line you claim to have built, station by station. Anyone can memorize an executive slide deck, so the interviewer deliberately stops at individual valves and conveyor belts—asking why a buffer holds 1,000 items instead of 10,000, or what backs up first if incoming trucks double—to verify you actually sized the machinery yourself.

The naive approach is to sketch vague boxes like Client -> Kubernetes -> GPU -> Database, defend every decision as flawless, and guess numbers on the fly when pressed. That collapses under questioning because omitting data formats and queue bounds hides how the system behaves under stress, and a single invented figure that violates basic GPU memory arithmetic undermines every other claim on your résumé.

Follow how a single 6,000-token extraction request moves cleanly across the numbered diagram in our sample walkthrough: 1. Edge protection ([1] Gateway): Authenticates the team, checks per-minute token quotas so runaway scripts fail before touching GPUs, and stamps trace_id = "req_42". 2. Work-proportional routing ([2] Router): Estimates 6,000 input tokens, checks admission control (rejecting early with HTTP 503 if estimated queue wait already exceeds the caller's timeout), and picks Replica B (10,000 queued tokens) over Replica A (48,000 queued tokens). 3. Hardware execution ([3] GPU Replicas): Inserts req_42 via continuous batching (adding new requests between token steps without waiting for an entire batch to finish) across two A100 GPUs using paged KV cache (storing attention history in small fixed-size memory blocks to avoid wasted gaps). 4. Safe delivery & billing ([4] & [5]): Streams tokens through PII redaction and JSON validation back to the caller while writing token usage asynchronously to Kafka so billing telemetry never slows user latency.

What interviewers look for

  • Concrete data-flow mechanics: numbered components showing exact inputs, outputs, network protocols, and hand-off queues rather than disconnected vendor logos.
  • Trade-off fluency on every box: naming the strongest rejected alternative, the benchmark that decided it, and the operational cost you accepted.
  • First-principles hardware literacy: comfort with GPU memory math (model weights vs. KV-cache capacity), compute-bound prefill vs. memory-bandwidth-bound decode, interconnect overhead, and cold-start weight-loading times.
  • Measured operational numbers: p95 latency, tokens per second per GPU, cache preemption rates, and average accelerator utilization tied to real load tests or telemetry.
  • Calm navigation under interruption: answering pointed challenges in three concise sentences and returning smoothly to the exact step number on the diagram.
  • Proactive honesty: flagging known shortcuts (such as schedule-based scaling) and clear "I" vs. "teammate" ownership boundaries before being cornered.

Common mistakes

  • Choosing prestige over familiarity: picking a massive training or serving cluster built mostly by senior teammates, then stalling on the second "Why?" inside the router.
  • Drawing a technology inventory: listing "Docker, Ray, Kafka, Prometheus" without showing what request payload enters each step or how backpressure propagates.
  • Getting defensive under pushback: treating an interviewer's counter-proposal as hostility rather than acknowledging where their alternative would win (for instance, single-GPU replicas winning on pure throughput when latency targets are loose).
  • Bluffing hardware numbers: guessing memory sizes or latencies that fail quick mental math (such as forgetting a 13B model in 16-bit precision occupies 13 × 2 = 26 GB of weights).
  • Losing the thread after an interruption: spending twelve minutes debating step [2] and running out of time before ever reaching GPUs, monitoring, or rollbacks.
  • Presenting an idealized redesign as history: blurring what actually ran in production with what you wish you had built.
  • Ignoring idle GPU cost: overlooking low overnight utilization when interviewing at an infrastructure company like Bitdeer where accelerator efficiency directly determines margins.

Follow-up questions

  • At 10x request or data volume, which stage in your pipeline saturates first, and what benchmark or telemetry backs up that prediction? Step [3]—specifically KV-cache memory on the GPU replicas—saturates long before CPU gateways or routers hit their ceiling. In our 3x stress test, vLLM began preempting active sequences (evicting half-finished requests from GPU memory and recomputing them later) once KV-cache blocks filled up, causing p95 latency to spike while stateless gateways and in-memory router queues easily handled 10x synthetic load against mock backends. Scaling 10x therefore requires adding GPU replicas roughly linearly while raising tokens served per GPU via prefix caching (reusing KV-cache blocks for shared system prompts across requests) and 8-bit KV-cache quantization (storing KV tensors in 8-bit instead of 16-bit to nearly double sequence capacity). Notably, quantizing only the 26 GB model weights to 8-bit frees just 13 GB across a 160 GB two-GPU replica—under 10% extra KV space—so shrinking the KV cache itself delivers far bigger headroom.
  • Looking back, which architectural choice would you undo in a clean-slate rebuild, and what ongoing operational tax have you paid for keeping it? I would replace our fixed day/night replica schedule with queue-driven autoscaling backed by fast local weight loading. Keeping static daytime capacity meant GPUs sat busy only about 45% of the time on average, effectively paying for idle silicon during troughs and overnight hours. Today I would cache model weights on local NVMe SSDs or host RAM to cut cold-start loading from four minutes to seconds, autoscale replicas on queued token depth, and backfill idle valleys with preemptible offline batch extraction jobs.
  • Where in your end-to-end pipeline do GPUs or specialized accelerators spend time underutilized, and how would you reclaim that wasted compute capacity? GPUs sit underutilized in four places: overnight traffic troughs, the four-minute weight-loading window during deploys or restarts, dedicated canary replicas waiting on 5% traffic, and low-concurrency intervals where small batch sizes leave GPU compute cores starved during token decode. To reclaim that capacity, I would combine fast-boot autoscaling, preemptible asynchronous batch queues that soak up spare cycles, and KV-cache compression so high-traffic batches pack more concurrent sequences per GPU. Crucially, I track achieved tokens per second per GPU alongside nvidia-smi utilization, because nvidia-smi only reports the percentage of time any GPU kernel was active—even a tiny one-request batch using 5% of memory bandwidth can read 99% "busy."
  • Walk through how an updated model artifact or service release is promoted safely into live traffic—and how quickly you revert when metrics degrade. Every candidate release is packaged in the model registry as an immutable bundle pinning weights, tokenizer files, vLLM flags, and container digest. Before touching live users, it must pass an automated offline gate checking extraction accuracy, latency benchmarks, and past regression prompts; next, the router shifts 5% canary traffic to the new replica pool for 24 hours while automated monitors compare error rates, p95 latency, JSON schema failures, and sampled output quality against the 95% baseline. If all guardrails hold, traffic ramps through 25%, 50%, and 100%. For instant rollback, we keep the previous version's GPU replicas warm for 24 hours after cutover so reverting a bad release is a sub-second router weight flip rather than a four-minute cold reload.

Follow-up questions

Similar questions

More Bitdeer interview questions

All 1 Bitdeer questions →