FastPrepSuperhost Eligibility
Problems/Superhost Eligibility

Superhost Eligibility

Airbnb logoAirbnb● EasyFULLTIMEONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

Source note: The onsite report says to find superhosts using at least three listings, an average-rating threshold, and a requirement that roughly 90% of listings have a review within 30 days. The thresholds are parameters here; match is about 96%.

Each listing record is host rating recent. rating is an integer hundredths score and recent is 1 when the listing has a review in the required recent period, otherwise 0.

Return sorted hosts having at least minListings listings, average rating at least minAverageRating, and at least minRecentPercent percent recent listings.

Function

qualifyingSuperhosts(listings: String[], minListings: int, minAverageRating: int, minRecentPercent: int) → String[]

Examples

Example 1

listings = ["a 490 1","a 480 1","a 470 1","b 500 1","b 500 1"]minListings = 3minAverageRating = 475minRecentPercent = 90return = ["a"]

A has enough listings, average 480, and all are recent; B lacks listings.

Example 2

listings = ["x 500 1","x 500 0","x 500 1"]minListings = 3minAverageRating = 450minRecentPercent = 90return = []

Only two thirds of X's listings are recent.

Example 3

listings = ["z 400 1"]minListings = 1minAverageRating = 400minRecentPercent = 100return = ["z"]

All inclusive thresholds are met exactly.

Constraints

  • 1 <= listings.length <= 2 * 10^5.
  • Ratings and thresholds are nonnegative integers; recent is 0 or 1.
  • 0 <= minRecentPercent <= 100.

More Airbnb problems

  • Credit Accounts with Scheduled TransfersOA · Seen Oct 2026
  • Decode and Store StringsPHONE SCREEN · Seen Oct 2026
  • Parcel Attribute Store with TTLOA · Seen Oct 2026
All Airbnb interview questionsSee Airbnb hiring insights
Saved
class Solution {
    public String[] qualifyingSuperhosts(String[] listings, int minListings, int minAverageRating, int minRecentPercent) {
        // Write your solution here.
    }
}
Checking account…