Microsoft system design interview: how to prepare
What Microsoft publishes about its interviews, the five Well-Architected pillars as a trade-off checklist, the Azure patterns worth naming, a worked file-sync design with senior follow-ups, and a tested C# circuit breaker.
GuideCoreMicrosoft guide15 min readUpdated
- 3 architecture diagrams
- 1 sequence flow
- 2 data models
- 2 code samples
- 7 interviewer follow-ups
- 3 self-checks
On this page12 sectionsHLDLLDSenior depth
Read first: How big-tech interviews work, round by round
- Separate what Microsoft publishes about its interviews from what candidates report, and plan around both.
- Use the five Well-Architected pillars as the checklist for the trade-off part of your answer.
- Name the Azure design patterns that match the concepts you already know, concept first and product second.
- Walk through a complete design (a file sync service) and answer the senior follow-ups it invites.
2 code samples (79 lines), collapsed so the explanation stays in focus.
Microsoft's careers site has pages on interview tips and on technical interviewing, and Microsoft's own blogs add advice from recruiters and engineers. Some of those pages are several years old, so treat them as the shape of the interview, not a rulebook. The parts that matter for a design round:
| Microsoft publishes | What to do with it |
|---|---|
| The technical interview is short, about 45 minutes | Practise a design that fits a timebox. Use the plan below. |
| For system design, know distributed systems, service-oriented and n-tiered architecture, and topics such as resiliency, high availability, auto-scaling, replication, CAP theory and partitioning | That is your syllabus. The next section maps each topic to a lesson here. |
| Ask clarifying questions and make a plan before you implement | The first ten minutes of the framework. |
| Talk through your thinking so the interviewer can follow and help | Narrate trade-offs: "I choose X because Y, and it costs Z." |
| Check your own work, call out corner cases and test | In design, that means failure modes and what breaks at ten times the load. |
| Use the STAR method for behavioural questions and show that you learn from feedback | Build the story bank. |
Microsoft describes an initial interview and, for candidates who are selected, a final round, with the format depending on the role.
| Microsoft lists | Where to learn it here |
|---|---|
| Distributed systems, and how to approach the question | A framework for system design interviews |
| Resiliency and high availability | Load balancing and consistency and availability |
| Auto-scaling | Load balancing and queues and async work |
| Replication and partitioning | Replication and sharding |
| CAP theory | Consistency and availability |
| Service-oriented and n-tiered architecture | The Prime Video microservices-to-monolith breakdown shows the trade-off in a real case |
| A full design, end to end | Case study: a URL shortener and the worked design below |
The Azure Well-Architected Framework is organised around five pillars: reliability, security, cost optimization, operational excellence and performance efficiency. Microsoft's own point is that design decisions must be balanced across them, which is exactly what a trade-off discussion is. Use them in the last five minutes: walk your design through each lens and say which one you traded away.
| Pillar | The question to put to your own design |
|---|---|
| Reliability | What happens when each component fails, and when a whole region does? What recovery time and data loss are acceptable? |
| Security | Who can call this? Which data is sensitive, and how is it protected at rest and in transit? How is abuse handled? |
| Cost optimization | Which bill grows with traffic or data? What can be cached, tiered to cheaper storage, or expired? |
| Operational excellence | How do you deploy safely, watch the system, and learn it is broken before users tell you? |
| Performance efficiency | Where is the latency budget spent? What is the first bottleneck at ten times the load? |
The Azure Architecture Center keeps a catalog of cloud design patterns. Name a pattern when it clarifies your answer, and always state the idea first.
| Pattern in the Azure catalog | What it does | The concept on this site |
|---|---|---|
| Cache-Aside | Loads data into a cache from the data store on demand | Caching |
| Retry | Retries a call that failed for a transient reason, with a delay between attempts | The circuit breaker below |
| Circuit Breaker | Stops calling a failing dependency so it can recover and callers fail fast | The circuit breaker below |
| Queue-Based Load Leveling | Puts a queue between a producer and a service to smooth bursts | Queues and async work |
| Competing Consumers | Lets several workers take messages from one queue | Queues and async work |
| Sharding | Splits a data store into horizontal partitions | Replication and sharding |
| Throttling | Controls how much of a resource an application, tenant or service may use | Rate limiting |
| CQRS | Separates the read model from the write model | Consistency and availability, because the read side lags |
The catalog itself suggests pairing Retry with Circuit Breaker, and Queue-Based Load Leveling with Competing Consumers. If you can say why, you understand the patterns rather than the names.
Microsoft's technical guide describes a short interview, so rehearse with a clock. This split leaves room for questions and keeps the trade-off discussion from being squeezed out.
This is a practice prompt in the Microsoft product space, written by us. It is not a real interview question, and it does not describe how OneDrive or any other product works. It is a standard design for the problem.
Clarify. Users keep files in a folder that syncs across their devices. They can work offline, see version history and share links. The system must never lose a file, must send only what changed, and should bring online devices up to date within seconds.
Estimate (assumptions, to show the reasoning). Take 50 million users who each store 2 GB across 2,000 files. That is about 100 PB of file data, 100 billion file records, and about 50 TB of metadata at roughly 500 bytes a record. With 4 MB chunks that is up to 25 billion chunks before deduplication. Two conclusions follow: storage cost dominates, so deduplication and cheaper tiers matter, and the metadata is far too large for one database, so it must be sharded.
The decisions that carry the design:
- Chunk and hash. Split each file into chunks, hash each one, and store chunks under their hash. A changed file uploads only its new chunks, and identical chunks are stored once. Chunk uploads are safe to retry because the same bytes always have the same name.
- Commit last. The client uploads missing chunks first, then asks the metadata service to commit a new version: an ordered list of chunk hashes plus the version it was based on. The commit is one transaction on one shard.
- Metadata is sharded by user (or by shared folder), so a user's whole file tree commits on one shard without a cross-shard transaction.
- Notify, then pull. The notification carries no file data, only "this folder changed, cursor N". Each device then asks for changes since its own cursor. A lost notification is harmless, because devices also check periodically.
file_idbigint
PKnamespacebigint
SHARD KEYINDEXparent_idbigint
INDEXnametext
versionint
chunkstext
ordered list of chunk hashes for the current version
deletedbool
hashbytes
SHA-256 of the chunk
PKsizeint
refsint
how many versions point at it
Chunks are immutable. A chunk is deleted only after refs reaches zero and a grace period passes.
Retry handles a brief blip. A circuit breaker handles a dependency that is really down: after enough failures it stops sending calls, so callers fail fast and the dependency gets room to recover. It has three states.
| State | Calls | Moves to |
|---|---|---|
| Closed | Allowed | Open, after the failure threshold is reached |
| Open | Rejected at once | Half-open, after the cool-down |
| Half-open | One probe call allowed | Closed if it succeeds, Open if it fails |
The clock is passed in, so the behaviour can be tested without waiting. This version is for one thread, to show the logic; for concurrent use, guard the state with a lock.
C# · BreakerState, CircuitBreaker
using System;
using System.Diagnostics;
public enum BreakerState { Closed, Open, HalfOpen }
public sealed class CircuitBreaker
{
private readonly int _failureThreshold;
private readonly TimeSpan _coolDown;
private readonly Func<DateTime> _now;
private int _failures;
private DateTime _openedAt;
public CircuitBreaker(int failureThreshold, TimeSpan coolDown, Func<DateTime> now)
{
_failureThreshold = failureThreshold;
_coolDown = coolDown;
_now = now;
State = BreakerState.Closed;
}
public BreakerState State { get; private set; }
/// <summary>True if the caller may make the call. After the cool-down, exactly one probe is let through.</summary>
public bool TryAcquire()
{
if (State == BreakerState.Closed) return true;
if (State == BreakerState.Open && _now() - _openedAt >= _coolDown)
{
State = BreakerState.HalfOpen;
return true;
}
return false;
}
public void RecordSuccess()
{
_failures = 0;
State = BreakerState.Closed;
}
public void RecordFailure()
{
_failures++;
if (State == BreakerState.HalfOpen || _failures >= _failureThreshold)
{
State = BreakerState.Open;
_openedAt = _now();
_failures = 0;
}
}
}A test with a fake clock walks it through every state:
C#
using System;
using System.Diagnostics;
var clock = new DateTime(2026, 1, 1, 0, 0, 0, DateTimeKind.Utc);
var breaker = new CircuitBreaker(3, TimeSpan.FromSeconds(30), () => clock);
bool firstCall = breaker.TryAcquire();
breaker.RecordFailure();
breaker.RecordFailure();
Debug.Assert(firstCall && breaker.State == BreakerState.Closed); // two failures: still closed
breaker.RecordFailure(); // the third trips it
bool whileOpen = breaker.TryAcquire();
Debug.Assert(breaker.State == BreakerState.Open && !whileOpen);
clock = clock.AddSeconds(31); // the cool-down passes
bool probe = breaker.TryAcquire();
bool second = breaker.TryAcquire();
Debug.Assert(probe && !second && breaker.State == BreakerState.HalfOpen); // one probe only
breaker.RecordFailure(); // the probe failed: open again
Debug.Assert(breaker.State == BreakerState.Open);
clock = clock.AddSeconds(31);
bool secondProbe = breaker.TryAcquire();
breaker.RecordSuccess(); // the probe succeeded: closed
Debug.Assert(secondProbe && breaker.State == BreakerState.Closed);In production you would not write this yourself. .NET 8 ships resilience packages built on Polly: Microsoft.Extensions.Http.Resilience adds a standard pipeline to an HttpClient with AddStandardResilienceHandler(), which combines rate limiting, timeouts, retry and a circuit breaker. Know the mechanism so you can explain what that one line does.
Interviewer follow-upL5Two devices edit the same file while offline. What happens when both reconnect?How to answer
Every commit carries the version it was based on. The first device to commit wins. The second commit is rejected because its base is stale, so that device keeps its edit and uploads it as a separate "conflicted copy" next to the original, and the user resolves it. Silently letting the last writer win is the answer to avoid, because it loses someone's work. Structured documents that people edit together need merging (operational transformation or CRDTs), which is a different problem from file sync.
Interviewer follow-upL6How do you avoid re-uploading a 1 GB file when only 1 KB changed?How to answer
Chunk and hash, then upload only chunks the server lacks. With fixed-size chunks, inserting a byte near the start shifts every later boundary, so every chunk changes. Content-defined chunking fixes that: boundaries come from a rolling hash of the content, so an insert changes only the chunks around it. The cost is more client CPU, variable chunk sizes and more metadata per file.
Interviewer follow-upL6How do you make it impossible for metadata to point at a chunk that does not exist?How to answer
Order the operations. Chunks are uploaded first and the metadata commit comes after, and the commit checks that every referenced chunk exists. A crash between the two leaves orphaned chunks, which are harmless. Garbage collection removes a chunk only when nothing references it and after a grace period, so it never races with an upload in flight.
Interviewer follow-upL7You deduplicate across users. What is the privacy risk, and how do you handle it?How to answer
If the server answers "I already have this chunk" for a hash the client sends, an attacker can test whether someone else stored a particular file. Options are to deduplicate only within one account or tenant (costs some storage), or to require proof of ownership before skipping the upload, where the server challenges the client to show it holds the data. Say which you picked and what it costs.
Interviewer follow-upL7A folder is shared with 50,000 people and one file changes. How does notification cope?How to answer
Fan-out per user means 50,000 messages for one change. Publish one event per shared namespace instead, and let the notification tier deliver it to the connections subscribed to that namespace. Devices pull changes with their cursor, and bursts of edits are coalesced so a device is told at most once every few seconds. The shared folder is a hot key, so spread its subscribers across several gateway nodes.
Interviewer follow-upL5How do you roll out a change to this service safely?How to answer
Release in stages: a small share of traffic or one region first, watch error rate and latency against the baseline, and roll back automatically if they degrade. Feature flags separate deploying code from turning it on. This is the operational-excellence pillar in practice: safe deployment and the monitoring to know it worked.
Interviewer follow-upL6A whole region fails. What do clients see?How to answer
It depends on replication. Metadata is replicated across zones inside a region synchronously and to another region asynchronously, so a regional failover can lose the last few commits. Clients detect that their cursor is ahead of the server and re-list changes. Chunks in geo-redundant blob storage are unaffected. State the recovery time and the possible data loss out loud, then say what you would pay to shrink them.
| Week | Focus | Where |
|---|---|---|
| 1 | The framework, estimation, load balancing and caching | The first three system design lessons |
| 2 | Replication, sharding, queues and consistency | Lessons 4 to 6 |
| 3 | Two full designs from a blank page, ending each with the five-pillar wrap-up | The URL shortener, then the file sync design above |
| 4 | Timed mock designs with a partner, plus your behavioural stories | Mock interviews |
- Microsoft Careers, Technical interviewing (opens in a new tab) and Interview tips (opens in a new tab). Some pages are several years old.
- Microsoft Life, How to ace a technical interview at Microsoft (opens in a new tab).
- Microsoft Learn, Azure Well-Architected Framework (opens in a new tab) (the five pillars).
- Microsoft Learn, Cloud design patterns, Azure Architecture Center (opens in a new tab).
- Microsoft Learn, Build resilient HTTP apps: key development patterns (opens in a new tab) and the .NET Blog, Building resilient cloud services with .NET 8 (opens in a new tab).
- Halevi, Harnik, Pinkas and Shulman-Peleg, "Proofs of ownership in remote storage systems" (ACM CCS 2011): the deduplication privacy risk and one defence.
QuestionWhich parts of this guide are published by Microsoft and which are reported by candidates?Reveal answer
Published: the short technical interview, the system design topics it lists (distributed systems, resiliency, availability, replication, CAP, partitioning), the advice to clarify, plan, think aloud and test, and the five Well-Architected pillars. Reported: the exact number of rounds and how much weight design carries at each level. Confirm the reported part with your recruiter.
QuestionWhy does the file sync design upload chunks before it commits the metadata?Reveal answer
So metadata can never point at a missing chunk. If the client crashes between the two steps, the result is an orphaned chunk, which is harmless and later garbage-collected. Committing first would leave a file that cannot be downloaded.
QuestionIn a circuit breaker, why is only one probe allowed in the half-open state?Reveal answer
The dependency may still be broken. One probe tests it cheaply, while letting every waiting caller through would hit a struggling service with a flood. A successful probe closes the breaker and a failed one opens it again.