← Microsoft questions

Change Kth Bit

Filed under Microsoft

Given two integers n and k, toggle or change the k-th bit of n. Specifically, if the k-th bit (0-indexed or 1-indexed depending on standard conventions, typically 0-indexed from right) is 1, change it…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.