Duplicate Files
Medium · Phone screen · Onsite · Full-time
Given directory path strings where each file has inline content, group all files with identical content together. I parsed the paths to extract full file paths and their content, then used a hash map keyed by content to group duplicates. The interviewer followed up about what I'd change if the files were huge and couldn't fit in memory, which led into a discussion about hashing chunks.
