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
End-to-End Take-Home Case Study
00:00
5 left

End-to-End Take-Home Case Study

HardSQL · PostgreSQL

Problem

Explain how you would approach a take-home case study that includes data prep, defining metrics, building and evaluating a model, and presenting assumptions to management.

Use the provided observations, predictions, and assumptions data to demonstrate the SQL portion of that approach. Include only accepted, sufficiently complete observations and the latest prediction for each record and model version.

Output

  1. One row per model version and segment with the valid record count, mean absolute error, root mean squared error, model rank, and prior-model error.
  2. Include the total assumption count and high-confidence assumption count on every row.
  3. Order by segment ascending, then model version descending.

Schema

case_observations
ColumnTypeDescription
record_idPKINTUnique observation identifier
observed_atDATEObservation date
segmentVARCHAR(30)Evaluation segment
actual_valueDECIMAL(12,2)Observed target value
feature_valueDECIMAL(12,2)Feature value required for modeling
source_statusVARCHAR(20)Source validation status
model_predictions
ColumnTypeDescription
prediction_idPKINTUnique prediction event identifier
record_idINTReferenced observation identifier
model_versionVARCHAR(20)Model version that produced the prediction
predicted_valueDECIMAL(12,2)Predicted target value
scored_atTIMESTAMPPrediction timestamp
model_assumptions
ColumnTypeDescription
assumption_idPKINTUnique assumption identifier
assumption_nameVARCHAR(60)Name of an analysis assumption
assumption_valueDECIMAL(12,2)Illustrative numeric assumption value
confidence_levelVARCHAR(20)Confidence assigned to the assumption
Tablescase_observationsmodel_predictionsmodel_assumptions
Interviewer

Your question is End-to-End Take-Home Case Study. 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.