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
Verify Policy-to-Claims Cascade
00:00
5 left

Verify Policy-to-Claims Cascade

MediumSQL · PostgreSQL

Problem

How do you query a database to verify that a policy update correctly cascaded to related claims records?

Write a PostgreSQL query that evaluates the latest applied update for each policy against claims that existed when the update was applied. Treat a claim as compliant only when its policy version and limit match the update.

Output

  1. One row per policy with an applied update.
  2. Return policy_id, policy_name, update_id, expected_version, expected_limit, related_claim_count, compliant_claim_count, noncompliant_claim_count, and cascade_status.
  3. Include policies with no qualifying claims, classify them as verified, and order by policy_id.

Schema

policies
ColumnTypeDescription
policy_idPKINTEGERUnique policy identifier
policy_nameVARCHAR(100)Display name of the policy
policy_typeVARCHAR(40)Insurance policy category
policy_updates
ColumnTypeDescription
update_idPKINTEGERUnique policy update identifier
policy_idINTEGERPolicy affected by the update
new_versionINTEGERPolicy version introduced by the update
new_limitNUMERIC(12,2)Policy limit introduced by the update
update_statusVARCHAR(20)Lifecycle status of the update
applied_atTIMESTAMPTZTimestamp when the update was applied
claims
ColumnTypeDescription
claim_idPKINTEGERUnique claim identifier
policy_idINTEGERPolicy associated with the claim
claim_opened_atTIMESTAMPTZTimestamp when the claim was opened
policy_versionINTEGERPolicy version stored on the claim
policy_limitNUMERIC(12,2)Policy limit stored on the claim
claim_statusVARCHAR(20)Current claim status
Tablespoliciespolicy_updatesclaims
Interviewer

Your question is Verify Policy-to-Claims Cascade. 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.