Skip to content

Airbnb Coding Questions 2025 - Interview Problems with Solutions

Airbnb coding interview questions with solutions. Practice DSA problems asked in Airbnb SWE interviews 2025.

Airbnb Coding Questions - Complete Problem Set

Section titled “Airbnb Coding Questions - Complete Problem Set”

Practice 25+ Airbnb coding interview questions with solutions. Airbnb focuses on clean code and practical problems.

Find all listings within price range and location radius.

Find available dates for a listing given bookings.

Check if a new booking conflicts with existing ones.

def simple_sentiment(review, positive_words, negative_words):
"""
Simple bag-of-words sentiment
"""
words = review.lower().split()
pos_count = sum(1 for w in words if w in positive_words)
neg_count = sum(1 for w in words if w in negative_words)
if pos_count > neg_count:
return 'positive'
elif neg_count > pos_count:
return 'negative'
return 'neutral'
def aggregate_reviews(reviews):
"""
Aggregate review scores
"""
if not reviews:
return {'avg': 0, 'count': 0}
total = sum(r['rating'] for r in reviews)
return {
'avg': round(total / len(reviews), 2),
'count': len(reviews),
'breakdown': {
5: sum(1 for r in reviews if r['rating'] == 5),
4: sum(1 for r in reviews if r['rating'] == 4),
3: sum(1 for r in reviews if r['rating'] == 3),
2: sum(1 for r in reviews if r['rating'] == 2),
1: sum(1 for r in reviews if r['rating'] == 1),
}
}

Paginate search results ensuring host diversity per page.

from collections import defaultdict, deque
def alien_order(words):
graph = defaultdict(set)
in_degree = {c: 0 for word in words for c in word}
for i in range(len(words) - 1):
w1, w2 = words[i], words[i + 1]
min_len = min(len(w1), len(w2))
if len(w1) > len(w2) and w1[:min_len] == w2[:min_len]:
return ""
for j in range(min_len):
if w1[j] != w2[j]:
if w2[j] not in graph[w1[j]]:
graph[w1[j]].add(w2[j])
in_degree[w2[j]] += 1
break
queue = deque([c for c in in_degree if in_degree[c] == 0])
result = []
while queue:
c = queue.popleft()
result.append(c)
for neighbor in graph[c]:
in_degree[neighbor] -= 1
if in_degree[neighbor] == 0:
queue.append(neighbor)
return ''.join(result) if len(result) == len(in_degree) else ""
def pour_water(heights, volume, k):
for _ in range(volume):
# Try left first
left = k
while left > 0 and heights[left - 1] <= heights[left]:
left -= 1
# If can't go left, try right
if heights[left] >= heights[k]:
right = k
while right < len(heights) - 1 and heights[right + 1] <= heights[right]:
right += 1
if heights[right] >= heights[k]:
heights[k] += 1
else:
heights[right] += 1
else:
heights[left] += 1
return heights
import heapq
def min_meeting_rooms(intervals):
if not intervals:
return 0
intervals.sort(key=lambda x: x[0])
heap = []
for start, end in intervals:
if heap and heap[0] <= start:
heapq.heappop(heap)
heapq.heappush(heap, end)
return len(heap)
from collections import OrderedDict
class LRUCache:
def __init__(self, capacity):
self.cache = OrderedDict()
self.capacity = 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.capacity:
self.cache.popitem(last=False)
def is_valid(s):
stack = []
mapping = {')': '(', '}': '{', ']': '['}
for char in s:
if char in mapping:
top = stack.pop() if stack else '#'
if mapping[char] != top:
return False
else:
stack.append(char)
return not stack

Airbnb Preparation Guide

Complete preparation strategy. View Guide →


Practice booking/search problems for Airbnb!

Last updated: February 2026