← IMC Interview Insights

IMC·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

IMC system design round for a software engineer role. The whole thing was basically one big question about building a hotel booking system in memory, no database allowed. Decent problem but it goes deep fast.

Questions Asked (1)

Q1

Design a hotel booking system using only in-memory data structures. It needs to support adding hotels and room types, searching availability over a date range, creating and canceling bookings, and preventing double-bookings under concurrent load.

System DesignData ModelingTechnical Trade-offs
Author's notes

This one sprawls.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design the core data model with hotels, room types, and bookings, focusing on efficient availability checks and concurrency control. Use in-memory structures like hash maps and interval trees, and discuss trade-offs between locking granularity and throughput.

Pro tip: Emphasize that concurrency control must be designed from the start, not bolted on; propose a locking strategy that balances correctness and performance, and mention how you would test it under load.

1. Clarify Requirements and Assumptions

Ask about expected scale (number of hotels, rooms, bookings), concurrency level, and whether bookings can span multiple room types. Confirm that all data is in-memory and persistence is out of scope.

2. Design Data Model

Define classes for Hotel, RoomType, and Booking. Use unique IDs and store hotels in a hash map. For each room type, maintain a data structure to track booked date ranges, such as an interval tree or a sorted list of bookings.

3. Implement Availability Search

For a given date range and room type, check for overlapping bookings. Use efficient data structures to avoid scanning all bookings, e.g., interval tree or segment tree, and discuss time complexity.

4. Handle Booking Creation and Cancellation

On booking, validate availability and atomically insert the booking. On cancellation, remove the booking and free the dates. Ensure operations are idempotent and handle edge cases like invalid dates.

5. Address Concurrency and Double-Booking

Use fine-grained locking per room type or optimistic concurrency with versioning. Discuss trade-offs: coarse locks are simple but limit throughput; fine-grained locks improve concurrency but add complexity. Mention deadlock avoidance and testing strategies.

Key Points to Mention

  • Choice of data structures for availability (e.g., interval tree, segment tree, or sorted list) and their time/space trade-offs.
  • Concurrency control mechanisms: pessimistic locking (e.g., per room type) vs. optimistic locking (versioning) and their impact on throughput.
  • Atomicity of booking operations: ensuring check-and-book is atomic to prevent double-booking.
  • Handling cancellations and potential memory fragmentation or cleanup of expired bookings.
  • Scalability considerations: sharding by hotel or room type, and load balancing.
  • Testing strategy for concurrency: stress tests, race condition detection, and correctness under high load.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.