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
Diagnose Model Serving Bottleneck
00:00
5 left

Diagnose Model Serving Bottleneck

MediumPython

Problem

Tell me how you would diagnose and resolve a bottleneck in a model serving pipeline.

Implement a function that analyzes stage latencies and throughput samples from a serving pipeline and returns the stage most likely causing end-to-end slowdown. If multiple stages are tied, choose the earliest stage in the pipeline.

Function Signature

def diagnose_bottleneck(stages, samples):

Input

  • stages: list of stage names in pipeline order
  • samples: list of dicts, each with stage, latency_ms, and throughput_rps

Output

Return the name of the bottleneck stage.

Constraints

  • 1 <= len(stages) <= 10^4
  • 1 <= len(samples) <= 10^5
  • Stage names are unique and appear in samples
  • 1 <= latency_ms <= 10^6
  • 1 <= throughput_rps <= 10^6

Function Signature

def diagnose_bottleneck(stages, samples):
Interviewer

Your question is Diagnose Model Serving Bottleneck. Start with the requirements 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.
CodePython 3
Sign up free to run your codeLog inLn 2
Run your code to see test output here.