Directory Search Library
MediumProblem Description
Implement a small in-memory directory search API.
You are given a directory tree where each node has:
name: stris_file: boolsize: int(bytes, only meaningful for files)children: List[node](only for directories)
Write:
findMatchingPaths(root, min_size, extension) -> List[str]
Requirements:
- Return file paths that match all provided filters.
- If
min_sizeisNone, ignore size filter. - If
extensionisNone, ignore extension filter. - Use composition-style matcher logic, not hardcoded nested conditions.
- Output should be sorted lexicographically for deterministic results.
Example
min_size = 5_000_000
extension = "xml"
=> return all .xml files >= 5MB
Follow-up
- Add
or/notmatchers. - Add cycle protection if symbolic links are introduced.
Solution
Test Results
Run tests to see the overall score, band, and section breakdown.
Public Tests
Detailed feedback for visible cases.
Public test details will appear here after you run your solution.
Hidden Tests
Summary only, with no hidden inputs or outputs.
Performance
Execution timing and pass/fail status.
No performance results yet.
AI Interviewer
I'll review your code once you submit it. I can also give you hints if you get stuck!