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
Rank Fulfillment Centers by Speed
00:00
5 left

Rank Fulfillment Centers by Speed

MediumSQL · PostgreSQL

Problem

Write a query using window functions to rank fulfillment centers by their average package processing speed per hour at Foundation Robotics Labs.

Use completed processing records with non-null package counts and positive processing durations. Exclude centers without a valid completed processing record.

Output

  1. One row per eligible fulfillment center with center_name, average_packages_per_hour, and speed_rank.
  2. Rank centers from fastest to slowest; centers with equal averages share a rank.
  3. Order by speed_rank ascending, then center_id ascending.

Schema

fulfillment_centers
ColumnTypeDescription
center_idPKINTUnique fulfillment center identifier
center_nameVARCHAR(100)Fulfillment center name
package_processing
ColumnTypeDescription
processing_idPKINTUnique processing record identifier
center_idINTFulfillment center associated with the record
packages_processedINTNumber of packages processed
processing_hoursNUMERIC(8,2)Hours spent processing the packages
statusVARCHAR(20)Processing record status
Tablesfulfillment_centerspackage_processing
Interviewer

Your question is Rank Fulfillment Centers by Speed. Start with the requirements and the two 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.