# Do tech companies ask bit manipulation questions during interviews?

I’m a full stack JavaScript engineer. I didn’t study computer science in school so I don’t know anything about bit manipulation. Do I have to learn this? Have you ever got bit manipulation questions during interviews? I’m trying to interview for fang and top companies.

• Amazon / Eng Dr Strange
No, unless it’s very very basic
May 13, 2018 0
It depends on the role u r applying to and also on what you have said on ur resume. If you have C, C++ on ur resume, bit manipulation questions are fair game. I usually ask people very basic bit manipulation questions for positions in my team because we use it. Even if you don't know how to solve it, I think for any software engg role, having basic knowledge of bit ops is a must. No one is looking for Stanford bit twiddling level hacks during interview
May 13, 2018 0
Yes as likely as weighted topic in data structures
May 13, 2018 0
May 13, 2018 3
Assuming two’s complement integer, XOR each bit with the MSB and then set MSB to 0. Is that it?
May 13, 2018
• Accenture / Eng RimRax
Wouldn’t that transform -1 into 0?
May 13, 2018
Oh right, guess you can do + MSB before flipping MSB at the end?
May 13, 2018
• Amazon ɹǝƃıǝƃ
Make sure you can confidently go through "Cracking the Coding Interview", which includes basic bit manipulation.

Yes, I agree the current state of interviews sucks. Yes, I agree but manipulation has nothing to do with frontend development. But unfortunately Cracking the Coding Interview and other similar books form the bedrock of phone screens at least. Face to face interviews are much more difficult.
May 13, 2018 1
• Amazon VTech Bro
Imagine being asked leetcode hard questions on a firmware interview when you have been a firmware guy for 15 years...
May 15, 2018
Absolutely. Slicing and dicing integers is a fundamental skill. You should be able to e.g. write code that converts between oct/dec/hex/bin, move all digits on the base left or right, set a specific digit in an integer and such.

Once you know that, bitwise operations are just a simple (and very fast) specific case
May 15, 2018 0
• New / Eng
I think I've had it come up in three interviews over the past 15 years, at Pure Storage, Riverbed, and at an enterprise software company where it was the "easy" solution to a problem they gave me which wasn't intended to use bits.
May 15, 2018 0
• OP
Damn it I guess I have to learn lol.
May 13, 2018 0
• Nvidia yuri
Nvidia does
May 13, 2018 0
• Amazon
Sometimes.. multiplication using bit is a common one... I tried to answer using bit when I can
May 13, 2018 0