PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/CloudKitchens

Implement concurrent order-accept/pickup simulator

Last updated: Mar 29, 2026

Quick Overview

This question evaluates concurrency and synchronization skills, including thread-safe design, inter-thread communication, state tracking, and correctness properties such as race-condition avoidance and deadlock freedom.

  • medium
  • CloudKitchens
  • Coding & Algorithms
  • Software Engineer

Implement concurrent order-accept/pickup simulator

Company: CloudKitchens

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## Concurrent restaurant order + pickup simulator Design and implement a **thread-safe** simulation for a restaurant that: - Receives incoming orders concurrently (multiple producer threads). - Prepares orders concurrently (one or more worker/chef threads). - Allows customers to pick up orders concurrently (multiple consumer threads). ### Requirements 1. Each order has: - `order_id` (unique integer) - `item_name` (string) - `cook_time_ms` (positive integer) 2. API / operations to support (names can vary): - `placeOrder(order_id, item_name, cook_time_ms)` - `startKitchen(num_chefs)` (starts background processing) - `pickupOrder(order_id)` blocks until the specified order is ready, then returns it - `shutdown()` stops background threads gracefully 3. Correctness constraints: - No order can be picked up before it is cooked. - Each order is cooked **exactly once** and picked up **at most once**. - No deadlocks; avoid busy-waiting. - The system should handle `N` orders with concurrent placement and pickup. ### What to discuss/implement - Your choice of synchronization primitives (mutex/lock, condition variable, semaphore, blocking queue, etc.). - Data structures used to track order state. - How you ensure fairness and avoid race conditions. (You may assume a single process and shared memory; no networking required.)

Quick Answer: This question evaluates concurrency and synchronization skills, including thread-safe design, inter-thread communication, state tracking, and correctness properties such as race-condition avoidance and deadlock freedom.

Related Interview Questions

  • Implement menu parser and serializer - CloudKitchens (medium)
  • Design a menu manager with enums - CloudKitchens (Medium)
  • Design an in-memory cloud storage system - CloudKitchens (Medium)
  • Design receipt system with combo discounts - CloudKitchens (Medium)
  • Answer static and streaming Top-K queries - CloudKitchens (medium)
CloudKitchens logo
CloudKitchens
Aug 20, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
7
0

Concurrent restaurant order + pickup simulator

Design and implement a thread-safe simulation for a restaurant that:

  • Receives incoming orders concurrently (multiple producer threads).
  • Prepares orders concurrently (one or more worker/chef threads).
  • Allows customers to pick up orders concurrently (multiple consumer threads).

Requirements

  1. Each order has:
    • order_id (unique integer)
    • item_name (string)
    • cook_time_ms (positive integer)
  2. API / operations to support (names can vary):
    • placeOrder(order_id, item_name, cook_time_ms)
    • startKitchen(num_chefs) (starts background processing)
    • pickupOrder(order_id) blocks until the specified order is ready, then returns it
    • shutdown() stops background threads gracefully
  3. Correctness constraints:
    • No order can be picked up before it is cooked.
    • Each order is cooked exactly once and picked up at most once .
    • No deadlocks; avoid busy-waiting.
    • The system should handle N orders with concurrent placement and pickup.

What to discuss/implement

  • Your choice of synchronization primitives (mutex/lock, condition variable, semaphore, blocking queue, etc.).
  • Data structures used to track order state.
  • How you ensure fairness and avoid race conditions.

(You may assume a single process and shared memory; no networking required.)

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More CloudKitchens•More Software Engineer•CloudKitchens Software Engineer•CloudKitchens Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

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