Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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
Ensuring Data Accuracy
00:00
5 left

Ensuring Data Accuracy

MediumSQL · PostgreSQL

Problem

How do you ensure accuracy when working with sensitive financial or liability data?

Write a SQL query using the policies, liability_transactions, and ledger_entries tables to identify policies with missing data, null financial amounts, or differences between posted liability and ledger totals. Treat differences of 0.01 or less as accurate.

Output

  1. One row per policy requiring review.
  2. Return policy_id, liability_total, ledger_total, variance, and review_status.
  3. Order by the absolute variance descending, then policy_id ascending.

Schema

policies
ColumnTypeDescription
policy_idPKINTUnique policy identifier
policy_statusVARCHAR(20)Current policy status
product_nameVARCHAR(60)Policy product name
liability_transactions
ColumnTypeDescription
transaction_idPKINTUnique liability transaction identifier
policy_idINTRelated policy identifier
transaction_typeVARCHAR(30)Type of liability transaction
amountDECIMAL(14,2)Transaction amount
transaction_statusVARCHAR(20)Posting status
ledger_entries
ColumnTypeDescription
entry_idPKINTUnique ledger entry identifier
policy_idINTRelated policy identifier
amountDECIMAL(14,2)Ledger amount
entry_statusVARCHAR(20)Ledger posting status
source_systemVARCHAR(30)Originating finance system
Tablespoliciesliability_transactionsledger_entries
Interviewer

Your question is Ensuring Data Accuracy. 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.