solidcodersolidcoder
Explore Courses
solidcodersolidcoder

Practical courses for software engineering interviews — no gatekeeping, no fluff.

Company-wise Questions

  • Flipkart Machine Coding Questions

Machine Coding Tutorial

  • Machine Coding Tutorial

Explore

  • Courses
  • About
  • Privacy Policy
  • Terms

© 2026 solidcoder · Practical courses for software engineering interviews.

Built for the AI era — learn by doing.

Home/Machine Coding/Flipkart Machine Coding Questions/Quick Commerce System (Flipkart Minutes)
Chapters — Flipkart Machine Coding Questions▾

Quick Commerce System (Flipkart Minutes)

Machine Coding·SDE-3+·5 min read·Sep 11, 2026

Design Flipkart Minutes — instant delivery for any item with customer and partner onboarding, queued order assignment, pickup/delivery lifecycle, and thread-safe concurrency.

Implement the core system for Flipkart Minutes, Flipkart's instant delivery platform, enabling customers to order any item for delivery within minutes — with rapid assignment, queueing, and reliable fulfillment.

What the round tests

This one tests whether you can model a real-time fulfillment loop cleanly — queued assignment under constrained supply, strict one-order-per-partner invariant, cancellable-before-pickup semantics, and thread-safe state transitions — without leaking order, partner, and queue concerns into one another.

Objective

The primary objective is to design and implement an in-memory quick commerce system that supports onboarding of customers and delivery partners, order placement and cancellation, auto-assignment with queueing, pickup and delivery transitions, real-time status tracking, and correct concurrency — plus bonus extensibility around notifications, ratings, dashboards, and auto-cancellation.

Functional Requirements

Two tiers of scope

Requirements are split into two tiers so you know what to prioritize under time pressure: build first, and build only after the core is demoable.

Part 1 — Core Requirements

Core functionality you must build and get working first.

1. Onboarding

Onboarding operations
Operation
What it does
onboard_customer(customer_id, name)
Register a new customer.
onboard_partner(partner_id, name)
Register a new delivery partner as AVAILABLE.

2. Order Placement & Cancellation

Order lifecycle — placement & cancellation
Rule
Detail
Place order
Customer can place an order for any item (item name or ID). No stock constraints — all items are always available.
Cancel order
Customer can cancel an order only if it has not yet been picked up by a delivery partner.
Post-pickup lock
Once a partner picks up an order, it cannot be canceled — not by the customer, not by the system.

3. Order Assignment & Fulfillment

Assignment & fulfillment rules
Rule
Detail
Auto-assignment
Orders are auto-assigned to any available delivery partner.
Queue when busy
If no partner is available, the order stays queued and is assigned as soon as a partner becomes free.
One-at-a-time
Each delivery partner can handle only one order at a time.
Queue can exceed capacity
Ongoing orders may exceed the number of partners — excess orders wait in the queue.
Canceled ≠ assigned
Canceled orders must not be assigned to a partner.
Cancel frees partner
If an assigned order is canceled before pickup, the partner becomes AVAILABLE again and can take the next queued order.
Pickup → Deliver
Partner picks up the assigned order, then marks it as delivered.
Availability
Assume partners are available 24×7. Ignore travel time.

4. Status Tracking

Status queries
Operation
What it does
show_order_status(order_id)
Return real-time status of the order (e.g., CREATED → ASSIGNED → PICKED_UP → DELIVERED / CANCELED, QUEUED).
show_partner_status(partner_id)
Return real-time status of the partner (AVAILABLE / BUSY) and current order if any.

5. Concurrency & Thread Safety

Concurrency is P0

The system must be thread-safe — multiple customers and partners act simultaneously (place, cancel, pickup, deliver, query). Assignment, queue dequeue, and status transitions must be correctly synchronized.

Part 2 — Bonus Features

Bonus — build only after the core is complete and demoable

Extensibility checks — can your design layer notifications, ratings, and ops dashboards on top without rewriting the assignment core.

