Intellisync Interview Question

What is the difference between a float and a double?

Interview Answers

Anonymous

Oct 3, 2024

- My answer: "Both float and double can represent decimal numbers, but double can represent a wider range of values than float." - Interviewer: "Not quite right. How much memory does each one of those types require? Let's start with something simpler. How many values can you represent in 8 bits?" - My answer: "255." - Interviewer: "Including zero, that's correct. Now, how many values can you represent with a float and a double, in bits?" That is the answer I didn't knew and qualified me as a junior instead of semi senior. A technical trivia question defined my seniority instead of my problem solving skills showed during the interview and my overall experience. The answer he was looking for was 32 bits for float and 64 bits for double.

2

Anonymous

Oct 3, 2024

The answer I gave: "Both can represent decimal numbers but a double can represent a bigger variety of numbers than float." Interviewer answer: " Not quite right. Exactly how much of memory each one of those needs? The answer is 32 bits for float and 64 bits for double."