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
SQL for Data Quality
00:00
5 left

SQL for Data Quality

MediumSQL · PostgreSQL

Problem

How would you use SQL to investigate data issues like false positives?

Use the provided transaction, fraud alert, and merchant data. Focus on reviewed alerts with a resolved outcome and identify merchant and alert-type combinations where at least half of reviewed alerts were false positives.

Output

  1. One row per qualifying merchant and alert type.
  2. Include merchant_id, merchant_name, alert_type, reviewed_alerts, false_positive_count, and false_positive_rate_pct.
  3. Sort by false-positive rate descending, reviewed alert count descending, and merchant name ascending.

Schema

transactions
ColumnTypeDescription
transaction_idPKINTUnique transaction identifier
merchant_idINTMerchant associated with the transaction
transaction_dateDATEDate the transaction occurred
amountNUMERIC(12,2)Transaction amount
fraud_alerts
ColumnTypeDescription
alert_idPKINTUnique fraud alert identifier
transaction_idINTTransaction that generated the alert
alert_typeVARCHAR(50)Category of fraud alert
review_statusVARCHAR(30)Current review state of the alert
outcomeVARCHAR(30)Resolved alert classification
merchants
ColumnTypeDescription
merchant_idPKINTUnique merchant identifier
merchant_nameVARCHAR(120)Merchant display name
merchant_regionVARCHAR(50)Merchant operating region
Tablestransactionsfraud_alertsmerchants
Interviewer

Your question is SQL for Data Quality. 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.