?

Log in

No account? Create an account

Previous Entry | Next Entry

Interview Questions

At my old job I used to interview would be candidates. We had a great set of interview questions, many of which were created by chikuru. Still I would often try to think of good interview questions on my own. One of my favorites was the following:

What does the following program print?

#include <stdio.h>

void main()
{
   float z = 7.2;
   int i = (int)z;
   int j = *((int*)(&z));

   printf("%d\n%d\n",i,j);
}


It was a good question to ask to see if people understood pointers, casting, and C/C++, but it was a little C/C++ specific.

Latest Month

July 2011
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      
Powered by LiveJournal.com
Designed by yoksel