← Meta Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

System design round at Meta for a software engineer role. The whole session was one big deep-dive into a customer merge operation for a payments platform, and they really did expect you to go nine levels deep on it.

Questions Asked (10)

Q1

Design a mergeCustomers(oldId, newId) operation for a payments and ledger platform. The merge absorbs the old identity into the new one while keeping every account's balance and full transaction history intact, with accounts staying attached to their own IDs rather than being merged together.

System DesignData ModelingTechnical Trade-offs
Author's notes

This was the whole interview, basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints: what 'merge' means for identity, accounts, and transactions; whether accounts should be re-parented or kept separate; and how to handle idempotency and concurrency. Then propose a data model that separates customer identity from accounts and transactions, and design the merge as an atomic operation that updates a customer alias mapping and re-points references without altering balances or transaction records. Finally, discuss trade-offs around consistency, performance, and rollback.

Pro tip: Emphasize that the merge should be idempotent and reversible (via an audit log or soft merge) to handle retries and potential errors, and mention that you would use a distributed transaction or saga pattern to ensure atomicity across services.

1. Clarify requirements and constraints

Ask questions to understand what 'merge' entails: should the old customer ID be retired or aliased? Should accounts be re-assigned to the new customer or remain linked to their original IDs? What are the SLAs for consistency and availability? Are there regulatory requirements for audit trails?

2. Design the data model

Propose a schema where customers, accounts, and transactions are separate entities. Accounts reference a customer ID, and transactions reference an account ID. Consider adding a customer alias table or a merged_into field to track identity merges without altering existing references.

3. Define the merge operation

Outline the steps: validate both customers exist and are not already merged; create an alias from oldId to newId; update any customer-level metadata (e.g., preferences) to the new customer; ensure accounts remain attached to their original IDs but are now accessible via the new customer identity. Use a transaction or saga to guarantee atomicity.

4. Address consistency and concurrency

Discuss how to handle concurrent merges or operations on the same customers. Use optimistic locking or distributed locks. Ensure idempotency by checking if the merge already occurred. Plan for rollback by keeping an audit log or soft-deleting the alias.

5. Evaluate trade-offs and scalability

Compare hard merge (updating all references) vs. soft merge (alias table). Discuss performance impact on reads (e.g., resolving aliases) and writes. Consider sharding by customer ID and how merges across shards would work. Mention monitoring and alerting for merge failures.

Key Points to Mention

  • Idempotency: ensure the merge can be safely retried without duplicating effects.
  • Atomicity: use transactions or saga patterns to keep customer, account, and transaction data consistent.
  • Audit trail: log all merge operations for compliance and rollback.
  • Alias mapping: maintain a mapping from oldId to newId to avoid updating all references.
  • Account independence: accounts stay linked to their original IDs; only customer identity is merged.
  • Concurrency control: handle simultaneous merges or operations with locks or versioning.

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

Q2

How do you unify two customer identities so that both the old and new IDs resolve to the same canonical identity for all reads and future writes, starting from the moment the merge commits?

System DesignTechnical Trade-offs
Author's notes

I went with an alias/redirect table pretty quickly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: the merge must be atomic, both IDs must resolve to the same canonical identity for all reads and future writes, and the system must handle high scale and consistency. Then propose a design that uses an identity mapping service with a canonical ID, a write path that redirects writes to the canonical ID, and a read path that resolves any ID to the canonical one, ensuring atomicity via a transaction or a two-phase commit.

Pro tip: Emphasize idempotency and backward compatibility: the merge operation should be idempotent so retries are safe, and old IDs must continue to work indefinitely to avoid breaking existing clients or data references.

1. Clarify requirements and constraints

Ask about scale (QPS, data size), consistency requirements (strong vs eventual), latency SLAs, and whether the merge can be asynchronous. Confirm that both IDs must resolve to the same canonical identity for all reads and writes immediately after commit.

2. Design the identity mapping and canonical ID

Introduce a canonical ID (e.g., the surviving ID or a new UUID) and maintain a mapping from any ID to the canonical ID. Store this mapping in a highly available, low-latency store (e.g., a distributed KV store) with strong consistency for writes.

3. Implement atomic merge and write redirection

Use a transaction or a consensus protocol (e.g., Paxos/Raft) to atomically update the mapping and redirect future writes. Ensure that after commit, any write to either ID is redirected to the canonical ID, and the operation is idempotent.

