Amazon Interview Question: What is the range of numbers ... | Glassdoor

Interview Question

Software Development Engineer Interview Herndon, VA

What is the range of numbers that can be stored using a

  single byte?

Interview Answer

2 Answers


Signed: From ?128 to 127. Unsigned: From 0 to 255.

Interview Candidate on Nov 14, 2012

I think the range can be anything you want it to be, just have to agree on the storage format. Imagine a situation where you have to store only the even positive numbers, that means the range can be 0..512. If you know that the lowest number can be 100, then the range can be 100..612. Using more elaborate formats you can encode any range in a byte (with low precision, possibly).

NA on Feb 6, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.