PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Meta

Merge customers and preserve history

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competency in system design, data modeling, distributed consistency, transactional integrity, and failure-resilient schema evolution required to merge customers and preserve immutable transaction histories in a payments platform.

  • 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

Support customer merges: mergeCustomers(String oldId, String newId). Merge two customers while preserving each account’s balance and complete transaction history. Define how identifiers are unified, how you re-link historical payments/transfers/scheduled items, how conflicting or duplicate references are resolved, and how post-merge queries (e.g., balances, history, top-N spenders) remain correct. Analyze complexity and consistency guarantees.

Quick Answer: This question evaluates a candidate's competency in system design, data modeling, distributed consistency, transactional integrity, and failure-resilient schema evolution required to merge customers and preserve immutable transaction histories in a payments platform.

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)
Meta logo
Meta
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
System Design
2
0

Design: mergeCustomers(oldId, newId) for a Payments Platform

Context

You are building a banking/payments system with the following high-level entities:

  • Customer: owns one or more Accounts; appears in payments, transfers, and scheduled items.
  • Account: holds a balance and has immutable transaction history.
  • Transaction: immutable ledger events tied primarily to an Account; may also reference a Customer for convenience/analytics.
  • PaymentMethod, Transfer, ScheduledItem, Beneficiary, etc.: may reference a Customer and/or Account.

A customer merge happens when two profiles are determined to be the same person. You must merge Old (oldId) into New (newId) while:

  • Preserving each Account’s balance (Accounts are not merged or summed) and full transaction history.
  • Unifying identifiers so the system treats the merged identity as one Customer.
  • Re-linking historical and scheduled items correctly.
  • Resolving conflicting or duplicate references deterministically.
  • Ensuring post-merge queries (balances, histories, top-N spenders) remain correct.
  • Analyzing complexity and consistency guarantees.

Assume oldId ≠ newId and both exist.

Task

Design mergeCustomers(String oldId, String newId):

  1. Define how identifiers are unified and how reads/writes should behave immediately after merge.
  2. Specify how to re-link historical records (payments/transfers/scheduled items) without losing data.
  3. Describe conflict/duplicate resolution rules and data structures used to record superseded items.
  4. Ensure post-merge queries remain correct for balances, transaction histories, and analytics (e.g., top-N spenders).
  5. Provide complexity analysis (time/space, online overhead) and consistency guarantees (atomicity, isolation, idempotency, failure handling).
  6. Include any minimal schema additions you need (e.g., alias tables, status fields) and an outline of the merge algorithm.

Solution

Show

Submit Your Answer

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
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.