This document is an general overview of bitwise operators and how they are used in professional software development.
This repository (bitwise-operators
) contains documention, working code
samples, and interview questions.
Feel free to open an issue or pull request against me/this repro with requests for corrections, elaboration, or more examples.
Existing documents give an in-depth overview of bitwise operations:
Here's an overview I put together:
Bitwise operators allow developers to evaluate and change the individual bits
that make up primitive data types, usually some kind of int
.
There are a few reasons developers might need to use bitwise operators. Consequently, you should expect that they will show up from time to time in coding interviews, especially when a position requires working in low-level platform code.
For a list of real-world uses of bitwise operators, read Real World uses of bitwise operators
Comfort with bitwise operators benefit entry-level software developer interview candidates. Interviewers may pose bitwise operator questions in particular so that candidates can demonstrate:
-
their comfort level working with counting in non-base-10 representations.
-
their comfort level solving problems by directly manipulating the binary representation of integers.
See the Interviews page for more information.
Here's a list of external sites and literature on this topic.