Swimming with the Razorfishes

Monday, January 12, 2004

Because Clemens Vasters pointed me there, I'm looking through questions on TechInterview.com


What will print out?



main()
{
char *p1="name";
char *p2;
p2=(char*)malloc(20);
memset (p2, 0, 20);
while(*p2++ = *p1++);
printf("%s\n",p2);
}



These are exactly the kind of questions I avoid during interviews. I have never, ever been asked to write software that spewed text out on the console, and I don't think this kind of question really gauges ability. Anyone could spend a few days with a Learn C++ in 21 Days book and answer most of these questions.

If I wanted to hire a language lawyer, I'd ask stuff like this. If I wanted to hire a software developer capable of making good decisions, I'd ask quite different questions. These kind of questions tend to be asked by geeks who are really excited that they know the answers, not by people trying to hire great people.

0 Comments:

Post a Comment

<< Home