The interview problem

Practice prompt

A customer's long account IDs change after passing through a browser or spreadsheet. Diagnose the data 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

Assume IDs are opaque values used for equality, not arithmetic. Compare raw payload bytes at each boundary and identify numeric parsing or spreadsheet conversion. Represent identifiers as strings throughout JSON, CSV import guidance, database keys and UI forms. Validate length and allowed characters without converting to floating point. Reconcile already-corrupted values against the authoritative source; lost low bits cannot be recovered by formatting.

2. Trace the design or derivation

Capture raw digits
  → find coercion boundary
  → switch to strings
  → reconcile collisions
  → test round trips

A migration report should identify values that have already lost precision and require source re-fetch. Changing a database column to text preserves the rounded value, not the original. Include exported spreadsheet instructions or a safer file format so users do not reintroduce the corruption when editing data manually.

3. Calculate the example

JavaScript's safe integer limit is 2^53−1 = 9,007,199,254,740,991. A larger decimal identifier may not round-trip through Number. Sending it as a quoted string preserves its digits; leading zeros also remain meaningful.

4. Failure cases and trade-offs

Changing only the frontend leaves backend parsers or exports vulnerable. Scientific notation can hide corruption in review. String storage uses different indexing and validation rules but reflects identifier semantics correctly. Never guess the intended account from a rounded ID when multiple originals collide.

5. Validation, follow-ups and self-review

Round-trip boundary values, leading zeros and long IDs through every supported client. Follow-up: how would you migrate a numeric primary key interface? Self-review: separate identity from quantity and show end-to-end fixtures.

Sources and related practice

Technical reference: www.rfc-editor.org — JSON number interoperability and exact integer range concerns.

Source publication/update: December 2017. 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 Ingest spreadsheet results without trusting stale formula caches; 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.