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
ExperiencesCoaching
New
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
Get started
Resolve Trade Ticket Discrepancies
00:00
5 left

Resolve Trade Ticket Discrepancies

MediumSQL · PostgreSQL

Problem

Given a trade ticket containing discrepancies between execution parameters and clearing details, determine the appropriate sequence of actions to resolve the break.

Use the provided execution and clearing tables to identify every field-level discrepancy and assign its remediation action. Sequence actions within each ticket by priority: missing clearing record, quantity, price, venue, then settlement date.

Output

  1. One row per detected discrepancy
  2. Columns: ticket_id, sequence_number, discrepancy_type, recommended_action
  3. Sort by ticket_id, then sequence_number

Schema

trade_tickets
ColumnTypeDescription
ticket_idPKINTUnique trade ticket identifier
execution_venueVARCHAR(20)Venue where the trade executed
execution_quantityINTExecuted quantity
execution_priceNUMERIC(12,4)Executed price
execution_settlement_dateDATEExpected settlement date
trade_statusVARCHAR(20)Execution status
clearing_details
ColumnTypeDescription
clearing_idPKINTUnique clearing record identifier
ticket_idINTTrade ticket referenced by the clearing record
clearing_venueVARCHAR(20)Venue recorded for clearing
clearing_quantityINTQuantity recorded for clearing
clearing_priceNUMERIC(12,4)Price recorded for clearing
clearing_settlement_dateDATESettlement date recorded for clearing
Tablestrade_ticketsclearing_details
Interviewer

Your question is Resolve Trade Ticket Discrepancies. 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.