PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Software Engineering Fundamentals/Meta

Design concurrent expiring job registry

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of concurrent data structures, synchronization primitives, time-based expiration semantics, and efficient cleanup strategies for an in-memory job registry.

  • medium
  • Meta
  • Software Engineering Fundamentals
  • Machine Learning Engineer

Design concurrent expiring job registry

Company: Meta

Role: Machine Learning Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Design (and discuss how you would implement) an in-memory **job registry** that supports **concurrent** access. Each job has a unique `jobId` and an **expiration time** (TTL or absolute timestamp). The system must: ## Requirements - `addJob(jobId, payload, expiresAt)` : add or update a job with an expiration time. - `getJob(jobId)` : fetch job if it exists and is not expired. - `removeJob(jobId)` : remove a job. - A background mechanism (one thread is enough) should **delete expired jobs automatically**. - Must be safe under concurrency (multiple threads calling APIs). ## Discussion points - Data structures to make cleanup efficient - Race conditions between readers/writers and the cleanup thread - Time complexity and how to avoid O(n) scans

Quick Answer: This question evaluates understanding of concurrent data structures, synchronization primitives, time-based expiration semantics, and efficient cleanup strategies for an in-memory job registry.

Related Interview Questions

  • Troubleshoot a production server outage - Meta (medium)
  • Troubleshoot a Midnight Web Server Outage - Meta (medium)
  • Design a Trade Ledger Class - Meta (easy)
  • Troubleshoot a website outage with disk full - Meta (medium)
  • Explain ACID and isolation levels - Meta (medium)
Meta logo
Meta
Nov 28, 2025, 12:00 AM
Machine Learning Engineer
Onsite
Software Engineering Fundamentals
0
0
Loading...

Design (and discuss how you would implement) an in-memory job registry that supports concurrent access.

Each job has a unique jobId and an expiration time (TTL or absolute timestamp). The system must:

Requirements

  • addJob(jobId, payload, expiresAt) : add or update a job with an expiration time.
  • getJob(jobId) : fetch job if it exists and is not expired.
  • removeJob(jobId) : remove a job.
  • A background mechanism (one thread is enough) should delete expired jobs automatically .
  • Must be safe under concurrency (multiple threads calling APIs).

Discussion points

  • Data structures to make cleanup efficient
  • Race conditions between readers/writers and the cleanup thread
  • Time complexity and how to avoid O(n) scans

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Meta•More Machine Learning Engineer•Meta Machine Learning Engineer•Meta Software Engineering Fundamentals•Machine Learning Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 7,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.