MEDIUMVerified Real Interview• Marketplace Data Analyst
Listing Price vs Neighborhood Average
Verified Source:Public Airbnb Interview Debrief
Airbnb wants to identify listings that are priced significantly higher than other homes in the same neighborhood.
Write a query to calculate the price difference between each listing's price and the average price of listings in that same neighborhood. Return:
listing_idneighborhoodpriceprice_diff_vs_neighborhood(rounded to 2 decimal places)
Order results by price_diff_vs_neighborhood descending.
Table:
listings(listing_idINT,neighborhoodVARCHAR,priceDECIMAL)
Execution Sandbox:
Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.
Standard SQL (ANSI)|Ln 1, Col 1(7 lines, 117 chars)
Tab Indent⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.