← Meta Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

Meta system design round for a software engineering role. Four-level cloud storage problem that kept escalating just when I thought I was done. Left feeling like I maybe got through 70% of it cleanly.

Questions Asked (4)

Q1

Design an in-memory cloud storage service with APIs to add, retrieve, and delete files by ID. Files should store at least a name, size, and arbitrary metadata. What are your return values and how do you handle errors?

System DesignAPI & IntegrationsData Modeling
Author's notes

Started with a HashMap keyed on file ID, felt pretty solid.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (e.g., expected scale, concurrency, persistence) before diving into the design. Then define the data model and API contracts, focusing on return values and error handling. Finally, discuss trade-offs and potential improvements like sharding or caching.

Pro tip: Explicitly state your assumptions about scale and concurrency, and mention that you'd use a thread-safe data structure like ConcurrentHashMap to handle concurrent requests. This shows you think about real-world production concerns.

1. Clarify Requirements

Ask questions to understand the scope: expected number of files, size limits, concurrency needs, and whether persistence is required. This ensures your design meets the actual needs.

2. Define Data Model

Specify the File object with fields: id (unique), name, size, metadata (map), and possibly content. Decide on ID generation strategy (e.g., UUID).

3. Design API Contracts

Define methods: addFile(file) -> returns file ID or full file; getFile(id) -> returns file or null; deleteFile(id) -> returns boolean or void. Specify return types and error conditions.

4. Handle Errors and Edge Cases

Decide on error handling: throw exceptions (e.g., FileNotFoundException) or return error objects. Consider duplicate IDs, missing files, invalid input, and concurrency issues.

5. Discuss Trade-offs and Scalability

Mention limitations of in-memory storage (e.g., data loss on restart, memory constraints) and how you might extend it (e.g., persistence, sharding, caching).

Key Points to Mention

  • Use a thread-safe data structure like ConcurrentHashMap for concurrent access.
  • Define clear return values: e.g., addFile returns the generated ID, getFile returns the File object or null, deleteFile returns boolean indicating success.
  • Error handling: throw exceptions for invalid input or missing files, or return error codes/objects for a more functional style.
  • Consider ID generation strategy: UUID vs. auto-incrementing counter.
  • Metadata should be a flexible map (e.g., Map<String, String>) to store arbitrary key-value pairs.
  • Discuss scalability: in-memory limits, potential for sharding, and persistence options.

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

Q2

Extend the storage service to support querying the k largest files globally and per user. How do you break ties when files have equal sizes?

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This is where I started second-guessing my data structures.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale, update frequency, and whether ties should be broken deterministically. Then propose a solution using a min-heap of size k for global queries and per-user heaps or a composite key approach, explicitly defining tie-breaking rules (e.g., by file ID or timestamp) to ensure consistency.

Pro tip: Mention that tie-breaking should be deterministic and documented, and consider using a composite key (size, file ID) to avoid ambiguity. Also, discuss how to handle updates efficiently, such as lazy deletion or maintaining heaps incrementally.

1. Clarify Requirements

Ask about scale (number of files, users), query frequency, and whether results must be deterministic. Confirm if ties should be broken by a secondary attribute like file ID or creation time.

2. Choose Data Structures

For global top-k, use a min-heap of size k. For per-user top-k, maintain a separate min-heap per user or use a composite key (userID, size) in a global heap. Consider memory and update costs.

3. Define Tie-Breaking

Specify a deterministic tie-breaker, such as smaller file ID first, or lexicographic order. Ensure the same rule applies to both global and per-user queries for consistency.

4. Handle Updates

Discuss how to handle file insertions, deletions, and size changes. Options include lazy deletion (mark as deleted and skip during queries) or maintaining heaps with decrease-key/increase-key operations.

5. Analyze Trade-offs

Compare time and space complexity: heap approach O(n log k) for building, O(log k) per update. Discuss alternatives like sorting or quickselect for batch queries, and distributed solutions for scale.

Key Points to Mention

  • Min-heap of size k for efficient top-k queries
  • Per-user heaps or composite key (userID, size) for per-user queries
  • Deterministic tie-breaking (e.g., by file ID or timestamp)
  • Lazy deletion for handling updates efficiently
  • Time complexity: O(n log k) for building, O(log k) per update
  • Scalability considerations: sharding, distributed heaps, or approximate algorithms

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

Q3

