A technical blog about programming and technology.

Monday, April 9, 2007

Best Google interview question

A few weeks ago, a friend approached me with a set of google interview questions. There was one that i found particularly interesting, and really creative.


	if(condition) {
printf("hello");
}
else {
printf("world");
}
What condition prints "helloworld"?
i'll post the solution tomorrow.

3 comments:

James said...

#define condition (printf("hello"),0)

Gourav Sakargayan said...

if((printf("HELLO"))==0)
{
printf("");
}
else{
printf("WORLD");
}

Shriram said...

if( printf("hello") != printf("") )
is the condition