I got reached out to by a headhunter by chance — they said it's a company doing a DAF (Donor-Advised Fund) giving platform. I felt the direction was pretty niche, so I went and interviewed.
Overall the experience was pretty good, especially their coding question — it's one of the more interesting ones I've seen recently.
The question they gave wasn't a traditional Leetcode problem, but an interactive API problem:
Hello worthy adventurer!
Thou has been given an HTTP API endpoint that provides the entrance to a magical forest, Mirkwood. Your task: navigate safely through the forest until you reach the other side!
The forest grows darker and more treacherous the deeper you wander — wise travelers keep to the nearer clearings before pressing on.
You may enter the forest through the provided HTTP endpoint.
Each response will include some information that you can use to exit the maze. The final response will include a message of "DONE".
Your goal, noble hero, is to write a program that explores the forest and escapes to safety, printing the final location.
In short: they give you an HTTP endpoint, basically the entrance to a "maze." You need to write a program that keeps sending GET requests, decides the next step based on the response content, and explores the "maze" step by step until it returns "DONE" to indicate you've escaped.
There were quite a few edge cases along the way where I had to print all kinds of things out to see what was happening. You really have to keep talking to the interviewer to figure out how to use this endpoint to get more information.
My general approach was BFS with a queue to explore, and that's how I solved the first question.
After finishing the first question there was a followup with a new endpoint, which simulated server failures, plus locked doors and keys where you had to grab a key to open a door, etc. It was really interactive — personally I thought it was pretty fun.
Discussion
Loading comments…