32 bits

closed account (10k9GNh0)
32 bits
[author deleted content]
Last edited on by admin
You can't set an individual bit to 0x1A.

This is most likely one of those questions that they don't know the answer to. But want to see your problem solving or analytical abilities.

Things you should've asked.
1) What endian is the integer? (The underlying architecture).
2) Count bits from left or right?

They use a similar one over here.
.e.g How many petrol stations are their in the country? When going for a job at a petroleum software development company.
Last edited on
I've been asked this, having worked for Intel in the past

It's effectively this
1
2
3
long num = 0x1a;

(num << 8);

Or
00000000 00000000 00011010 00000000

6656 in decimal



There ya go :) I had that answer on my calc, but I figured it maybe one of those test how they think questions.

Scary you worked @ intel eh :P
closed account (10k9GNh0)
wht does he mean by bits 9 through 13 set to 0x1A ?
@Zaita
They're that big it's like working for a government, but with an infrastructure that works :P

I'd be quite happy to go and work for them again.

I think it's was testing understanding of bitwise operations and registers type data.


EDIT:
@nim
look at the row of ones and naughts (each one is a bit) in my previous reply, counting from the right 0x1a occupies 9 ->13
Last edited on
Topic archived. No new replies allowed.