← Meta Interview Insights

Meta·Software Engineer·Online Assessment (OA)·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

Meta SWE CodeSignal OA, 90 minutes, progressive OOD format building a banking system across four levels. The bar is basically full AC or bust, which I found out the hard way reading other people's outcomes after the fact.

Questions Asked (4)

Q1

Implement the core banking operations: create an account, deposit funds, and transfer between accounts, each returning appropriate values or None on failure.

Algorithms & Data StructuresSystem Design
Author's notes

This is the foundation everything else builds on so you really cannot rush it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the API contract, including return values and failure conditions. Then design a simple data model (e.g., a map of account IDs to balances) and implement each operation with proper validation and atomicity. Discuss trade-offs and potential extensions like concurrency and persistence.

Pro tip: Emphasize the importance of atomicity and consistency in banking operations—mention that transfers must be atomic to avoid partial updates, and discuss how you'd handle concurrent access (e.g., locks or transactions). This shows you think beyond basic functionality.

1. Clarify Requirements

Ask questions to understand constraints: Are account IDs strings or integers? Should deposit/transfer return new balance or boolean? What are failure cases (e.g., insufficient funds, invalid account)?

2. Define API and Data Model

Specify method signatures and return types (e.g., createAccount(id) -> bool, deposit(id, amount) -> new balance or None, transfer(from, to, amount) -> bool). Choose a simple in-memory data structure like a hash map for accounts and balances.

3. Implement Core Operations

Write code for each operation with input validation (e.g., positive amounts, existing accounts) and handle failure by returning None or False. For transfer, ensure atomicity by checking both accounts and updating balances only if all conditions are met.

4. Test and Edge Cases

Walk through test cases: creating duplicate account, depositing negative amount, transferring more than balance, transferring to non-existent account. Verify return values match expectations.

5. Discuss Scalability and Concurrency

Mention how the design would change for concurrent access (e.g., using locks or transactions) and persistence (e.g., database). Highlight trade-offs between simplicity and robustness.

Key Points to Mention

  • Atomicity of transfers: ensure both debit and credit happen or neither does.
  • Input validation: check for positive amounts, existing accounts, and sufficient funds.
  • Return values: clearly define what each operation returns on success and failure (e.g., None, False, or new balance).
  • Data structures: use a hash map for O(1) account lookup and updates.
  • Concurrency: discuss locking mechanisms or transactional guarantees to prevent race conditions.
  • Error handling: gracefully handle invalid inputs and edge cases without crashing.

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

Q2

Implement a top_spenders query that returns the top N accounts ranked by total outgoing transfer volume, with ties broken alphabetically by account ID.

Algorithms & Data Structures
Author's notes

The tiebreak tripped me up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the data model and requirements first, then propose an efficient aggregation pipeline that computes total outgoing volume per account, filters out zero-volume accounts, and sorts by volume descending with account ID ascending as tiebreaker. Discuss trade-offs between sorting all accounts versus using a heap for top N, and consider scalability for large datasets.

Pro tip: Mention that you would exclude accounts with zero outgoing volume to avoid returning irrelevant results, and discuss how to handle ties at the cutoff (e.g., if multiple accounts have the same volume as the Nth, decide whether to include all or strictly N).

1. Clarify requirements and data model

Ask about the schema (e.g., transfers table with from_account, to_account, amount), whether 'outgoing' means from_account, and if volume is sum of amounts. Confirm N is a parameter and ties are broken alphabetically by account ID.

2. Design the aggregation logic

Group transfers by from_account, sum amounts to get total outgoing volume per account. Filter out accounts with zero or null volume if appropriate.

3. Implement sorting and tie-breaking

Sort the aggregated results by total volume descending, then by account ID ascending. Use a stable sort or explicit comparator to ensure correct tie-breaking.

4. Optimize for top N

If N is small relative to number of accounts, use a min-heap of size N to find top N in O(M log N) time, where M is number of accounts. Otherwise, full sort is O(M log M). Discuss trade-offs.

5. Handle edge cases and scalability

Consider empty results, N larger than number of accounts, ties at the boundary, and distributed processing (e.g., MapReduce) for massive datasets. Mention indexing on from_account for efficient grouping.

Key Points to Mention

  • Aggregation: GROUP BY from_account and SUM(amount) to compute total outgoing volume.
  • Sorting: ORDER BY total_volume DESC, account_id ASC to satisfy tie-breaking.
  • Top-N optimization: Use a min-heap of size N for O(M log N) time when N is small.
  • Edge cases: Exclude zero-volume accounts, handle N > number of accounts, and ties at the cutoff.
  • Scalability: Consider distributed aggregation (e.g., MapReduce) and indexing for large datasets.
  • SQL vs. code: Discuss whether to implement in SQL (e.g., using ORDER BY and LIMIT) or in application code, and trade-offs.

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

