Community Question Bundle
The Airbnb System-Fit Questions I Prepped
Free set: four coding questions I rehearsed for a marketplace company's frontend loop. Every prompt is grounded in a real booking-domain object, because the interviewers grade modeling choices as much as code.
The Airbnb System-Fit Questions I Prepped
Free set: four coding questions I rehearsed for a marketplace company's frontend loop. Every prompt is grounded in a real booking-domain object, because the interviewers grade modeling choices as much as code.
By @mianair
January 27, 2026
·
Updated May 18, 2026
647 views
9
4.3 (12)
Write a deepClone(value) that handles plain objects, arrays, Date, RegExp, and circular references. The interviewer's twist: JSON.parse(JSON.stringify(x)) is not allowed. Why?
Sample run
Sample run with cycles and special types:
const a = { d: new Date('2026-01-01'), tag: /foo/i };
a.self = a;
const b = deepClone(a);
// b.d !== a.d but b.d.getTime() === a.d.getTime()
// b.tag !== a.tag but b.tag.source === 'foo' and b.tag.flags === 'i'
// b.self === b (self-reference preserved via WeakMap, no infinite recursion)
deepClone(42); // 42, primitives returned as-isBuild a buildBookingId(hostId, checkIn) that produces a stable, human-scannable id like bk_host_42_20260615_8x2k4t, plus an isPastCheckIn(reservation, now) helper. The interviewer asked why I picked a date prefix in the id.
Sample run
buildBookingId(42, '2026-06-15') returns something like 'bk_42_20260615_8x2k4t': host id, YYYYMMDD check-in, 6 base36 random chars. isPastCheckIn({ checkIn: '2025-01-01' }, new Date('2026-05-10')) returns true. isPastCheckIn({ checkIn: '2026-12-01' }, new Date('2026-05-10')) returns false.
Given a list of reservations and a date range, return the nights inside the range that are NOT covered by a reservation. Half-open intervals: checkOut itself is available. Mine had an off-by-one bug on the first pass.
Sample run
Sample run on a half-open range:
findAvailableNights(
[{ checkIn: '2026-06-10', checkOut: '2026-06-12' }],
'2026-06-09',
'2026-06-13'
);
// -> ['2026-06-09', '2026-06-12']
// Nights 10 and 11 are blocked. Night 12 (the checkOut night) is available again,
// which is the off-by-one I missed on my first pass.
findAvailableNights([], '2026-06-09', '2026-06-11');
// -> ['2026-06-09', '2026-06-10']Given a list of { rating } reviews where rating is supposed to be 1-5, return { count, avg, distribution }. The interviewer specifically asked: how do you handle malformed reviews (non-integer, out of range)?
Sample run
summarizeReviews([{ rating: 5 }, { rating: 4 }, { rating: 7 }, { rating: '5' }]) returns { count: 2, avg: 4.5, distribution: { 1: 0, 2: 0, 3: 0, 4: 1, 5: 1 } }: the out-of-range 7 and the string '5' are dropped silently. summarizeReviews([]) returns { avg: null, count: 0, distribution: {} }: null keeps "no reviews" distinct from "rating of zero".
