Sanjaay Gowda T S
Commonwealth Bank of Australia practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Reconstruct a statement as of its cutoff

SQL & data engineeringHardConcept

Original practice scenario inspired by Commonwealth Bank of Australia's public business context; this is not a reported interview question or a description of its internal systems. A synthetic account ledger has booking_time, effective_day, amount_cents, and correction relationships. Explain how to produce a reproducible statement for a historical cutoff without accidentally including later-known corrections.

Written for independent practice using company context; this is not a verified question from a company interview.

A REASONED APPROACH

Model answer.

Specify whether the statement represents knowledge at publication or a later restatement. Booking time controls what was known; effective day controls the business period to which an entry belongs.

Work through it

  1. Filter entries to booking_time at or before the recorded statement cutoff, then apply the documented effective-day range. Keep both timestamps in the audit trail.
  2. Aggregate signed ledger entries, treating reversals and corrections according to their explicit relationships. Do not silently overwrite original posted amounts.
  3. Persist statement parameters and source watermark. Test a late correction effective in the earlier month, an exact cutoff boundary, and a reversal arriving after publication.

Tradeoffs to discuss

  • Immutable statement snapshots improve reproducibility but require a separate restatement process when later information changes the period.

Common pitfalls

  • Filtering only by effective day leaks later knowledge into the original statement.
  • Summing both an overwritten value and its adjustment can double-count the correction.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub