This is definitely a second-year programming question, and I'd reasonably expect a second year CS student to solve it - as that's when you start learning about bitwise operations.
The question is, would graduated programmers work with bitwise operations? Or, even worse, programmers who haven't been to school, but still do good work?