The interview problem
A customer reports that 1,234 is being interpreted as the wrong value in imported files. Establish an unambiguous parsing contract.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Collect examples with declared locale, decimal separator and grouping rules. Parse into decimal values under a per-file or per-field contract, preserving the original token for rejected rows. Do not infer one locale from a single ambiguous number.
2. Trace the design or derivation
Declared format → token validation → decimal parse → reconciliation sample
Prefer explicit parsing libraries or isolated settings over changing global locale per request. If mixed formats are allowed, require a format column or another reliable discriminator. Put rejected examples in a restricted report rather than silently coercing them to zero.
3. Calculate the example
The token 1,234 can mean one thousand two hundred thirty-four or 1.234 depending on convention. A thousandfold difference can survive schema validation because both interpretations are valid numbers.
4. Failure cases and trade-offs
Removing all punctuation destroys decimal information. Process-global locale settings can cause concurrent tenant requests to interfere. Currency symbols do not always uniquely identify a locale.
5. Validation, follow-ups and self-review
Acceptance: test ambiguous values, negative formats and malformed grouping. Follow-up: can one file contain mixed locales? Self-review: separate parsing from later rounding.
Sources and related practice
Technical reference: docs.python.org — Locale-dependent number interpretation and process-global locale limitations.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Reconcile totals that differ because of rounding rules; Repair a CSV import that silently changes identifiers.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.