How to pass the Microsoft OneDrive system design interview

Interviewing for an SDE-2 or Senior Software Engineer role at Microsoft means you'll inevitably face a grueling system design round. Designing a distributed file synchronization service like OneDrive is one of the most notorious questions in their bank. It's not just a basic test to see if you know what a load balancer is or how to draw boxes on a whiteboard. Microsoft interviewers are looking for engineers who can navigate the gritty details of network I/O optimization, delta compression, and eventual consistency. They need to know you can design a system capable of handling offline edits without silently corrupting user data.
The Anatomy of the Microsoft SDE-2 System Design Loop
System design interviews at Microsoft are highly collaborative. While interviewers at some companies act as silent observers, Microsoft engineers will actively debate trade-offs with you. For an SDE-2 role, the expectation shifts from just building a working system to building an optimal one. You'll need to proactively identify bottlenecks before the interviewer points them out. Bandwidth is the obvious bottleneck when designing a file sync system. If a user changes one sentence in a 100MB presentation, uploading the entire file again is a massive failure in system design. You have to demonstrate a deep understanding of how to minimize network payloads while maintaining strict data integrity.
Scoping the Constraints of a File Sync Service
You need to lock down the constraints before drawing any architecture. Candidates often make the mistake of rushing into the design without defining the scale. For a OneDrive-like system, assume 100 million daily active users, each storing hundreds of files. That scale quickly leads to petabytes of data and millions of concurrent synchronization requests. Make sure you clarify both functional and non-functional requirements with your interviewer right out of the gate.
High-Level Architecture: Decoupling Metadata from Block Storage
Decoupling the file metadata from the actual file content is the most critical architectural decision you'll make in this interview. Storing a 50MB file directly in a relational database is an anti-pattern that will instantly derail your chances. Instead, split the system into two distinct planes. You need a metadata service to handle folder structures, permissions, and file versions, alongside a separate block storage service for the raw binary data.
| Component | Storage Technology | Consistency Model | Primary Challenge |
|---|---|---|---|
| Metadata Service | Relational (Azure SQL) or NoSQL (Cosmos DB) | Strong Consistency | High read/write concurrency and ACID transactions for file trees |
| Block Storage | Object Store (Azure Blob Storage) | Eventual Consistency | Maximizing throughput and managing petabytes of raw chunks |
| Notification Service | WebSockets / Server-Sent Events | Ephemeral / Transient | Managing millions of long-lived open connections efficiently |
Under this architecture, a client uploading a file first talks to the Metadata Service to grab an upload token and a list of required chunks. The client then pushes those raw binary chunks directly to the Block Storage. Once that upload finishes, the client notifies the Metadata Service. The service updates the file tree and triggers a WebSocket notification to all other online devices owned by that user, prompting them to pull the new changes.

