Yelp interview question

What is the maximum value of an unsigned integer?

Interview Answers

Anonymous

1 Feb 2012

there is no unsigned integer in java. Let's say the number of bits in an integer is n. Then the maximum value of the unsigned integer is 2^n-1

1

Anonymous

5 Jan 2012

This depends on the platform and language In Java its 2^32 ( integer is implemented with 32 bits) In C++ it depends on the platform, it should be 2^32 on a 32 bit system and 2^64 in a 64 bit system.

1