Live data from Hacker News

Ask HN: What's your favorite graph interview question?

news.ycombinator.com

11–15 of 15 posts

Re: Ask HN: What's your favorite graph interview question?

#12
post #7

I also have reservations about algorithms questions as a useful interview filter, but my favourite that I have been asked is "How would you delete a tree using a fixed amount of memory? i.e. no recursion or other dynamic structures".

Huh? Deletion has different meanings depending on context. What do you mean by delete, exactly? What language? How is the tree stored?

Free the memory associated with the tree. This is a C/++ question.

Re: Ask HN: What's your favorite graph interview question?

#13
post #3

If you were a graph, which would you be? More seriously: do people think that any questions that require anything more than DFS, BFS, and/or Dijkstra are reasonable to ask for most general software engineering positions? (I appreciate specific positions might expect more) Of course, trees are graphs too, and there are loads of tree questions --- I guess I'd narrow my response down to questions regarding general graph…

>do people think that any questions that require anything more than DFS, BFS, and/or Dijkstra are reasonable to ask for most general software engineering positions?

Yes and no.

I enjoy making questions that stretch them to see how well they do in situations they have to solve something.

I always preface with "I don't care about the answer, I want to get into your brain" though. I am not sure how many take that to heart.

Re: Ask HN: What's your favorite graph interview question?

#14
post #3

If you were a graph, which would you be? More seriously: do people think that any questions that require anything more than DFS, BFS, and/or Dijkstra are reasonable to ask for most general software engineering positions? (I appreciate specific positions might expect more) Of course, trees are graphs too, and there are loads of tree questions --- I guess I'd narrow my response down to questions regarding general graph…

At Google an interviewer expected me to come up with topological sort on the spot. I could solve his problem conceptually (figured it was a graph, and that the solution relied on performing a topological sort on it), but no way could remember the algorithm in the 15-20 minutes we had left. It’s something I’ve had to use on the job and I always look it up.

If I interview with Google again, I’m gonna memorize all graph algorithms I can. All my interviewers asked me graph questions.

Re: Ask HN: What's your favorite graph interview question?

#15
“If we asked you to sell more ads, which graph would you choose?”

Follow up: “Which graph would be better at tracking and monitizing our users? Preferably, it would be optimized for lowest memory usage while also not letting our users know how we exploit their trust in us.”

Post reply on HN