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
HackerRank Python Coding Challenge
00:00
5 left

HackerRank Python Coding Challenge

MediumSQL · PostgreSQL

Problem

How would you handle three coding questions on HackerRank where you have to use Python?

For the SQL version, use the supplied HackerRank assessment tables to summarize candidates who attempted all three required questions. Include candidates even when some submissions failed, and treat multiple submissions to the same question as one attempted question.

Output

  1. One row per candidate who attempted all three required questions.
  2. Return candidate_name, attempted_questions, solved_questions, and average_passed_runtime_ms.
  3. Sort by solved_questions descending, average passed runtime descending with NULL values last, then candidate_id ascending.

Schema

candidates
ColumnTypeDescription
candidate_idPKINTUnique candidate identifier
candidate_nameVARCHAR(100)Candidate display name
emailVARCHAR(150)Candidate email address
questions
ColumnTypeDescription
question_idPKINTUnique question identifier
question_numberINTQuestion position in the assessment
titleVARCHAR(150)Question title
submissions
ColumnTypeDescription
submission_idPKINTUnique submission identifier
candidate_idINTCandidate who submitted the solution
question_idINTQuestion being answered
statusVARCHAR(20)Submission result, such as Passed or Failed
runtime_msINTExecution runtime in milliseconds
Tablescandidatesquestionssubmissions
Interviewer

Your question is HackerRank Python Coding Challenge. 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.