Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
SQL for Sellers With Degraded Fulfillment
00:00
5 left

SQL for Sellers With Degraded Fulfillment

HardSQL · PostgreSQL

Problem

Whatnot Operations needs to identify top-performing sellers whose shipping fulfillment has worsened recently. Write a PostgreSQL query comparing the last 30 days with the preceding 30 days, using August 29, 2026 as the reporting date.

Requirements

  1. Calculate each seller's on-time shipping fulfillment rate, where an order is fulfilled when shipped_at is on or before promised_ship_date.
  2. Define top-performing sellers as those with at least 2 preceding-period orders and a preceding fulfillment rate of at least 90%.
  3. Return sellers with at least 2 recent orders whose fulfillment rate declined by at least 15 percentage points.
  4. Return both period rates, order counts, and the decline, ordered by decline descending.

Schema

sellers
ColumnTypeDescription
seller_idPKINTUnique seller identifier
seller_nameVARCHAR(100)Seller display name
orders
ColumnTypeDescription
order_idPKINTUnique order identifier
seller_idINTSeller who created the order
order_dateDATEDate the order was placed
promised_ship_dateDATERequired ship-by date
shipments
ColumnTypeDescription
shipment_idPKINTUnique shipment identifier
order_idINTOrder associated with the shipment
shipped_atDATEActual shipment date
Tablessellersordersshipments
Interviewer

Your question is SQL for Sellers With Degraded Fulfillment. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.