← Meta Interview Insights

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

IntermediatePrefer not to say
May 2026Remote

Summary

Meta SWE online assessment, one big coding problem the whole time. It was a custom in-memory database design with CRUD plus lock/unlock behavior, and the edge cases were way more annoying than the core idea.

Questions Asked (1)

Q1

Design and implement an in-memory database that supports record-level CRUD operations (create, read, update, delete fields) as well as locking and unlocking records, where writes to a locked record should be rejected.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The core structure wasn't bad, two hashmaps and you're mostly there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the data model, then design a class with a hash map for records and a lock set. Implement CRUD operations with lock checks, and discuss trade-offs like concurrency and persistence.

Pro tip: Mention that you would use a read-write lock or synchronized methods to handle concurrent access, and discuss how to scale the design for distributed systems.

1. Clarify Requirements

Ask about expected operations, concurrency needs, persistence, and performance constraints to scope the problem.

2. Design Data Model

Define a Record class with fields and a Database class that stores records in a hash map and tracks locked record IDs in a set.

3. Implement Core Operations

Write methods for create, read, update, delete, lock, and unlock, ensuring writes to locked records are rejected with an exception.

4. Handle Concurrency

Use synchronization or read-write locks to make operations thread-safe, and discuss trade-offs between coarse and fine-grained locking.

5. Discuss Extensions and Trade-offs

Talk about scaling to distributed systems, persistence, transaction support, and alternative locking strategies.

Key Points to Mention

  • Use a hash map for O(1) record access and a set for O(1) lock checks.
  • Reject writes to locked records by throwing an exception or returning an error.
  • Ensure thread safety with synchronized methods or read-write locks.
  • Consider lock granularity: record-level vs. database-level locking.
  • Discuss persistence options and how to extend to distributed systems.
  • Mention potential deadlocks and how to avoid them (e.g., lock ordering).

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