4. Handle reads and caching

For reads, resolve the ID to the canonical ID via the mapping service. Use caching with appropriate invalidation (e.g., write-through or TTL) to reduce latency, but ensure cache coherence so that after merge, stale mappings are not served.

5. Address failure modes and trade-offs

Discuss handling partial failures (e.g., mapping update succeeds but write redirection fails), and trade-offs between consistency and availability (e.g., using a global lock vs. eventual consistency). Mention monitoring and rollback strategies.

Key Points to Mention

  • Canonical ID selection: choose the surviving ID or a new ID, and ensure it's immutable.
  • Atomicity: use transactions or consensus to make the merge commit atomic across mapping and data stores.
  • Idempotency: design the merge operation to be idempotent to handle retries safely.
  • Read and write paths: all reads and writes must resolve to the canonical ID, with caching for performance.
  • Backward compatibility: old IDs must continue to resolve indefinitely to avoid breaking clients.
  • Scalability: the solution must handle high QPS and large data volumes, possibly using sharding and replication.

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

Q3

How do you reassign ownership metadata across all entities that reference a customer (accounts, payment instruments, transfers, beneficiaries, etc.) without rewriting the ledger itself?

System DesignData Modeling
Author's notes

The key insight I landed on was separating ownership metadata from the ledger records.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that the ledger is immutable and should never be rewritten; instead, ownership is a mutable reference layer. Propose a design where ownership is stored as a separate mapping (e.g., customer_id -> owner_id) or as a versioned pointer, and all entities resolve ownership through that layer, enabling atomic reassignment without touching ledger entries.

Pro tip: Emphasize idempotency and auditability: reassignment should be a single atomic operation that emits an event, and all downstream systems should eventually converge. Also mention that you'd use a distributed transaction or saga pattern to ensure consistency across services.

1. Clarify requirements and constraints

Ask about scale, consistency needs, and whether the ledger is truly immutable. Confirm that ownership is metadata, not part of the ledger's core financial records.

2. Design an ownership indirection layer

Introduce a separate ownership service or table that maps entity IDs to owner IDs. All entities reference this layer instead of storing owner directly.

3. Implement atomic reassignment

Use a transaction or saga to update the ownership mapping and emit an event. Ensure idempotency and handle partial failures with compensating actions.

4. Ensure read consistency and caching

Decide on read-your-writes consistency for the reassignment. Invalidate caches and propagate changes to read replicas or materialized views.

5. Audit and rollback strategy

Log all reassignments with before/after states. Provide a way to revert if needed, without altering ledger entries.

Key Points to Mention

  • Ledger immutability: never rewrite ledger entries; ownership is separate metadata.
  • Indirection layer: use a mapping table or service to resolve ownership dynamically.
  • Atomicity and idempotency: reassignment must be atomic and safe to retry.
  • Event-driven propagation: emit events for downstream systems to update their views.
  • Consistency models: choose between strong and eventual consistency based on requirements.
  • Audit trail: maintain a history of ownership changes for compliance and debugging.

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

Q4

How do you re-link historical payments and transfers, plus any recurring or scheduled items, so nothing gets lost or executed twice after the merge?

System DesignTechnical Trade-offs
Author's notes

Scheduled items tripped me up a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the merge scenario and data model, then outline a reconciliation strategy that ensures idempotency and consistency. Emphasize using unique identifiers, transaction logs, and a state machine to track payment and transfer lifecycles, and discuss how to handle recurring/scheduled items with deduplication and conflict resolution.

Pro tip: Proactively mention the need for a rollback plan and monitoring during the merge to catch anomalies early, showing you think about production safety beyond just the happy path.

1. Clarify Requirements and Scope

Ask questions to understand the merge context: which systems are merging, what data volumes are involved, and what the acceptable downtime or consistency guarantees are. Identify all payment types (one-time, recurring, scheduled) and their current storage.

2. Design a Unified Data Model

Propose a canonical schema that maps old records to new ones using stable unique IDs (e.g., payment ID, transfer ID) and includes metadata like source system and merge timestamp. Ensure the model supports idempotent operations and audit trails.

3. Implement Idempotent Re-linking and Deduplication

Use deterministic keys (e.g., hash of user ID + amount + timestamp) to detect duplicates. For recurring/scheduled items, store a unique schedule ID and use a distributed lock or transaction to prevent double execution during the merge window.

