亚马逊面试题:实现类 Linux find 的文件搜索 API | DFS | Filter Chain

51次阅读
没有评论

Implement the Linux find command as an API.

Your API should support searching for files that match:

  1. A size requirement
  2. A filename pattern

Assume the filesystem is represented as a tree-like structure of directories and files.

Your job:
Design and implement a find-like API that searches the file system and returns all files that satisfy the given filters.


对文件系统做 DFS 遍历 ,给每个文件按顺序套用 过滤器链(大小过滤、名称过滤),满足条件的加入结果。

VOprep 团队长期陪同学员实战各类大厂 OA 与 VO,包括 Google、Amazon、Citadel、SIG 等,提供实时答案助攻、远程陪练与面试节奏提醒,帮助大家在关键时刻不卡壳。
如果你也在准备公司,可以了解一下我们的定制助攻方案——从编程面到系统设计,全程护航上岸。

正文完
 0