Original practice scenario: A hypothetical bank receives branch exports with different encodings, leading-zero account identifiers and localized date formats. Design a deterministic import contract.
Read model answer +
Treat identifiers as bounded strings and make encoding and format decisions explicit at the file boundary. A convenient numeric conversion can irreversibly alter an account key.
Work through it
Require declared file encoding, header version and date convention, preserving the original bytes or an authorized immutable reference for later diagnosis.
Validate field shape and decoded text before applying business rules; reject ambiguous dates and detect normalization collisions rather than silently repairing them.
Separate whole-file parsing failures from row-level exceptions, returning stable source positions and reason codes without printing sensitive account details.
Tradeoffs to discuss
Strict contracts make producer changes visible but require coordination; compatibility adapters can help when individually versioned and tested.
Common pitfalls
Do not strip leading zeros, transliterate names or trim meaningful identifier characters as a universal cleanup step.
A decoding replacement character may hide corruption even when the resulting CSV still parses.
Original practice scenario: A hypothetical branch network plans staffing for agricultural banking services with seasonal peaks and moving holidays. Design a baseline and backtest without assuming the same date pattern each year.
Read model answer +
Align forecasting with service-volume decisions and known calendar information. Agricultural seasons, holidays and branch closures can affect observed demand differently, so one repeated monthly average may be insufficient.
Work through it
Define branch-day or branch-week demand, separating closures, missing reports and genuine zero activity; retain calendar features known before the planning deadline.
Compare seasonal-naive and simple calendar-aware baselines through rolling-origin backtests at the staffing horizon, preserving entire future periods as holdouts.
Report errors by branch size and peak periods, with uncertainty and separate coverage for branches lacking comparable history.
Tradeoffs to discuss
Pooling branches stabilizes sparse series but may obscure local seasonality; individual models need enough history and monitoring.
Common pitfalls
Do not use realized harvest or later weather information when testing an earlier planning decision.
Observed visits may understate demand when limited opening hours or capacity prevented service.