4. Handle In-Flight and Future Items

For payments/transfers in progress, pause execution, reconcile state, and resume with a consistent state machine. For future scheduled items, re-register them in the new system with deduplication checks and adjust timing if needed.

5. Validate and Monitor

Run reconciliation reports comparing counts and sums between old and new systems. Set up alerts for anomalies (e.g., duplicate executions, missing items) and have a rollback plan if issues arise.

Key Points to Mention

  • Idempotency keys and deduplication strategies to prevent double execution
  • Use of a state machine to track payment/transfer lifecycle states (e.g., pending, completed, failed)
  • Distributed transactions or two-phase commit for atomicity across systems
  • Handling of recurring/scheduled items with unique schedule IDs and conflict resolution
  • Audit logs and reconciliation reports for validation
  • Rollback and monitoring plans for production safety

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

Q5

How do pending or held transactions, authorizations, and in-flight transfers continue to settle correctly after the merge completes?

System DesignTechnical Trade-offs
Author's notes

My answer was basically: in-flight items carry the account ID not the customer ID, so they settle fine as long as account ownership is still resolvable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope: what systems are merging (e.g., payment processors, ledgers) and what 'settle correctly' means (consistency, exactly-once). Then outline a strategy that ensures in-flight transactions are tracked, reconciled, and completed across the merge boundary, using idempotency, durable queues, and a reconciliation process.

Pro tip: Emphasize that the hardest part is not the happy path but handling failures and partial states during the merge; propose a reconciliation mechanism that runs continuously until all in-flight transactions are resolved, and highlight the need for observability to detect anomalies.

1. Clarify requirements and scope

Ask questions to understand the systems involved, the definition of 'settle correctly', and any constraints (e.g., downtime, data consistency guarantees).

2. Identify in-flight transaction types

Enumerate pending transactions, authorizations, and transfers, and determine their lifecycle states and where they are stored.

3. Design for idempotency and durability

Ensure each transaction has a unique ID and is processed exactly once, using durable queues or logs to persist state across the merge.

4. Implement reconciliation and monitoring

Create a reconciliation process that compares source and target systems, resolves discrepancies, and alerts on failures.

5. Plan for rollback and edge cases

Define rollback procedures and handle edge cases like timeouts, partial failures, and duplicate submissions.

Key Points to Mention

  • Idempotency keys to prevent duplicate processing
  • Durable message queues or event logs to persist in-flight transactions
  • Two-phase commit or saga patterns for distributed transactions
  • Reconciliation jobs to detect and resolve inconsistencies
  • Monitoring and alerting for transaction states during and after merge
  • Graceful handling of timeouts and retries with exponential backoff

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

Q6

How do you handle conflicts and duplicates that arise from the merge, like duplicate payment methods on the same token, identical scheduled items, beneficiary collisions, single-primary constraints, and per-customer unique nickname conflicts? What are your deterministic resolution policies?

System DesignData ModelingTechnical Trade-offs
Author's notes

This was the part I felt least prepared for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as a deterministic merge of two data sources with conflicting constraints, then systematically address each conflict type with a clear resolution policy. Emphasize that your policies are idempotent, order-independent, and auditable, and explain how they preserve data integrity and user trust.

Pro tip: Propose a two-phase approach: first, detect and log all conflicts with a unique conflict ID, then apply deterministic resolution rules that are versioned and reversible. This shows you prioritize observability and rollback safety, which is critical at Meta's scale.

1. Define conflict categories and invariants

Enumerate each conflict type (duplicate payment methods, identical scheduled items, beneficiary collisions, single-primary constraints, unique nickname conflicts) and specify the invariants that must hold after merge (e.g., at most one primary payment method per token, unique nickname per customer).

2. Establish deterministic resolution policies

For each conflict, define a total order or priority rule (e.g., latest timestamp wins, source system priority, lexicographic ID) that guarantees the same outcome regardless of merge order. Ensure policies are idempotent and commutative where possible.

3. Implement conflict detection and logging

Build a mechanism to detect conflicts during merge, assign a unique conflict ID, and log all relevant data (source records, resolution applied, timestamp). This enables auditing, debugging, and potential rollback.

4. Apply resolution with idempotency and atomicity

Execute resolutions in a transaction or with idempotent operations to avoid partial merges. Use versioning or optimistic concurrency to handle concurrent merges safely.

