HomeBlog › Airbnb Coding Interview Questions

Airbnb Coding Interview Questions: Real-World & Multi-Part

Airbnb favors practical problems that build on themselves over whiteboard puzzles, and it weights culture heavily. Five worked problems and the full loop.

Airbnb's coding interview has a distinct style: practical, multi-part problems that start simple and grow as you go, often resembling real product features rather than abstract puzzles. Interviewers care about working, readable code you can extend live — and Airbnb famously weights its culture/values round as heavily as the technical ones.

This guide covers five representative Airbnb problems with worked Python, the build-on-it format, and the habits — clean abstractions, testing as you go — that match how Airbnb actually grades.

The full interview process

StageFormatNotes
Recruiter screen30 minBackground, values fit, logistics
Technical phone screen45-60 minA practical, often multi-part problem
Onsite coding (2)45-60 min eachBuild-on-it problems; readable code
System / product design45 minDesign a real Airbnb-style feature
Culture / values (2)45 min eachCore values; weighted heavily

Problem 1: Alien Dictionary (topological sort)

Question: Given a list of words sorted lexicographically by an unknown alphabet, derive a valid character order.

Build a graph from adjacent word pairs (the first differing character gives an edge), then topologically sort. A classic Airbnb problem because it's multi-step and easy to extend.

from collections import defaultdict, deque
def alienOrder(words):
    graph = defaultdict(set)
    indeg = {c: 0 for w in words for c in w}
    for a, b in zip(words, words[1:]):
        for x, y in zip(a, b):
            if x != y:
                if y not in graph[x]:
                    graph[x].add(y); indeg[y] += 1
                break
        else:
            if len(a) > len(b): return ""   # invalid: prefix after longer word
    q = deque([c for c in indeg if indeg[c] == 0])
    out = []
    while q:
        c = q.popleft(); out.append(c)
        for nxt in graph[c]:
            indeg[nxt] -= 1
            if indeg[nxt] == 0: q.append(nxt)
    return "".join(out) if len(out) == len(indeg) else ""

Time O(total characters), space O(unique chars + edges). The two traps Airbnb checks: the invalid prefix case (["abc", "ab"]) and detecting a cycle (output shorter than the alphabet means a contradiction). Handle both explicitly.

Problem 2: Find Median from Data Stream (two heaps)

Question: Design a structure that supports adding numbers and returning the median of all numbers so far.

Two heaps: a max-heap for the lower half and a min-heap for the upper half, kept balanced in size. The median is the top of one heap, or the average of both tops.

import heapq
class MedianFinder:
    def __init__(self):
        self.lo = []  # max-heap (negated)
        self.hi = []  # min-heap
    def addNum(self, num):
        heapq.heappush(self.lo, -num)
        heapq.heappush(self.hi, -heapq.heappop(self.lo))
        if len(self.hi) > len(self.lo):
            heapq.heappush(self.lo, -heapq.heappop(self.hi))
    def findMedian(self):
        if len(self.lo) > len(self.hi):
            return -self.lo[0]
        return (-self.lo[0] + self.hi[0]) / 2

addNum is O(log n), findMedian is O(1). The balancing trick — push to lo, move lo's max to hi, rebalance — keeps the two halves correct without re-sorting. This is exactly the kind of design-y problem Airbnb favors.

Problem 3: Word Search (backtracking)

Question: Given a grid of letters and a word, return true if the word exists as a path of adjacent cells (no reuse).

DFS with backtracking from each starting cell. Mark cells visited as you descend and restore them as you return — a natural multi-part problem (Airbnb often extends it to Word Search II with a trie).

def exist(board, word):
    rows, cols = len(board), len(board[0])
    def dfs(r, c, i):
        if i == len(word): return True
        if r < 0 or c < 0 or r >= rows or c >= cols or board[r][c] != word[i]:
            return False
        tmp, board[r][c] = board[r][c], '#'
        found = (dfs(r+1,c,i+1) or dfs(r-1,c,i+1) or
                 dfs(r,c+1,i+1) or dfs(r,c-1,i+1))
        board[r][c] = tmp
        return found
    return any(dfs(r, c, 0) for r in range(rows) for c in range(cols))

Time O(rows×cols×4^L) worst case for word length L; space O(L) recursion. The backtracking restore (board[r][c] = tmp) is the line candidates forget. Airbnb's extension is searching many words at once — mention a trie if they push.

Problem 4: LRU Cache (design)

Question: Design a Least-Recently-Used cache with O(1) get and put.

A practical design Airbnb uses to test clean abstractions: hash map plus recency order. The follow-ups (TTL, thread-safety) are where Airbnb's build-on-it style shows.

from collections import OrderedDict
class LRUCache:
    def __init__(self, capacity):
        self.cache = OrderedDict()
        self.cap = capacity
    def get(self, key):
        if key not in self.cache: return -1
        self.cache.move_to_end(key)
        return self.cache[key]
    def put(self, key, value):
        if key in self.cache: self.cache.move_to_end(key)
        self.cache[key] = value
        if len(self.cache) > self.cap:
            self.cache.popitem(last=False)

O(1) get and put. Airbnb's twist is usually a follow-up: "add a time-to-live" or "make it thread-safe." Keep your class boundaries clean so extending it live is a small change, not a rewrite — that extensibility is the signal.

Patterns Airbnb asks most

PatternFrequencyNote
Graphs & topological sort~20% of loopsAlien dictionary, course schedule
Backtracking / DFS~20%Word search, combinations, board games
Object-oriented design~20%LRU, file system, collaborative features
Heap / two-heap design~15%Median stream, top-k
Hash map / strings~15%Grouping, parsing, counting
Dynamic programming~10%Sequence and grid problems

Common pitfalls specific to Airbnb

A 4-week prep plan for an Airbnb loop

  1. Week 1: Graphs, backtracking, and object-oriented design — Airbnb's core. Practice extending each solution with a follow-up.
  2. Week 2: Two-heap and hash-map design problems; drill clean class boundaries you can grow live.
  3. Week 3: Product/system design with the cheat sheet, framed around real features (booking, search, messaging).
  4. Week 4: Values-round stories — one per Airbnb core value — and a solo mock.

Write clean, extensible code with live AI support

CoPilot Interview surfaces structured solutions in about 4 seconds during real Zoom and Teams calls. Free for Windows and macOS, invisible on screen-share.

Download free

FAQ

What's distinctive about Airbnb's coding interview?

Practical, multi-part problems that build on themselves rather than abstract whiteboard puzzles, an emphasis on readable and extensible code, and a culture/values round that's weighted as heavily as the technical interviews.

How important is the Airbnb culture interview?

Very - Airbnb is known for weighting its core-values rounds heavily, and a strong technical performance can still result in a no-hire if the values interviews go poorly. Prepare specific stories tied to their values.

What problems does Airbnb ask?

Practical, extensible ones: alien dictionary, word search, find median from a data stream, LRU cache, and file-system or collaborative-feature designs. Expect follow-ups that grow the original problem.

Does Airbnb do whiteboard trick questions?

Less than most. Airbnb favors problems that resemble real product features and that you extend live, so clean abstractions and testing as you go matter more than spotting a single clever trick.

Can CoPilot Interview help me prepare for Airbnb?

Yes. It returns clean, idiomatic solutions with Big-O and object-oriented structure so you can rehearse the readable, extensible style Airbnb rewards. Follow Airbnb's interview rules during the live round.