Interview practice question
Large IDs get corrupted in the frontend
Backend Engineering · Language Runtimes · Beginner
Your API returns 64-bit numeric IDs, and some JavaScript clients show slightly wrong IDs. Why, and how do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- JS numbers are 64-bit floats.
- Safe integers only up to 2^53 - 1.
- Larger values lose precision.
- Send IDs as strings in JSON.
- Or BigInt on client.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.