Skip to main content
All Questions

Find the duplicate accounts of a given Airbnb account.

Unlock detailed company stats for this questionUpgrade

Each person should have only one account, but people end up with multiple accounts sharing the same email, phone number, government ID, device or other identity information. Given a list of accounts (each named "A", "B", etc.) with identity attributes, build a function that returns the duplicate accounts for any given account. Account names are unique. Example: A, B, C, D with A and D sharing phone 12345 and others linked by shared identifiers gives duplicates of A = [C, D]; adding account E into the chain gives [C, D, E]. Follow-up: what if another identifier such as GovtId is added? Keeping an index per identifier type does not scale. The problem reduces to connected components over accounts linked by any shared identifier; a DSU with a uniqueIdentifier-to-parent map and an account-to-parent map handles new identifier types.

Expect follow-ups like

  • What if we add another identifier like GovtId?

Format · Airbnb coding round, 45 minutes plus dry run.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.