Computer Science Fundamentals
Data Representation
6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.
- An engineer used a floating-point type to store monetary amounts, and now a totals report is off by a cent in some cases. Walk me through why this happens and what you'd use instead.
- A user reports that a name with an emoji shows the wrong character count and gets truncated mid-character. What's going on, and how do you handle text length correctly?Go Pro
- Why is a binary floating-point type like double the wrong choice for storing money, and what would you use instead?Go Pro
- A user reports their display name gets truncated mid-character and a length check rejects valid names. Walk me through how you'd reason about text encoding to find and fix the root cause.Go Pro
- Explain the concept of Big-O notation. What is the time complexity of a binary search?Go Pro
- A coworker is surprised that 0.1 + 0.2 doesn't equal exactly 0.3 in their code. Why does that happen, and what would you use instead when the values are dollars and cents?Go Pro
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.