Spotify Interview Question

What gives the quickest access: CPU register, CPU cache, RAM, HDD. Write -1 as a 4 bytes integer using hexadecimal notation

Interview Answers

Anonymous

Jul 5, 2017

What gives the quickest access: CPU register, CPU cache , RAM, HDD: It Depends !

Anonymous

Aug 15, 2017

registers are always fastest memory on CPU, followed by L1 or L2 cache. Negative one in signed twos-complement for a 32-bit (4 byte) integer is 0xFFFFFFFF. All bits set to 1 ALWAYS has the value -1 regardless of width.