5. Validate and monitor post-merge state

After merge, run validation checks to ensure all invariants hold. Set up monitoring and alerts for conflict rates and resolution failures to catch issues early.

Key Points to Mention

  • Deterministic tie-breaking rules (e.g., timestamp, source priority, ID) to ensure consistent outcomes.
  • Idempotency and order-independence of merge operations to support retries and distributed processing.
  • Handling of unique constraints (e.g., nickname conflicts) via suffixing, merging, or user notification.
  • Single-primary constraint enforcement: demote or promote based on policy, with clear audit trail.
  • Conflict logging and observability for debugging and rollback.
  • Trade-offs between automatic resolution and manual intervention, and how to minimize user impact.

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

Q7

How do you update or invalidate indexes and caches after a merge, including top-N payers and top-N spenders leaderboards, so aggregates stay correct immediately?

System DesignAlgorithms & Data Structures
Author's notes

Top-N leaderboards were a fun wrinkle.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's consistency requirements and scale, then propose a hybrid approach that combines incremental updates for real-time correctness with periodic batch recomputation for resilience. Emphasize idempotency, versioning, and fallback mechanisms to handle failures and ensure aggregates remain accurate.

Pro tip: Mention that you would use a write-ahead log or change data capture to replay updates and rebuild caches/indexes, and highlight the importance of monitoring staleness metrics to detect and alert on inconsistencies.

1. Clarify Requirements and Scale

Ask about consistency needs (e.g., immediate vs. eventual), data volume, update frequency, and latency SLAs to tailor the solution.

2. Design Incremental Update Mechanism

Propose a system where each merge triggers events that update affected aggregates (e.g., top-N leaderboards) in real-time, using idempotent operations and versioning to handle out-of-order updates.

3. Implement Cache Invalidation and Refresh

Use a cache-aside pattern with short TTLs for leaderboards, and invalidate or update cache entries upon merge events; consider write-through for critical aggregates.

4. Ensure Resilience with Batch Reconciliation

Schedule periodic batch jobs to recompute aggregates from source data, compare with incremental results, and correct any drift, ensuring eventual consistency.

5. Monitor and Alert on Staleness

Instrument the system to track update latency and cache hit rates, and set up alerts for inconsistencies or delays in leaderboard updates.

Key Points to Mention

  • Idempotent updates to handle duplicate or out-of-order merge events
  • Versioning or timestamps to resolve conflicts and ensure correct ordering
  • Cache invalidation strategies (e.g., write-through, write-behind, TTL-based)
  • Use of change data capture (CDC) or event streams for real-time updates
  • Periodic batch recomputation for reconciliation and fault tolerance
  • Monitoring and alerting on staleness and consistency metrics

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

Q8

How do you ensure that balances, transaction history, and top-N aggregates remain correct with no loss and no double-counting for queries issued using either the old or new customer ID after the merge?

System DesignTechnical Trade-offs
Author's notes

I covered the no-double-counting angle by pointing to the alias layer: both IDs resolve to the same canonical, so any aggregation query runs once against the canonical.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the merge semantics and consistency requirements, then propose a design that uses a stable canonical ID with an alias mapping to resolve both old and new IDs to the same entity. Ensure all reads and writes go through this resolution layer, and use idempotent operations and transactional guarantees to prevent loss or double-counting.

Pro tip: Emphasize that correctness must be maintained during the merge itself, not just after; suggest a phased approach with dual-write and backfill, and highlight the importance of idempotency keys and monotonic versioning to handle concurrent queries.

1. Clarify requirements and constraints

Ask about the expected consistency model (strong vs eventual), the scale of data, and whether the merge is online or offline. Confirm that both old and new IDs must return identical results.

2. Design ID resolution and canonical mapping

Propose a canonical customer ID with an alias table that maps old and new IDs to the canonical ID. Ensure this mapping is consistent and durable, and that all queries resolve IDs before accessing data.

3. Ensure atomic and idempotent data operations

Use transactions or idempotent writes with unique constraints to prevent double-counting. For aggregates, maintain a single source of truth and update it atomically during the merge.

4. Handle concurrent reads and writes during merge

Implement a phased migration: dual-write to both old and new structures, backfill historical data, then switch reads. Use versioning or timestamps to avoid stale reads and ensure no loss.

5. Validate and monitor correctness

