Interview question: Which one will execute faster, if (flag==0)
or if (0==flag)
? Why?
I think the best answer is "what language is this example in"?
The question did not specify the language and it's tagged both 'C' and 'C++'. A precise answer needs more information.
It's a lousy programming question, but it could be a good in the devious "let's give the interviewee enough rope to either hang himself or build a tree swing" department. The problem with those kinds of questions is they usually get written down and handed down from interviewer to interviewer until it gets to people who don't really understand it from all the angles.