PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Meta

Merge customers and preserve history

Last updated: Jun 15, 2026

Quick Overview

A Meta software-engineer system-design take-home: implement mergeCustomers(oldId, newId) for a payments/ledger platform, absorbing one customer into another while preserving every account's balance and immutable transaction history. Tests identity unification, ownership remap, conflict/duplicate resolution, top-N leaderboard maintenance, atomicity, concurrency, idempotency, and complexity analysis.

  • hard
  • Meta
  • System Design
  • Software Engineer

Merge customers and preserve history

Company: Meta

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Take-home Project

##### Question Implement `mergeCustomers(String oldId, String newId)` for a payments/ledger platform. The call absorbs `oldId` into the survivor `newId` while preserving every account's balance and complete, immutable transaction history. Accounts are not coalesced — each account, with its history and balances, stays attached to its own account id. Design the full merge and explain your reasoning for each of the following: 1. **Identifier unification** — How do you unify the two identities so that, from the moment of merge commit, both `oldId` and `newId` resolve to a single canonical identity for all reads and future writes? 2. **Ownership remap** — How do you reassign ownership metadata across the entities that reference a customer (accounts, payment instruments, transfers, beneficiaries, etc.) without rewriting the ledger? 3. **Re-link historical and scheduled items** — How do you re-link historical payments/transfers and recurring/scheduled items so nothing is lost or double-executed? 4. **Pending / held items** — How do pending or held transactions, authorizations, and in-flight transfers continue to settle correctly after the merge? 5. **Conflict & duplicate resolution** — How do you handle `customerId` collisions and uniqueness conflicts (e.g. duplicate payment methods on the same token, identical scheduled items, beneficiary collisions, single-primary constraints, per-customer unique nicknames)? Give deterministic policies. 6. **Indexes & caches** — How do you update or invalidate indexes and caches, including the **top-N payers / top-N spenders** structure, so leaderboards stay correct immediately after the merge? 7. **Post-merge query correctness** — How do balances, transaction history, and top-N aggregates remain correct (no loss, no double-counting) for queries issued by either id? 8. **Atomicity & consistency** — What are your atomicity and system-wide consistency guarantees? How do you make the operation idempotent (repeating a merge is a no-op) and safe under concurrent merges (including chains A→B then B→C)? 9. **Complexity** — Analyze time and space complexity of the merge and of the post-merge read path.

Quick Answer: A Meta software-engineer system-design take-home: implement mergeCustomers(oldId, newId) for a payments/ledger platform, absorbing one customer into another while preserving every account's balance and immutable transaction history. Tests identity unification, ownership remap, conflict/duplicate resolution, top-N leaderboard maintenance, atomicity, concurrency, idempotency, and complexity analysis.

Related Interview Questions

  • Design Top-K, Crawler, and Chess Systems - Meta (hard)
  • Design Search And Web Crawling Systems - Meta (medium)
  • Design an Instagram-Style Social Feed - Meta (medium)
  • Design an Online Game Leaderboard - Meta (hard)
  • Design an On-Demand Delivery Platform - Meta (medium)
|Home/System Design/Meta

Merge customers and preserve history

Meta logo
Meta
Sep 6, 2025, 12:00 AM
hardSoftware EngineerTake-home ProjectSystem Design
6
0
Question

Implement mergeCustomers(String oldId, String newId) for a payments/ledger platform. The call absorbs oldId into the survivor newId while preserving every account's balance and complete, immutable transaction history. Accounts are not coalesced — each account, with its history and balances, stays attached to its own account id.

Design the full merge and explain your reasoning for each of the following:

  1. Identifier unification — How do you unify the two identities so that, from the moment of merge commit, both oldId and newId resolve to a single canonical identity for all reads and future writes?
  2. Ownership remap — How do you reassign ownership metadata across the entities that reference a customer (accounts, payment instruments, transfers, beneficiaries, etc.) without rewriting the ledger?
  3. Re-link historical and scheduled items — How do you re-link historical payments/transfers and recurring/scheduled items so nothing is lost or double-executed?
  4. Pending / held items — How do pending or held transactions, authorizations, and in-flight transfers continue to settle correctly after the merge?
  5. Conflict & duplicate resolution — How do you handle customerId collisions and uniqueness conflicts (e.g. duplicate payment methods on the same token, identical scheduled items, beneficiary collisions, single-primary constraints, per-customer unique nicknames)? Give deterministic policies.
  6. Indexes & caches — How do you update or invalidate indexes and caches, including the top-N payers / top-N spenders structure, so leaderboards stay correct immediately after the merge?
  7. Post-merge query correctness — How do balances, transaction history, and top-N aggregates remain correct (no loss, no double-counting) for queries issued by either id?
  8. Atomicity & consistency — What are your atomicity and system-wide consistency guarantees? How do you make the operation idempotent (repeating a merge is a no-op) and safe under concurrent merges (including chains A→B then B→C)?
  9. Complexity — Analyze time and space complexity of the merge and of the post-merge read path.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Meta•More Software Engineer•Meta Software Engineer•Meta System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.