Bonus features
Feature
What to build
Notifications
Notify customers and partners (simulated logs) on order status changes — assigned, picked up, delivered, canceled.
Ratings
Customers can rate delivery partners after successful delivery.
Dashboard
Show top delivery partners by number of deliveries and by rating.
Auto-cancel (30 min)
If no partner picks up the order within 30 minutes of creation, auto-cancel it — regardless of whether it was assigned or still queued.

Example Usage: Sample Flow

Driver shape — inputs shown as i: and outputs as o:; exact format is flexible as long as semantics match.

1. Onboard customers and partners

> onboard customer — customer_id: c1, name: Alice
✅ Customer c1 onboarded.

> onboard delivery_partner — partner_id: p1, name: Bob
✅ Partner p1 onboarded. Status: AVAILABLE

> onboard delivery_partner — partner_id: p2, name: Charlie
✅ Partner p2 onboarded. Status: AVAILABLE

2. Create orders — auto-assignment & queueing

> create order — customer_id: c1, item_name: "Milk"
✅ Order o1 created → ASSIGNED to p1

> create order — customer_id: c1, item_name: "Bread"
✅ Order o2 created → ASSIGNED to p2

> create order — customer_id: c1, item_name: "Eggs"
✅ Order o3 created → QUEUED (no partner available)

3. Show status

> show order status — order_id: o1
📦 o1 — ASSIGNED (partner: p1)

> show delivery partner status — partner_id: p1
🛵 p1 — BUSY (order: o1)

> show order status — order_id: o3
📦 o3 — QUEUED

4. Pickup and delivery transitions

> pick up order — partner_id: p1, order_id: o1
✅ o1 → PICKED_UP (cannot be canceled now)

> complete order — partner_id: p1, order_id: o1
✅ o1 → DELIVERED — p1 becomes AVAILABLE → o3 auto-assigned to p1

> show order status — order_id: o3
📦 o3 — ASSIGNED (partner: p1)

5. Cancel before pickup (frees partner)

> cancel order — order_id: o3
✅ o3 → CANCELED — p1 becomes AVAILABLE

> show delivery partner status — partner_id: p1
🛵 p1 — AVAILABLE

6. Cancel after pickup — blocked

> pick up order — partner_id: p2, order_id: o2
✅ o2 → PICKED_UP

> cancel order — order_id: o2
❌ Cancel failed — order already picked up.
Result

Queuing, one-order-per-partner, cancel-before-pickup, and pickup-lock semantics all hold — a third concurrent order correctly queues when both partners are busy, auto-assigns when a partner frees up, and a queued-but-assigned order that gets canceled before pickup frees its partner without breaking the queue.

Guidelines

Constraints & time box

You have 120 minutes. Use only in-memory data structures — no external databases like MySQL. No UX or HTTP APIs — a standalone driver / main class / test harness is enough.

Evaluation criteria
Criterion
What's assessed
Demoable & correct
Code runs and is functionally correct for the sample flows.
Readability
Code is clean and easy to follow.
Entity modelling
Customers, partners, orders, queue, and statuses are proper entities — not scattered fields.
Modularity & extensibility
New rules (notifications, ratings, auto-cancel) can be added without rewriting the core.
Separation of concerns
Assignment, lifecycle, status tracking, and concurrency are decoupled.
Abstractions & patterns
Design patterns used where they genuinely help — not for show.
Exception handling
Edge cases handled gracefully with clear error paths.
Concurrency
Thread-safe transitions and queue operations under simultaneous actions.
Assumptions

The problem expects reasonable assumptions — state them to the reviewer. Examples: order IDs are system-generated, partner selection among AVAILABLE is any / FIFO, and time for auto-cancel is simulated via a clock or scheduler.

Up next1/1
Part 3 · SDE-3+
←
← Prev Chapter
Buy now Pay Later
5 min
This month's launch price
₹30,000₹3,000SOLID50 — 50% OFF

3 years access · 40+ lessons · AI assisted coding

Enroll Now →

Use code SOLID50 at checkout

On this page
  • Objective
  • Functional Requirements
    • Part 1 — Core Requirements
    • Part 2 — Bonus Features
  • Example Usage: Sample Flow
  • Guidelines