I saw this on a facebook group.
Many members quickly confirmed that this is indeed from a Google Written test they had appeared for.
If they said it was from an interview, it would be easy to say that this was a trick question.
But in a written test without extra options, what are people supossed to do when there is a known undefined behaviour/segfault/etc?
I've heard stories about non-tech people conducting interviews which are obviously technical in nature...but this takes it a step further.
And after seeing Google being praised as a developers' heaven in the media for a few years..this seems strange for me.
Code:void f(char *x) { x++; *x = ‘a’; } int main() { char *str = "hello"; f(str); printf("%s", str); } a) hello b) allo c) hallo d) empty string