Deep Dive: Optimizing Network I/O with Content-Defined Chunking
This specific challenge is where SDE-2 candidates separate themselves from the pack. Uploading an entire file every time a user modifies it is wildly inefficient. The naive approach relies on fixed-size chunking—splitting a 10MB file into ten 1MB chunks. If a user appends data at the end of the file, only the last chunk changes. That works fine. But if a user inserts a single byte at the very beginning of the file, all subsequent chunk boundaries shift. The hashes for all ten chunks change instantly, forcing a full 10MB re-upload. You have to introduce Content-Defined Chunking (CDC) to solve this.
Content-Defined Chunking relies on a rolling hash algorithm, typically Rabin Fingerprinting, to determine chunk boundaries based on the actual file content rather than fixed byte offsets. The algorithm slides a window across the file data, computing a hash at every single byte. If that hash satisfies a specific condition—like the lowest K bits being zero—that exact byte is marked as a chunk boundary. Thanks to this logic, a single byte insertion only alters the specific chunk where the edit occurred. The boundaries of all subsequent chunks remain identical, which preserves their hashes and avoids unnecessary network uploads. The client computes these hashes locally and sends the list to the server. The server then responds with the specific chunks it's missing. That back-and-forth is the true essence of delta synchronization.
Solving the Conflict Resolution Matrix for Offline Edits
File sync services are distributed systems where clients might stay offline for days at a time. What happens when a user edits a file on their offline laptop while a colleague edits the exact same file on the web interface? Reconnecting that laptop creates a classic split-brain scenario. Interviewers absolutely love this topic because it forces you to make hard choices between data availability and consistency.
You could technically use Vector Clocks to track causality and detect conflicts mathematically. But in a consumer file sync system like OneDrive or Dropbox, forcing users to manually resolve merge conflicts—similar to a Git rebase—creates a terrible user experience. The industry standard relies on a Last-Write-Wins (LWW) approach combined with file forking. The server maintains a strict version history based on its own monotonic clock. When an offline client reconnects and tries to push a chunk list based on an outdated file version, the server rejects the standard upload. The system then instructs the client to upload its version as a brand-new, distinct file. You'll usually see this appended with the machine name, like 'Document (Johns-MacBook conflicted copy).docx'. This clever workaround guarantees zero data loss while keeping the server logic lock-free and highly available.
Scaling the Metadata Layer and Sharding for Azure-Scale Tenancy
A single metadata database instantly becomes a bottleneck as your system scales to millions of users. Partitioning the data is non-negotiable. The most logical shard key for a personal file sync service is the UserID. Users predominantly sync and edit their own files across their own personal devices. Querying by UserID keeps all those transactions neatly contained within a single database shard, which maintains ACID properties without relying on expensive distributed transactions.
You still need to explain exactly how you'll handle shared folders. If Alice shares a highly active folder with Bob, and the system is strictly sharded by UserID, how does Bob's client efficiently fetch updates? A common architectural pattern treats shared folders as their own isolated entities with unique IDs, allowing you to shard based on the FolderID or WorkspaceID. Another viable option is maintaining a secondary index or a mapping table that routes requests for shared files directly to the owner's shard. Breaking down the trade-offs between these approaches—especially weighing the cost of cross-shard joins against the complexity of routing logic—will score you massive points with the hiring committee.
How to Stand Out in Microsoft's Collaborative Format
Passing the Microsoft SDE-2 system design loop takes more than just reciting the architecture of OneDrive from memory. It's really about how effectively you communicate your technical decisions. When you propose Content-Defined Chunking, take a moment to explain the CPU cost on the client side. If you bring up WebSockets for notifications, make sure you acknowledge the memory overhead of maintaining millions of idle TCP connections on your load balancers. You should also propose a fallback to long-polling for users trapped behind restrictive corporate firewalls.
Drive the conversation by constantly mapping your technical choices back to the constraints you defined in the first five minutes of the interview. Articulate the math behind your chunking strategy with confidence. Cleanly separate your metadata from your block storage, and show exactly how you handle offline conflicts without losing a single byte of user data. Do all of that, and you won't just pass the interview—you'll set the bar for the entire SDE-2 loop.
Frequently asked questions
What is the best way to handle file chunking in a system design interview?
Fixed-size chunking is perfectly acceptable for basic systems. But for a high-tier SDE-2 interview, you should always recommend Content-Defined Chunking (CDC) using a rolling hash like Rabin Fingerprinting. This approach allows the system to seamlessly handle byte-level insertions and deletions without forcing the user to re-upload the entire file.
Should I use a relational database or NoSQL for the metadata service?
Both options can work in this scenario. However, Relational Databases like Azure SQL or PostgreSQL are often preferred for file systems because they natively support ACID transactions. Those transactions are crucial for maintaining the integrity of complex folder hierarchies and user permissions. If you decide to pitch NoSQL, be prepared to explain exactly how you plan to handle transactional consistency.
How do you handle millions of concurrent client connections?
Set up a dedicated Notification Service cluster to manage those WebSocket connections. You can handle the massive scale by keeping the WebSocket servers stateless and backing them with a pub/sub message broker like Redis or Kafka. Whenever a file changes, the metadata service publishes an event. The specific WebSocket server holding that user's connection then pushes the notification directly to their device.
How does the system ensure data isn't lost during concurrent offline edits?
The system relies on strict versioning and optimistic concurrency control. If a client attempts to upload changes based on an outdated version of the file, the server immediately detects the version mismatch. Instead of silently overwriting the data, the server accepts the new upload as a 'conflicted copy'. This cleanly preserves both users' work without any data loss.
What happens if the WebSocket connection drops during a sync?
The client needs to implement exponential backoff to gracefully reconnect. Once the connection is re-established, the client makes a standard HTTP GET request to the Metadata Service to fetch any missed events or file versions. This simple fallback ensures eventual consistency across the system, even if real-time notifications temporarily fail.
Related comparisons
See AcePrompt in action
Watch how AcePrompt supports a real technical round - structured answers, tuned to your resume, in real time.
Ace your next system design interview with real-time AI guidance.
Get started