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
Investigate Retail Partner Data Discrepancies
00:00
5 left

Investigate Retail Partner Data Discrepancies

MediumSQL · PostgreSQL

Problem

You are given internal order data, partner-reported totals, and discrepancy reason codes. Write a PostgreSQL query that helps investigate a recurring data discrepancy by returning, for each partner and day, the internal order count, internal revenue, partner-reported revenue, the revenue delta, and a discrepancy status that labels rows as match, underreported, overreported, or missing_report. Only include days where the partner reported data or the internal system has orders.

Schema

retail_partners
ColumnTypeDescription
partner_idPKINTPrimary key for the retail partner
partner_nameVARCHAR(100)Partner display name
partner_reports
ColumnTypeDescription
report_idPKINTPrimary key for the partner report row
partner_idINTForeign key to retail_partners.partner_id
report_dateDATEDate covered by the report
reported_revenueNUMERIC(12,2)Revenue reported by the partner
reported_order_countINTOrder count reported by the partner
internal_orders
ColumnTypeDescription
order_idPKINTPrimary key for the internal order
partner_idINTForeign key to retail_partners.partner_id
order_dateDATEOrder date in the internal system
order_amountNUMERIC(12,2)Revenue from the internal system
discrepancy_reasons
ColumnTypeDescription
reason_idPKINTPrimary key for the discrepancy reason
partner_idINTForeign key to retail_partners.partner_id
reason_dateDATEDate the reason was logged
reason_codeVARCHAR(50)Reason code such as late_feed, mapping_error, or promo_mismatch
Tablesretail_partnerspartner_reportsinternal_ordersdiscrepancy_reasons
Interviewer

Your question is Investigate Retail Partner Data Discrepancies. Start with the requirements and the four 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.