Do tech companies ask bit manipulation questions during interviews?

May 13, 2018 17 Comments

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.

comments

Want to comment? LOG IN or SIGN UP
TOP 17 Comments
  • Amazon / Eng Dr Strange
    No, unless it’s very very basic
    May 13, 2018 0
  • Cisco bad_karma
    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
  • LinkedIn Trump-ed
    Yes as likely as weighted topic in data structures
    May 13, 2018 0
  • Google hgwL55
    i got asked a bit manipulation question about taking the absolute value without conditionals at google
    May 13, 2018 3
    • Facebook / Eng AllAboutTh
      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
    • Facebook / Eng AllAboutTh
      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
  • Facebook
    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
    not_hotdog

    New Eng

    PRE
    Facebook
    BIO
    Prematurely grumpy old man
    not_hotdogmore
    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
    acm∆icpc

    Amazon

    PRE
    Microsoft
    acm∆icpcmore
    Sometimes.. multiplication using bit is a common one... I tried to answer using bit when I can
    May 13, 2018 0
  • Google feral
    Yes. Facebook and Two Sigma asked me
    May 13, 2018 0
  • Amazon Ang Boomer
    Yes, we do that to make sure people don't screw up some control mask they need to send down low.

    Also this is a good way to screen people for fundamental understanding of the architecture.
    May 13, 2018 0
  • Amazon RBMY63
    I’ve asked questions that knowing bits helps on. Maybe at one time straight up bit manipulation.

    If you are not in to backend dev you should be clear and say front end or web dev. If you feel like you are hardcore just don’t know low level (don’t know how you can be both, but maybe) then yes, study it.
    May 13, 2018 0