Airbnb logo

Airbnb Software Engineer System Design Questions

47 practice questions for Airbnb Software Engineer interviews

Airbnb software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

All Roles Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer

No verified questions yet for Airbnb.

system design Senior api design #1

1. [OA] Design Twitter-style feed for Airbnb experiences

Building a modern socially-influenced experience for Airbnb is vital to trawl through user-generated content from experiences (such as reviews and photos). This involves creating a class-based structure for managing a user's feed aligned with their interests.
Problem statement: implement a class to handle a simple Twitter-like feed that allows users to create a post, display the feed, and follow other users.
- class TwitterFeed:
- def __init__(self): - Initializes the object.
- def post(self, user_id: int, post: str): - Creates a new post for the specified user.
- def follow(self, follower_id:int, followee_id:int): - Allows one user to follow another.
- def get_feed(self, user_id: int) -> List[str]: - Retrieve the latest n posts from followed users.
Example 1:
Input:
twitter = TwitterFeed()
twitter.post(1, "Looking for cozy places in Paris!")
twitter.post(2, "Trying out local cuisine.")
twitter.follow(1, 2)
print(twitter.get_feed(1)) // returns ["Trying out local cuisine."]
Example 2:
Input:
twitter.follow(1, 3)
print(twitter.get_feed(1)) // returns [] since user 3 has no posts.
Constraints:
- 1 <= user_id <= 10^4
- posts per user = 100
- followed users = 50
system design Senior caching #2

2. [OA] LRU Cache — Implement caching for Airbnb property listings

Airbnb needs to optimize its API by implementing a caching mechanism for property listings to reduce database load and improve response time.
Problem statement: Implement an LRU (Least Recently Used) cache with a specified capacity. The cache should support get(key) and put(key, value) operations.
- class LRUCache:
- def __init__(self, capacity: int): - Initializes the LRUCache with the maximum capacity.
- def get(self, key: int) -> int: - Returns the value of the key if the key exists in the cache, otherwise return -1.
- def put(self, key: int, value: int): - Update the value of the key if it exists, otherwise add the key-value pair to the cache. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.
Example 1:
Input:
cache = LRUCache(2)
cache.put(1, 1)
cache.put(2, 2)
cache.get(1) // returns 1
cache.put(3, 3) // evicts key 2
cache.get(2) // returns -1 (not found)
Example 2:
Input:
cache.put(4, 4) // evicts key 1
cache.get(1) // returns -1 (not found)
cache.get(3) // returns 3
cache.get(4) // returns 4
Constraints:
- 1 <= capacity <= 3000
- 0 <= key <= 10^4
- 0 <= value <= 10^4

Related Airbnb Software Engineer interview prep

Start practicing Airbnb questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free