Filter Open Restaurants Through Existing Domain APIs
Last updated: August 13, 2026
Quick Overview
The question asks the candidate to implement a solution that filters open restaurants within a specified city range using existing domain APIs.
DoorDash
August 13, 202611
0
97 solved
The question asks the candidate to implement a solution that filters open restaurants within a specified city range using existing domain APIs.
This question is typically asked during the technical screen round to assess a candidate's ability to work with APIs and handle data filtering. Interviewers evaluate the candidate's coding skills, understanding of object-oriented programming, and ability to effectively use provided classes and methods to solve a practical problem.
What the Interviewer Expects
- Demonstrate understanding of the provided city and restaurant classes.
- Implement a function that calls the API to check if a restaurant is open.
- Filter the restaurants based on their open status and proximity to the city.
- Write clean, maintainable code with appropriate error handling.
- Explain the thought process and decisions made during implementation.
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you handle edge cases, such as restaurants that are temporarily closed?
- What considerations would you make for performance optimization?
- Can you explain how you would test your implementation?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Approach
To solve this problem, I will create a function that iterates through a list of restaurants, checks if each one is open using the provided API, and then filters them based on their distance from the s...
Algorithm
- Initialize an empty list to store eligible restaurants.
- Loop through each restaurant in the provided list.
- For each restaurant, call the API method to check if it is open.
- If the restauran...