Airbnb Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Allocate refund across payments
Question Given a list of completed payment transactions (each with payment method, date, and amount) and a refund amount R, write an algorithm that is...
Design Connect-N winner detector
Question Design a data structure for the Connect-N game: pieces are dropped into a column (occupying the lowest empty cell). Implement move(column, pl...
Solve palindrome pairs and key path
Question LeetCode 336. Palindrome Pairs; LeetCode 864. Shortest Path to Get All Keys https://leetcode.com/problems/palindrome-pairs/description/ https...
Review Python geodata code
Question You are given a Python codebase that performs geolocation data processing. Conduct a thorough code review: identify readability, correctness,...
Compute split-stay listing pairs
Given a set of Airbnb listings, each with availability represented as a sorted list of day integers, and a requested inclusive date range [S, E], comp...
Generate split-stay pairs efficiently
Given N Airbnb listings, each with available days as integers, and an inclusive requested date range [L, R], return all ordered pairs (X, Y) of distin...
Design mutable sum-tree with fast queries
You're given a rooted, mutable tree. Each leaf node stores an integer value. Each internal node's value equals the sum of its immediate children's val...
Check inorder subsequence and edit tree minimally
Given a binary tree whose nodes store integers and an array target, determine whether target is a subsequence of the tree's inorder traversal (element...
Find minimal property set in neighborhood
You are given a list of properties, each Property(id: int, neighborhood: string, capacity: int). Given a targetNeighborhood (string) and groupSize (in...
Solve and optimize menu combo DP
Given up to N different menu items, each with a unit price, and a list of combo offers where each offer specifies quantities for some items and a tota...
Maximize reward by scheduling jobs
Given n jobs, each with a start time, end time, and reward, choose a subset of non-overlapping jobs to maximize total reward. Return the maximum rewar...
Design menu DP and optimize for three items
You are given a restaurant menu with n single items and m combo offers. Each single item i has a price p[i] (in cents). Each combo j specifies nonnega...
Implement prioritized refund allocation engine
Implement a refund allocation function that takes: (a) a list of payments, each with a unique paymentId, method ∈ {CREDIT, CREDIT_CARD, PAYPAL}, ISO-8...
Find max-score path in weighted DAG
You are given a directed acyclic graph (DAG). Each node v has a score w(v). Each directed edge (u→v) has a nonnegative time cost t(u,v). There is a un...
Maximize tokens from nested crates
You are given n crates, each either locked or unlocked. Each crate i contains: an integer tokens[i]; a list of keys that can unlock other crates; and ...
Maximize path score in DAG
Question Given a weighted directed acyclic graph (DAG) where each node v has a score w(v) and each edge (u→v) has a time cost t(u,v), starting from no...
Verify and modify inorder subsequence
Question Given a binary tree and a sequence of numbers, design an algorithm to check in O(n) time and O( 1) extra space whether the sequence is a subs...
Implement Connect Four game
Question Design and implement the Connect Four game board, player moves, and winner-detection logic. Discuss time/space complexity and possible follow...
Design Connect Four engine
Design and implement a Connect Four game engine. Support a configurable board size (default 6x 7), a drop(column) operation that places a disc obeying...
求解DAG最大得分路径
给定一个有向无环图 G=(V,E)。每个节点 v∈V 有分值 w(v),每条有向边 (u→v) 有时间花费 t(u,v)。起点为名为 start 的节点(w(start)=0),终点为所有名称以下划线“_”开头的节点。只能沿边方向前进。对从 start 到任一终点的可行路径 P,定义 Score(P...