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
Reproducible Analysis for Review
00:00
5 left

Reproducible Analysis for Review

MediumSQL · PostgreSQL

Problem

How would you ensure your analysis is reproducible and easy for others to review?

For this SQL exercise, identify the latest completed run for each analysis that has both a query hash and source snapshot recorded. Include review information when available.

Output

  1. One row per qualifying analysis, with analysis_name, run_id, analyst, query_hash, source_snapshot, reviewer_count, latest_review_status, and latest_reviewed_at.
  2. Exclude incomplete, failed, or non-reproducible runs.
  3. Order by analysis_name ascending, then run_id ascending.

Schema

analysis_runs
ColumnTypeDescription
run_idPKINTUnique analysis execution identifier
analysis_nameVARCHAR(100)Name of the analysis
analystVARCHAR(100)Person who executed the analysis
query_hashVARCHAR(64)Hash identifying the SQL version used
source_snapshotVARCHAR(100)Identifier for the source-data snapshot
executed_atTIMESTAMPTimestamp when the analysis ran
statusVARCHAR(20)Execution status
analysis_reviews
ColumnTypeDescription
review_idPKINTUnique review identifier
run_idINTReviewed analysis run
reviewerVARCHAR(100)Person who reviewed the run
review_statusVARCHAR(20)Review outcome
reviewed_atTIMESTAMPTimestamp of the review
commentVARCHAR(255)Optional reviewer comment
Tablesanalysis_runsanalysis_reviews
Interviewer

Your question is Reproducible Analysis for Review. 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.