--- title: Microsoft interview question date: "2001-01-15T12:00:00Z" categories: - links wp_id: 1964 description: I explore classic Microsoft interview riddles, like writing a one-line C expression to check for powers of two or decoding assembly snippets. These resources provide a glimpse into the brainteasers used during technical hiring processes. keywords: [microsoft interview, c programming, assembly language, brainteasers, algorithms, software engineering] --- "Write a one-line C expression to determine if a number is a power of 2". Microsoft is famous for [asking such questions](http://www-scf.usc.edu/~bondalap/ais/msqs.html) to their programmers. Or you might want to find out what the assembly code ``` CWD XOR AX, DX SUB AX, DX ``` does. [Satish's site](http://www.ece.utexas.edu/~satti/brainteasers.html) has the answer, but not the question. More questions: [1](http://www.acetheinterview.com/qanda/algorithms.html) [2](http://www.eecs.uic.edu/~skishenc/technical/technical4.htm)