Implement a Duplicate-File Reporter

Quick Overview

Design a duplicate-file reporter that omits unique files, verifies content equality, balances CPU and I/O work, and handles changing or unreadable files.

Implement a Duplicate-File Reporter

Company: Anthropic

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

Explain how you would implement and test a file-duplicate reporting utility. Files without duplicates must not appear in its output; if no duplicates exist, it should produce no duplicate results. Discuss CPU and I/O costs as well as correctness. Clarify the duplicate definition, traversal scope, output grouping/order, and policies for links, unreadable files, and files that change during a scan. The exercise supplies no complete filesystem fixture or exact output format. ### What a Strong Answer Covers - A staged comparison strategy that avoids reading every file unnecessarily. - A distinction between a matching fingerprint and verified equality. - Bounded memory and concurrency for large files or many candidate files. - Output containing only actual duplicate groups, including the no-duplicate case. - Concrete test files and failure cases that would validate the implementation. ### Follow-up Questions - When would more hashing workers make the scan slower rather than faster? - How would you avoid reporting a duplicate based on a file that changed halfway through reading it?

Overview: Design a duplicate-file reporter that omits unique files, verifies content equality, balances CPU and I/O work, and handles changing or unreadable files.

|Home/Software Engineering Fundamentals/Anthropic
Anthropic logo
Anthropic
Aug 24, 2026
easySoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
2
0

Explain how you would implement and test a file-duplicate reporting utility. Files without duplicates must not appear in its output; if no duplicates exist, it should produce no duplicate results.

Discuss CPU and I/O costs as well as correctness. Clarify the duplicate definition, traversal scope, output grouping/order, and policies for links, unreadable files, and files that change during a scan. The exercise supplies no complete filesystem fixture or exact output format.

What a Strong Answer Covers Guidance

  • A staged comparison strategy that avoids reading every file unnecessarily.
  • A distinction between a matching fingerprint and verified equality.
  • Bounded memory and concurrency for large files or many candidate files.
  • Output containing only actual duplicate groups, including the no-duplicate case.
  • Concrete test files and failure cases that would validate the implementation.

Follow-up Questions Guidance

  • When would more hashing workers make the scan slower rather than faster?
  • How would you avoid reporting a duplicate based on a file that changed halfway through reading it?
Loading comments...