Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Commission Calculation Verification
00:00
5 left

Commission Calculation Verification

MediumSQL · PostgreSQL

Problem

What steps do you take to verify the integrity and accuracy of a commission calculation before sending it to payroll at Adobe?

Using the provided Adobe commission tables, write one PostgreSQL query that validates active representatives' April 2025 commission records. Include representatives with no eligible deals so the output also exposes missing activity.

Output

  1. One row per active representative, ordered by rep_name, then rep_id.
  2. Return rep_name, eligible_deal_count, eligible_sales, expected_commission, recorded_commission, variance, and verification_status.
  3. Include closed deals dated in April 2025 only. Flag missing rates, missing recorded commissions, negative amounts, mismatched totals, and representatives with no eligible deals.

Schema

representatives
ColumnTypeDescription
rep_idPKINTUnique sales representative identifier
rep_nameVARCHAR(100)Sales representative name
planVARCHAR(30)Commission plan assigned to the representative
is_activeBOOLEANWhether the representative is active for payroll processing
commission_deals
ColumnTypeDescription
deal_idPKINTUnique deal identifier
rep_idINTRepresentative responsible for the deal
close_dateDATEDeal close date
deal_statusVARCHAR(20)Deal lifecycle status
amountNUMERIC(12,2)Commissionable deal amount
recorded_commissionNUMERIC(12,2)Commission currently recorded for payroll
commission_rates
ColumnTypeDescription
planPKVARCHAR(30)Commission plan name
commission_rateNUMERIC(5,4)Commission rate as a decimal fraction
Tablesrepresentativescommission_dealscommission_rates
Interviewer

Your question is Commission Calculation Verification. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.