Airbnb Senior Software Engineer TPS Round
- Posted
- 18 Mar 2026
386 reads
Summary
I participated in a Senior Software Engineer TPS round at Airbnb, where I was presented with a challenging coding problem involving optimal property selection based on capacity and number of properties.
How it went
Helping the Leetcode Community!
For a given neighborhood and group size G, choose a subset of properties such that:
- Total capacity >= Group_size
- Among all such subsets, choose the one with minimum number of properties
- If multiple subsets use the same number of properties, choose the one with minimum total capacity
- Return the selected property IDs
- If impossible, return -1
Sample Input:
function(List<Property> properties, int group_size, String neighbourHood)
-> return type: List<Integer> property_ids
Property1 : {
Id:1,
Capacity: 5,
NeighborHood: "downtown"
}
Property2 : {
Id:2,
Capacity: 3,
NeighborHood: "downtown"
}
Property3 : {
Id:3,
Capacity: 1,
NeighborHood: "downtown"
}
Property4 : {
Id:4,
Capacity: 3,
NeighborHood: "uptown"
}
Property5 : {
Id:5,
Capacity: 2,
NeighborHood: "uptown"
}
Questions asked (1)
- 01
Optimal Property Selection for Group Size
Data Structures & Algorithms
For a given neighborhood and group size G, choose a subset of properties such that: - Total capacity >= Group_size - Among all such subsets, choose the one with minimum number of properties - If multiple subsets use the same number of properties, choose the one with minimum total capacity - Return the selected property IDs - If impossible, return -1Sample Input: function(List<Property> properties, int group_size, String neighbourHood) -> return type: List<Integer> property_ids Property1 : { Id:1, Capacity: 5, NeighborHood: "downtown" } Property2 : { Id:2, Capacity: 3, NeighborHood: "downtown" } Property3 : { Id:3, Capacity: 1, NeighborHood: "downtown" } Property4 : { Id:4, Capacity: 3, NeighborHood: "uptown" } Property5 : { Id:5, Capacity: 2, NeighborHood: "uptown" }