Design a file search module like UNIX find
Company: Amazon
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design an object-oriented module that mimics the UNIX 'find' command to search the filesystem by criteria. Requirements: support filtering by name pattern (glob/regex), file type (file/dir/link), size ranges, modification/creation time, permissions/owner, and depth limits; allow composing predicates with AND/OR/NOT; provide options for following or skipping symlinks; and support outputting paths or file metadata. Propose APIs for command-style and library usage, show how to extend with new filters, discuss traversal and performance (early pruning, concurrency), and address robustness for large directories and permission errors. Provide class diagrams or interfaces, key data structures, and test cases.
Quick Answer: This question evaluates object-oriented and API design skills, filesystem semantics (pattern matching, file types, timestamps, permissions, symlink handling), traversal and concurrency strategies, and robustness for large or error-prone directory trees.