This question evaluates a candidate's understanding of bitwise operations and low-level integer manipulation, along with the ability to reason about the time and space complexity of bit-level operations.
Given a non-negative integer num and a zero-based bit position p, return the integer resulting from flipping only the bit at position p (i.e., 0 becomes 1, 1 becomes 0). Explain your approach and its time/space complexity.