Yahoo Interview Report
- 0of 0 votes
AnswersThis is a very simple question. But im not sure why the answer is the way it is.
- sreemana@buffalo.edu March 26, 2012 in United States
int main()
{
char *c = "abc";
*c = 'd';
printf("%s",c);
return 0;
}
What gets printed?
I said dbc for which he dint say anything and went ahead.
I coded this and found that I my compiler doesn't even give a response. I don't understand, *c sets the value being pointed to 'd' so technically this is legal right?
Can someone pitch in?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer - 1of 1 vote
AnswersCelebrity problem:
- sreemana@buffalo.edu March 26, 2012 in United States
You have a room with n people. A celebrity walks in. Everyone knows the celebrity, the celebrity knows no one. Non-celebrities may/may not know anyone in the room. Give an algorithm to find the celebrity. Discuss the complexity.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.