← Headway Interview Insights

Headway·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026Remote

Summary

System design round at Headway for a software engineer role. One question, pretty math-heavy, and I felt okay about my answer but not great.

Questions Asked (1)

Q1

Given a user count and per-user activity rate, estimate the server capacity needed: CPU, memory, disk IOPS, and network bandwidth. Walk through the math explicitly and state your assumptions.

System DesignTechnical Trade-offs
Author's notes

I started from DAU and worked toward QPS, which felt natural, but then I got a bit tangled trying to map per-request costs to actual instance types.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating your assumptions about the workload (e.g., requests per user per day, peak-to-average ratio, payload sizes). Then break down each resource (CPU, memory, disk IOPS, network) with explicit formulas, using consistent units and rounding to order-of-magnitude. Finally, sanity-check the numbers against known benchmarks and mention the need for headroom and redundancy.

Pro tip: Always separate steady-state from peak load and apply a safety factor (e.g., 2x) to account for spikes and failures. Also, mention that real-world capacity planning is iterative and should be validated with load testing.

1. Define assumptions and workload characteristics

State user count, activity rate (e.g., requests per user per day), average request size, and peak-to-average ratio. Clarify whether the workload is read-heavy or write-heavy.

2. Calculate request rate and concurrency

Convert daily activity to requests per second (RPS) and estimate concurrent requests using Little's Law (concurrency = RPS × average latency).

3. Estimate CPU and memory per request

Use benchmarks or typical values (e.g., CPU time per request, memory per active connection) to compute total CPU cores and memory needed, then apply headroom.

4. Estimate disk IOPS and network bandwidth

Based on data read/written per request and payload sizes, calculate IOPS and bandwidth. Consider caching to reduce disk load.

5. Sum up and sanity-check

Aggregate resources, add redundancy (e.g., N+1), and compare with known instance types. Mention that these are rough estimates to be refined with monitoring and load testing.

Key Points to Mention

  • Assumptions: user count, activity rate, peak factor, request size, read/write ratio
  • Little's Law for concurrency estimation
  • CPU: requests per second × CPU time per request, then convert to cores
  • Memory: per-connection memory × concurrent connections + application overhead
  • Disk IOPS: read/write operations per second based on data access patterns
  • Network bandwidth: average request/response size × RPS, converted to Mbps/Gbps
  • Headroom and redundancy: apply safety factor (e.g., 2x) and N+1 for high availability

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.