SpaceX interview question

"What is the size of an integer on a 32-bit system?"

Interview Answers

Anonymous

14 Nov 2017

2^32= 4 billionish ?

6

Anonymous

14 Jan 2019

4 byte

3

Anonymous

13 Aug 2018

4 bytes

2

Anonymous

14 Aug 2018

Reading these answers now I understand why would ask the question. According to C/C++ standards the size of an integer, regardless of any hardware limitations, is at least 16 bits; but usually the size of an integer is 32 bits. It has nothing to do with it being signed or unsigned (question asks about size, not range).

5

Anonymous

19 Apr 2018

Depends if it's signed or unsigned...

7

Anonymous

10 Aug 2019

Depends on the CPU and compiler. It is really arbritary how a regular integer is defined, though you must know what they chose. In Microsoft .net, a regular integer is 32-bit. In their prior Visual Studio 6, it was 16-bit. In TI Code Composer (for TI DSP chips), even a Boolean (true/false) occupied 32-bits of memory.

1

Anonymous

16 Oct 2019

Found excellent read: bit.ly/faang100

Anonymous

15 May 2017

Four? A byte is 8-bits. 8/32 = 4

7