Q3

Add scheduled payment functionality: schedule a payment to execute after a given delay and allow cancellation by payment ID.

System DesignAlgorithms & Data Structures
Author's notes

The global payment counter (payment1, payment2, ...) is a small thing that's easy to forget to make truly global rather than per-account.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify requirements (delay precision, persistence, scale, cancellation semantics) and then design a system with a scheduler, a task store, and a cancellation mechanism. Discuss trade-offs between in-memory and distributed approaches, and outline the core algorithm for scheduling and cancelling tasks.

Pro tip: Emphasize idempotency and failure recovery: scheduled payments must not double-execute or get lost if the scheduler crashes. Mention using a persistent store with atomic operations and a unique payment ID to ensure exactly-once execution.

1. Clarify Requirements and Constraints

Ask about delay precision, scale (number of scheduled payments), persistence needs, and whether cancellation should work after execution starts. Confirm that payment ID is unique and provided by the client.

2. High-Level Architecture

Propose components: a scheduler (e.g., priority queue, timer wheel, or external service like Redis ZSET), a persistent task store (database), and a payment executor. Explain how they interact.

3. Scheduling Algorithm

Describe how to schedule a payment: insert into a min-heap or sorted set keyed by execution time, with a background worker polling for due tasks. Discuss efficient data structures for large scale.

4. Cancellation Mechanism

Explain how to cancel by payment ID: mark the task as cancelled in the store and remove it from the scheduler if possible. Handle race conditions where cancellation arrives as the task is executing.

5. Reliability and Trade-offs

Discuss failure recovery (persistence, idempotency, retries), exactly-once semantics, and trade-offs between in-memory (fast, not durable) vs. distributed (scalable, complex) solutions.

Key Points to Mention

  • Use of a priority queue or sorted set (e.g., Redis ZSET) for efficient scheduling by execution time.
  • Persistence of scheduled tasks to survive crashes, with atomic operations for status updates.
  • Idempotency and exactly-once execution to prevent duplicate payments.
  • Cancellation by payment ID: update status and remove from scheduler, handling race conditions.
  • Scalability considerations: sharding, distributed schedulers, and load balancing.
  • Trade-offs between in-memory and persistent storage, and between polling vs. event-driven execution.

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

Q4

Implement account merging and historical balance queries: merge two accounts (combining balances, outgoing totals, and scheduled payments), then support querying what an account's balance was at a specific past timestamp.

System DesignData ModelingTechnical Trade-offs
Author's notes

This is where most people run out of time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a data model that supports both current state and historical queries. Propose an append-only ledger or event-sourced system with periodic snapshots for efficient point-in-time balance queries, and describe the merge operation as a transactional event that creates a new merged account while preserving history. Discuss trade-offs between consistency, latency, and storage, and outline how to handle concurrent merges and queries.

Pro tip: Emphasize idempotency and auditability: merges should be idempotent and produce an immutable audit trail, which is critical for financial systems and simplifies rollback and debugging.

1. Clarify Requirements and Scale

Ask about expected throughput, latency requirements, consistency needs, and whether historical queries must be exact or approximate. Confirm what data must be merged (balances, outgoing totals, scheduled payments) and how to handle edge cases like merging accounts with pending transactions.

2. Design Data Model for History

Propose an append-only ledger of transactions with timestamps, plus periodic snapshots (e.g., daily) to speed up point-in-time queries. Alternatively, use event sourcing with a materialized view for current balances. Discuss how to index by account ID and timestamp.

3. Implement Merge Operation

Describe a transactional merge: create a new account, transfer balances and scheduled payments, and record a merge event linking the source accounts. Ensure idempotency by using a unique merge ID and handling retries. Consider locking or optimistic concurrency to prevent concurrent merges.

4. Support Historical Balance Queries

Explain how to compute balance at time T: find the latest snapshot before T, then apply all transactions between snapshot and T. For merged accounts, trace back through merge events to include transactions from source accounts. Discuss caching and read replicas for performance.

5. Address Trade-offs and Scalability

Compare event sourcing vs. mutable state with audit log; snapshots vs. full replay; strong vs. eventual consistency. Discuss partitioning by account ID, handling hot accounts, and archiving old data. Mention monitoring and alerting for merge failures.

Key Points to Mention

  • Event sourcing or append-only ledger for immutable history and auditability
  • Periodic snapshots to optimize point-in-time balance queries
  • Idempotent merge operation with unique merge ID and transactional guarantees
  • Handling of scheduled payments and outgoing totals during merge
  • Concurrency control (e.g., optimistic locking) to prevent race conditions
  • Trade-offs between consistency, latency, and storage cost

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