Phone screen, and there's a problem on LeetCode that's almost identical to what they asked.
Write a web crawler that only scrapes pages under the same hostname.
The URL they gave me was for a real website (I think it might have been their CEO's blog?).
The interview format was a bit different though — he didn't have me jump straight to writing multi-threaded code. You do it single-threaded first, and once that passes, he asks how you'd improve it to be multi-threaded.
I felt like the key was whether you could land on the answer he wanted (a thread pool). I threw out several different approaches (comparing native threads, locks, etc.) and none of them hit the mark. It wasn't until I mentioned a thread pool that he said yes, that's the right direction. But by then there was no time left to actually write it. He tried to reassure me by saying most people don't even get to the multi-threading part (which I guess means most people fail this round, lol).
The reason I failed might also be that he thought I'd already done this exact question before — at the start he asked if I had, and I said I'd tried writing my own web crawler in the past. But honestly, a web crawler is a pretty common bootstrap project, so it wouldn't be surprising at all for someone new to have built one.
Discussion
Loading comments…