Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Diagnose Moody's Output Data Mismatches

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Diagnose Moody's Output Data Mismatches. Start with the requirements and the two tables on the right.

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.

Problem

You are given a client reconciliation workflow where a Moody's tool output must be compared against the client's internal data. Write a PostgreSQL query that returns, for each run date and mismatch type, how many records are affected. Classify each record as missing_in_client, missing_in_moodys, value_mismatch, or match based on the available keys and field values.

Use the provided moodys_tool_output and client_internal_data tables. Keep the result ordered by run date and mismatch type so the output is easy to review during investigation.

Schema

moodys_tool_output
ColumnTypeDescription
run_dateDATEMoody's tool run date
record_idINTMoody's record identifier
client_idVARCHAR(20)Client-facing identifier
risk_scoreINTMoody's computed risk score
statusVARCHAR(20)Moody's status value
client_internal_data
ColumnTypeDescription
run_dateDATEClient extract date
record_idINTClient record identifier
client_idVARCHAR(20)Client-facing identifier
risk_scoreINTClient risk score
statusVARCHAR(20)Client status value
Tablesmoodys_tool_outputclient_internal_data
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results