Amazon: File search utility with composable AND/OR filters
Problem. Design a command-line file search tool. A user should be able to search files by attributes such as name, size and extension, and should be able to build more complex queries by combining filters with AND and OR (for example, files with a given extension AND larger than some size, OR files whose name matches a pattern).
What the interviewer looked for.
- Clean object-oriented modelling of files and of filters.
- Extensibility, so a new attribute filter can be added without touching existing code.
- A design where filters compose into trees of conditions; the candidate described it as a specification or composite style of solution.
Context. This was the LLD round of an SDE2 loop and was paired with leadership-principle questions. The candidate rated it medium. Other rounds in the same loop asked for the largest rectangle in a histogram, the minimum starting power to cross a grid of gains and losses, and an attendance system for hourly employees with deliberately vague requirements.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.