The interview problem

Practice prompt

An AI-generated operations report differs from the customer's source total by a few cents. Determine whether the mismatch is a model error, numeric representation or a rounding-policy difference.

Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.

1. Scope and assumptions

Treat this as technical reconciliation, with the customer's authorized owner defining the accounting rule. Do not assume round-half-up, line-level rounding or binary floating-point is acceptable simply because a library defaults to it.

2. Worked approach

exact source decimals
  → versioned calculation rule
  → line/total rounding
  → reconciliation
  → report

Trace exact source decimal strings, currency/scale, line calculations and aggregation order. Record whether rounding applies to each line or only the final total and which tie rule is required. Use an exact decimal representation for the agreed computation and keep source values separate from display strings.

Generate the report from verified structured totals; the language model explains the numbers rather than recalculating them freely. Version the calculation policy and retain a line-level reconciliation showing source, normalized value and rounded contribution. Escalate unresolved policy choices to the customer owner before backfilling.

3. Calculate the example

With three exact values of 0.335 and round-half-up to two decimal places, rounding each line gives 0.34+0.34+0.34=1.02. Summing first gives 1.005, which rounds to 1.01 under that same rule. The one-cent difference arises from operation order, not random model behavior. Under half-even, the final 1.005 rounds to 1.00, demonstrating that the tie rule also matters.

4. Failure cases and trade-offs

Converting a binary float to decimal can preserve its approximation rather than the intended input string. Mixed currencies can produce a numerically neat but meaningless total. Rounding already-rounded source values again can introduce additional differences.

Matching the source display may not match the source's underlying ledger rule. Preserve both when required and label them. Higher precision is useful internally but does not eliminate the need for a final policy. Avoid patching discrepancies with unexplained balancing rows.

5. Validate the result

Test positive and negative halfway values, line versus total rounding, large sums and currency scale. Compare exact expected decimal strings, not broad floating tolerances, for the agreed fixtures. Have the owner approve the policy and historical correction scope.

6. Interview follow-ups and self-review

Which rule applies to negative adjustments? How are currency conversions versioned?

Reward exact input representation, order-of-operations diagnosis, correct tie examples and explicit policy ownership.

Sources and related practice

Technical reference: docs.python.org — Official decimal arithmetic and rounding reference; reconciliation scenario is original.

Exact publication/update date not established in this review. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.

Continue with Resolve unit and meaning mismatches in customer data; Reconcile conflicting records across customer systems.

Continue your preparation

Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.