Live data from Hacker News

Ask HN: What are the best interview questions you've been asked?

news.ycombinator.com

1–10 of 63 posts

Re: Ask HN: What are the best interview questions you've been asked?

#3
Consider two directed acyclic graphs where each node has a hash that depends on its value and its parent's hashes. Suppose you have a slow connection and one of the graphs is remote, how do you figure out as efficiently as possible which nodes both graphs have?

The trick is to sample random nodes from the remote graph. If you get back a node that has the same hash as a node in your graph, you know that local and remote have all the same ancestors of the node too. Otherwise, you know that local doesn't have any of the children (on remote) of that node.

Turns out that is basically what mercurial does [1].

[1] https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/set...

Re: Ask HN: What are the best interview questions you've been asked?

#4

Consider two directed acyclic graphs where each node has a hash that depends on its value and its parent's hashes. Suppose you have a slow connection and one of the graphs is remote, how do you figure out as efficiently as possible which nodes both graphs have? The trick is to sample random nodes from the remote graph. If you get back a node that has the same hash as a node in your graph, you know that local and remo…

[deleted]

Re: Ask HN: What are the best interview questions you've been asked?

#8
"We're going to build Google Maps using these satellite images. How would you do it?"

This is the sort of open, large architectural question that I love and think really helps to understand a developer's skill set. It's great to be able to start very broad, but focus down into detail like CPU caching and the possible on-disk layout.

Re: Ask HN: What are the best interview questions you've been asked?

#9
post #6

one i really enjoyed solving: given an array of size (n - 1), containing all but one of the numbers between 1 and n, find the missing number in linear time and constant space.

For those curious about the best solution (like myself): http://www.geeksforgeeks.org/find-the-missing-number/
Post reply on HN