Add per-user storage quotas that are enforced when files are added. Also implement merging two users' accounts, including how you resolve conflicts when both users have files with the same identifier or name.

System DesignTechnical Trade-offsData Modeling
Author's notes

Quota enforcement was fine, just track used bytes per user and reject adds that exceed the cap.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a quota system that enforces limits atomically at the point of file addition, considering both hard and soft limits. For account merging, define a clear conflict resolution policy (e.g., keep both, rename, or deduplicate) and implement it transactionally to avoid data loss.

Pro tip: Always discuss idempotency and failure handling—e.g., what happens if a quota check passes but the write fails, or if a merge is interrupted. This shows you think about production reliability, not just happy paths.

1. Clarify Requirements and Constraints

Ask about scale (users, files, storage per user), quota types (hard vs soft), and merge semantics (e.g., should files be combined, or should one account be primary?). Confirm whether identifiers are globally unique or per-user.

2. Design Quota Enforcement

Propose a quota service that tracks usage per user and checks limits before accepting a file. Ensure atomicity via transactions or optimistic concurrency to prevent race conditions.

3. Design Account Merging

Outline a merge process: validate both accounts, combine files, and resolve conflicts based on a defined policy. Consider using a merge token or two-phase commit to handle failures.

4. Define Conflict Resolution Strategy

For duplicate identifiers or names, choose a policy: keep both with renamed identifiers, keep the newer/older version, or prompt the user. Explain trade-offs (e.g., data loss vs. storage bloat).

5. Address Edge Cases and Scalability

Discuss handling large merges, quota recalculation after merge, and potential performance bottlenecks. Mention monitoring and rollback plans.

Key Points to Mention

  • Atomic quota enforcement using transactions or compare-and-swap to avoid overages.
  • Conflict resolution policies: rename, deduplicate, or version files; consider user experience.
  • Idempotent merge operations to handle retries and partial failures.
  • Quota recalculation after merge: sum usage and enforce new limits.
  • Scalability: sharding by user ID, caching quota counters, and asynchronous processing for large merges.
  • Data integrity: backups, audit logs, and rollback mechanisms for merges.

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

Q4

Add support for backing up and restoring a user's files. Define your snapshot semantics (point-in-time vs rolling), how much storage overhead that creates, and what happens when a restore conflicts with files added after the snapshot.

System DesignTechnical Trade-offsAdaptability & Ambiguity
Author's notes

Running low on time here and it showed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what types of files, backup frequency, and restore expectations. Then define snapshot semantics (point-in-time vs rolling) and justify your choice based on trade-offs in storage overhead and consistency. Finally, address conflict resolution for restores, proposing a clear policy (e.g., versioning, rename, or merge) and explaining how it handles files added after the snapshot.

Pro tip: Demonstrate awareness of real-world constraints by discussing incremental backups and deduplication to reduce storage overhead, and propose a conflict resolution strategy that minimizes data loss while being user-friendly.

1. Clarify Requirements and Assumptions

Ask questions to understand the scope: file types, backup frequency, retention policy, and whether backups are local or cloud-based. State your assumptions explicitly.

2. Define Snapshot Semantics

Choose between point-in-time (full copy at a moment) and rolling (continuous or periodic incremental). Explain the trade-offs in consistency, complexity, and storage overhead.

3. Quantify Storage Overhead

Estimate storage overhead based on snapshot frequency, file change rate, and deduplication/compression. Discuss how to optimize (e.g., incremental backups, block-level dedup).

4. Design Restore and Conflict Resolution

Define what happens when restoring a snapshot conflicts with files added/modified after the snapshot. Propose policies: overwrite, skip, rename, merge, or versioned restore.

5. Discuss Trade-offs and Edge Cases

Summarize trade-offs (storage vs consistency, simplicity vs flexibility) and address edge cases like concurrent modifications, partial failures, and user experience.

Key Points to Mention

  • Point-in-time snapshots provide consistency but higher storage overhead; rolling/incremental snapshots reduce overhead but complicate restore.
  • Storage overhead can be mitigated with deduplication, compression, and incremental backups (only changed blocks).
  • Conflict resolution strategies: last-write-wins, rename conflicting files, merge changes, or present user with options.
  • Versioning and metadata (timestamps, checksums) are crucial for tracking changes and enabling efficient restores.
  • Consider scalability: how does the design handle millions of users and petabytes of data?
  • User experience: restore should be intuitive, with clear options and minimal data loss.

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