Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Clean and Reconcile Bank Exports

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

Your question is Clean and Reconcile Bank Exports. Start with the requirements and the two 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

Given a raw export of transactional data with mismatched formatting, use formulas to clean, align, and reconcile the dataset against a bank settlement report at Rippling.

Write a PostgreSQL query using raw_transactions and bank_settlements. Normalize references, safely parse dates and amounts, match records, and classify reconciliation differences.

Output

  1. One row per matched or unmatched record pair, with transaction ID, settlement ID, normalized reference, cleaned transaction date, cleaned amount, settlement date, settlement amount, and reconciliation status.
  2. Include unmatched records from either source.
  3. Order by transaction ID, followed by unmatched settlements in numeric settlement-ID order.

Schema

raw_transactions
ColumnTypeDescription
raw_transaction_idPKINTIdentifier from the raw transaction export
raw_dateVARCHAR(20)Transaction date in inconsistent text formats
raw_amountVARCHAR(30)Transaction amount containing currency symbols or inconsistent formatting
raw_referenceVARCHAR(40)Raw transaction reference
bank_settlements
ColumnTypeDescription
settlement_idPKVARCHAR(20)Bank settlement identifier
settlement_dateDATEDate reported by the bank
settlement_amountNUMERIC(14,2)Settled monetary amount
referenceVARCHAR(40)Reference from the bank settlement report
Tablesraw_transactionsbank_settlements
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results