Dsa
Hashing
Easy
Directory Content Mirroring
You are writing a utility to find duplicate folders in a backup. A folder is a 'mirror' of another if it contains the exact same filenames (ignoring folder names themselves and file contents). Given a list of folders and their contents, output the name of every folder that has at least one mirror elsewhere in the list, sorted alphabetically.
Example:
Input:
3
FolderA: file1.txt file2.jpg
FolderB: data.csv
FolderC: file2.jpg file1.txt
Output:
FolderA
FolderC
Key concepts
hashingstringsdeduplication
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now