As reported: Applied Intuition coding interview (2025) with four questions; question 1: duplicate files in a directory tree.
get_duplicate_files(root) walks the directory tree under root and returns groups of file paths whose contents are identical. File extensions can differ; a file with no duplicate is a group of its own.
For example, for this tree
/a
├── b
│ ├── c.pdf
│ └── d.txt
├── x
│ ├── y.log
│ └── z.pdf
└── unique.png
where c.pdf and z.pdf have the same contents, and so do d.txt and y.log, the result is
[["/a/b/c.pdf","/a/x/z.pdf"], ["/a/b/d.txt","/a/x/y.log"], ["/a/unique.png"]]
Code runner format: the code runner has no file system, so the walk is given to you: one JSON value — the list of files as [path, contents] pairs. Implement getDuplicateFiles(files); groups and paths may be in any order (the harness sorts them).
Constraints: up to 2 · 10^4 files.