Code RoomBooking clash detection
EasyPrep Room Coding #653

Booking clash detection

CodingAlgorithms & data structuresEntry–Mid~10 min

A gym studio's confirmed bookings are half-open time slots [start, end) in minutes, pairwise non-overlapping but stored in no particular order. A new request [start, end) arrives. Return True if the request clashes with any existing booking. Sharing only an endpoint — a class that ends exactly when another begins — is not a clash. Example: bookings [[60,120],[150,180]] with request [120,150] is False.

Implement
booking_conflicts(bookings: list[list[int]], request: list[int]) → bool
Examples
in[[[60,120],[150,180]],[120,150]]outfalse
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 10 min
InputExpectedGot
[[[60,120],[150,180]],[120,150]]falsenot run yetsample