airbnb logo
Airbnb· Senior Software Engineer

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)

  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 -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"
    }
    

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Airbnb recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!