Set up reconciliation jobs to compare balances and aggregates before and after merge, and monitor for discrepancies. Provide a rollback plan if issues arise.

Key Points to Mention

  • Canonical ID and alias mapping for ID resolution
  • Idempotency and unique constraints to prevent double-counting
  • Transactional guarantees or two-phase commit for atomicity
  • Dual-write and backfill strategy for zero-downtime migration
  • Monotonic versioning or timestamps for consistency during concurrent access
  • Reconciliation and monitoring to detect and correct errors

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

Q9

What atomicity and consistency guarantees does your merge operation provide? How do you make it idempotent so repeating the same merge is a no-op, and how do you handle concurrent merges including chain scenarios like A merging into B and then B merging into C?

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

Chain merges are genuinely tricky.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the merge operation's context (e.g., merging user accounts, data records) and define the atomicity and consistency guarantees expected. Then explain how you achieve idempotency through unique merge identifiers and versioning, and describe concurrency control mechanisms like locking or optimistic concurrency to handle simultaneous merges and chain scenarios.

Pro tip: Emphasize that idempotency and concurrency control must be designed together; for example, using a merge ID and a state machine ensures that even if a merge is retried or concurrent, the system converges to a consistent state without duplication.

1. Clarify requirements and context

Ask questions to understand the data model, expected guarantees, and failure scenarios. Define what atomicity and consistency mean for this specific merge operation.

2. Design for idempotency

Use a unique merge identifier and a version or timestamp to detect and ignore duplicate merge requests. Ensure the merge operation is deterministic and can be safely retried.

3. Implement atomicity and consistency

Use transactions or atomic compare-and-swap operations to update all affected records. Ensure that either all changes are applied or none, and that the system remains consistent.

4. Handle concurrency and chains

Employ locking (pessimistic or optimistic) to serialize merges on the same entities. For chain scenarios, use a merge graph or union-find structure to resolve the final target and prevent cycles.

5. Discuss trade-offs and edge cases

Compare approaches (e.g., locking vs. optimistic concurrency) and address potential issues like deadlocks, partial failures, and scalability.

Key Points to Mention

  • Idempotency via unique merge ID and versioning
  • Atomicity through transactions or compare-and-swap
  • Consistency models (strong vs. eventual) and their implications
  • Concurrency control: pessimistic locking vs. optimistic concurrency
  • Chain merges: using union-find or merge graph to resolve final target
  • Handling failures and retries without side effects

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

Q10

What is the time and space complexity of the merge operation itself and of the post-merge read path?

Algorithms & Data StructuresSystem Design
Author's notes

Merge is O(E) where E is the number of entity references to remap, plus O(log N) for leaderboard updates.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the context by defining the data structures and operations involved in the merge and post-merge read path. Then, analyze the time and space complexity for each phase, considering best, average, and worst cases, and discuss trade-offs and optimizations.

Pro tip: Always relate complexity to real-world constraints like memory hierarchy and concurrency, and mention how you would measure or monitor performance in production.

1. Clarify the scenario

Ask or state the data structures (e.g., arrays, linked lists, LSM trees) and the specific merge operation (e.g., merging two sorted lists, merging in a merge sort, or merging in a database).

2. Analyze merge complexity

Derive time and space complexity for the merge operation, considering input sizes and auxiliary space. Discuss if it's in-place or not.

3. Analyze post-merge read path

Describe how reads occur after the merge (e.g., binary search, sequential scan, index lookup) and derive their time and space complexity.

4. Discuss trade-offs and optimizations

Mention how different data structures or algorithms affect complexity, and potential optimizations like caching, parallelism, or lazy merging.

5. Summarize and conclude

Provide a clear summary of the complexities and their implications for system design and performance.

Key Points to Mention

  • Time complexity of merge: O(n + m) for merging two sorted arrays/lists of sizes n and m.
  • Space complexity of merge: O(n + m) for auxiliary space in standard merge, or O(1) if in-place (but with higher time complexity).
  • Post-merge read path: O(log n) for binary search on sorted array, O(1) for hash-based lookup, O(k) for range scans.
  • Impact of data structures: arrays vs. linked lists vs. B-trees vs. LSM trees on merge and read complexities.
  • Trade-offs between merge frequency and read performance (e.g., in LSM trees, merging (compaction) is expensive but improves read speed).
  • Real-world considerations: memory hierarchy, disk I/O, concurrency, and amortized analysis.

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