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
Python Backend Performance Bottlenecks
00:00
5 left

Python Backend Performance Bottlenecks

MediumSQL · PostgreSQL

Problem

What are the common performance bottlenecks you have encountered in Python-based backend systems?

For this SQL exercise, analyze backend request logs and identify endpoints that show consistently high response times. Include only endpoints with at least two requests and an average duration of at least 300 milliseconds.

Output

  1. One row per qualifying endpoint with endpoint_name, request_count, average_duration_ms, error_count, and error_rate_pct.
  2. Sort by average duration descending, then endpoint name ascending for ties.

Schema

endpoints
ColumnTypeDescription
endpoint_idPKINTUnique endpoint identifier
endpoint_nameVARCHAR(100)Readable endpoint name
methodVARCHAR(10)HTTP method
pathVARCHAR(200)HTTP route path
request_logs
ColumnTypeDescription
log_idPKINTUnique request log identifier
endpoint_idINTReferenced endpoint identifier
requested_atTIMESTAMPRequest timestamp
duration_msINTRequest duration in milliseconds
status_codeINTHTTP response status code
Tablesendpointsrequest_logs
Interviewer

Your question is Python Backend Performance Bottlenecks. 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.