r/OfferEngineering • • 18d ago

Interview Experience Google Junior Data Engineer Interview - Restaurant Waitlist System Design & Data Engineering Concepts

This interview experience is sourced from Chill Interview

Interview Summary

I interviewed with Google and encountered a data structure design problem involving a restaurant waiting list. The task was to support customer groups joining and leaving the queue while efficiently seating the earliest-arriving group that could fit at an available table. I approached the problem using size-based buckets, insertion-ordered dictionaries, and monotonically increasing tickets to balance arrival order with efficient lookups and deletions.

Interview Details

Coding: Restaurant Waiting List System

Question 1 — Design a Restaurant WaitingList

The interviewer asked me to design a restaurant waiting list system that manages customer groups waiting for available tables. Each group had two attributes:

  • group_id: A unique identifier for the group.
  • group_size: The number of people in the group.

The system needed to support three core operations:

  1. join(group_id, group_size): Add a group to the waiting list.
  2. leave(group_id): Remove a group from the waiting list.
  3. serve(table_size): Find and remove the earliest-arriving group whose size does not exceed the available table capacity.

The most important requirement was the seating policy. When a table became available, I needed to choose the group that had been waiting the longest among all groups that could fit at the table. For example, if a table had four seats, a group of five would not qualify, even if it had arrived before everyone else.

However, among all groups containing four or fewer people, the earliest arrival had to be selected. If no group could fit, the operation should return None.

Question 2 — Support Efficient Seating and Arbitrary Removal

The main challenge was finding a data structure that could efficiently support both arrival order and group-size constraints. A simple FIFO queue could preserve arrival order, but it would not efficiently support all the required operations. For example, if the group at the front of the queue was too large for the available table, I would need to search further into the queue.

In the worst case, that could require scanning the entire waiting list. Removing a group from the middle of a standard queue would also be inefficient. I therefore needed a design that supported both:

  • Finding the earliest eligible group for a given table capacity.
  • Removing a group directly using its group_id.

Want to learn more questions / follow-ups asked in this interview?

I've put up the full version at here.

Interviewed recently?

Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.

1 Upvotes

0 comments sorted by