They give you a URL, and you have to call it. The response might contain a new set of URLs, or it might contain other data; then you keep calling whichever URLs come back, recursing/iterating like this until you finally get back "congrats". You don't need to return the path, just the final URL.
The problem itself isn't especially hard, but overall it's pretty tedious and practical. During the interview you need to print out the HTTP response first, then decide how to parse it and how to keep calling based on what's in the response. You also have to handle exception cases, especially all the different 503 scenarios (things like retries, error handling, malformed response content, and so on).
Another important point about this round: time is tight, so you really need to manage your time carefully. The interviewer also explicitly said that this round doesn't care that much about coding style (how elegant or clean the code looks) — the main thing is whether you can quickly get the core logic working. So my sense is the strategy should be to get the main flow working first, then fill in the exception handling and details afterward.
The interviewer's overall style was pretty cold, basically no feedback, so it was hard to tell how I was doing while working through the problem.
Discussion
Loading comments…