PracHub
QuestionsLearningGuidesInterview Prep
|Home/Data Manipulation (SQL/Python)/DoorDash

Measure Customers Ordering from Bottom-Quartile Restaurants

Last updated: Aug 7, 2026

Quick Overview

A PostgreSQL interview problem about measuring customers who order from bottom-quartile restaurants. Candidates must define the restaurant population and quartile grain, handle ties and sparse activity, then calculate a distinct-customer share with the correct denominator.

  • easy
  • DoorDash
  • Data Manipulation (SQL/Python)
  • Data Scientist

Measure Customers Ordering from Bottom-Quartile Restaurants

Company: DoorDash

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Technical Screen

# Measure Customers Ordering from Bottom-Quartile Restaurants Write one PostgreSQL SELECT statement or CTE query. Do not create, alter, or modify tables. ## Schema delivery_orders | column | type | |---|---| | delivery_id | integer | | order_place_time | timestamp | | restaurant_id | integer | | customer_id | integer | order_value | column | type | |---|---| | delivery_id | integer | | order_total | numeric | ## Task For each calendar month in 2021, total sales by restaurant and assign restaurants to four sales buckets with NTILE(4), ordered from lowest monthly sales to highest and then by restaurant ID for deterministic ties. Calculate the percentage of distinct monthly customers who placed at least one order from a restaurant in bucket 1. ## Required Output Return order_month, monthly_customers, bottom_quartile_customers, and bottom_quartile_customer_pct rounded to two decimals. Sort by month ascending. ## Constraints - A customer who orders from several bottom-quartile restaurants counts once. - The denominator is all distinct customers ordering that month. - Use the specified restaurant-ID tie break when assigning buckets. ```hint Separate restaurant and customer grains First compute restaurant-month sales and buckets, then join the bucket membership back to customer orders. ```

Quick Answer: A PostgreSQL interview problem about measuring customers who order from bottom-quartile restaurants. Candidates must define the restaurant population and quartile grain, handle ties and sparse activity, then calculate a distinct-customer share with the correct denominator.

Related Interview Questions

  • Find Monthly Top Customers Excluding High-Frequency Users - DoorDash (easy)
  • Calculate the Monthly Share of High-Frequency Customers - DoorDash (easy)
  • Calculate Monthly Restaurant Sales Growth - DoorDash (easy)
  • Measure Daily Late-Order Rates by Delivery Zone - DoorDash (medium)
|Home/Data Manipulation (SQL/Python)/DoorDash

Measure Customers Ordering from Bottom-Quartile Restaurants

DoorDash logo
DoorDash
Jul 27, 2026, 12:00 AM
easyData ScientistTechnical ScreenData Manipulation (SQL/Python)
0
0

Measure Customers Ordering from Bottom-Quartile Restaurants

Write one PostgreSQL SELECT statement or CTE query. Do not create, alter, or modify tables.

Schema

delivery_orders

columntype
delivery_idinteger
order_place_timetimestamp
restaurant_idinteger
customer_idinteger

order_value

columntype
delivery_idinteger
order_totalnumeric

Task

For each calendar month in 2021, total sales by restaurant and assign restaurants to four sales buckets with NTILE(4), ordered from lowest monthly sales to highest and then by restaurant ID for deterministic ties. Calculate the percentage of distinct monthly customers who placed at least one order from a restaurant in bucket 1.

Required Output

Return order_month, monthly_customers, bottom_quartile_customers, and bottom_quartile_customer_pct rounded to two decimals. Sort by month ascending.

Constraints

  • A customer who orders from several bottom-quartile restaurants counts once.
  • The denominator is all distinct customers ordering that month.
  • Use the specified restaurant-ID tie break when assigning buckets.
Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More DoorDash•More Data Scientist•DoorDash Data Scientist•DoorDash Data Manipulation (SQL/Python)•Data Scientist Data Manipulation (SQL/Python)

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.