Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Dynamic Fee Reconciliation in Sheets

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Dynamic Fee Reconciliation in Sheets. Start with the requirements and the three tables on the right.

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.

Problem

Create a dynamic reconciliation model in Google Sheets that highlights anomalies where the payment processor fee deviates from the contract rate at Rippling.

Write a PostgreSQL query that identifies payment records with fee mismatches, missing fees, or no applicable contract rate.

Output

  1. One row per reconciliation anomaly.
  2. Include payment, account, processor, contract rate, expected fee, actual fee, deviation, and anomaly type.
  3. Sort by payment date ascending, then payment ID ascending.

Schema

rippling_accounts
ColumnTypeDescription
account_idPKINTRippling customer account identifier
account_nameVARCHAR(120)Rippling customer account name
processor_contracts
ColumnTypeDescription
contract_idPKINTPayment processor contract identifier
account_idINTRippling account covered by the contract
processorVARCHAR(40)Payment processor named in the contract
contract_rate_pctDECIMAL(6,3)Contract fee percentage
effective_fromDATEContract start date
effective_toDATEContract end date, null for an active contract
payment_transactions
ColumnTypeDescription
payment_idPKINTPayment transaction identifier
account_idINTRippling account associated with the payment
processorVARCHAR(40)Processor that handled the payment
payment_dateDATEDate the payment was processed
gross_amountDECIMAL(12,2)Payment amount before processor fees
processor_feeDECIMAL(12,2)Fee charged by the payment processor
Tablesrippling_accountsprocessor_contractspayment_transactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results