MongoDB software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for MongoDB.
RateLimiter that allows requests to be allowed to pass if they fall within a defined rate limit.class RateLimiter:def allow_request(self, user_id: str) -> bool: - Returns True if the request is allowed.def get_request_count(self, user_id: str) -> int: - Returns the count of requests made by the user.1 <= requests_per_window <= 10^31 <= window_size <= 10^31 <= len(user_id) <= 100.JobQueue that allows adding jobs and processing them in concurrent threads. class JobQueue: def add_job(self, job: Callable) -> None: - Adds a job to the queue.def process_jobs(self, num_threads: int) -> None: - Starts processing jobs using specified threads.def get_status(self) -> List[str]: - Returns a list of job statuses ('pending', 'completed').1 <= num_threads <= 10LRUCache that supports get and put operations.class LRUCache:def __init__(self, capacity: int): Initializes the cache with a specific capacity.def get(self, key: int) -> int: Returns the value of the key if present, otherwise return -1.def put(self, key: int, value: int) -> None: Updates or inserts the value if the key is not already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.1 <= capacity <= 300000 <= key, value <= 10^4.MongoDBApi that simulates these operations on a collection.class MongoDBApi:def create(self, data: Dict[str, Any]) -> str:: Creates a new record and returns its ID.def read(self, record_id: str) -> Dict[str, Any]: Returns the record specified by record_id.def update(self, record_id: str, data: Dict[str, Any]) -> bool: Updates the record and returns success status.def delete(self, record_id: str) -> bool: Deletes the record and returns success status.record_id is a string with a length of up to 36 characters.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free