Bit Tricks in C
Firmware talks to hardware through registers, which are words where each bit means something. One bit can gate a clock while the next one clears an interrupt. That's why bit questions show up so much in Qualcomm rounds, and why a single-bit operation is a common warm-up, often asked as a C macro. The follow-ups then push on the edges, like a bad bit position or bit 31 on a signed int.
Every problem here uses the same move. You build a mask with shifts, then apply it with AND, OR or XOR. Once that feels routine, the rest is mostly a matter of getting the shift amounts right. The theory behind single-bit work is in Embedded C & OS Internals. Below is the code for each problem, with tests, in six languages.
QualcommPremium lesson · Coding round
The 6 Qualcomm problems are below.
- A Premium questionCoding · Easy · Signature problem
- A Premium questionCoding · Easy · Frequently asked
- A Premium questionCoding · Easy · Frequently asked
+ 3 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Qualcomm questions$49 a year · all 100 companies · cancel anytime
From 135 Qualcomm reports, forum threads behind logins and write-ups in Chinese.
Qualcomm interview guideKnow what Qualcomm asks before you walk in.
31 coding · 3 system design · 15 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.