← Applied intuition Interview Insights

Applied intuition·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Interviewed for a software engineer role at Applied Intuition and got a coding question that was basically a LeetCode problem dressed up with a real-world spin. The follow-up about optimization is where things got interesting.

Questions Asked (1)

Q1

Given a file directory tree, implement an algorithm using DFS or backtracking to find and delete files with duplicate content. Then discuss how you would optimize it to run faster.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The base problem is pretty recognizable if you've done file system stuff before.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then outline a DFS-based solution that traverses the directory tree, computes file hashes, and groups files by hash to identify duplicates. After describing the basic approach, discuss optimizations such as parallel hashing, early pruning, and efficient data structures to improve performance.

Pro tip: Emphasize the importance of hashing only file contents and using a two-phase approach: first group by file size to reduce the number of files to hash, then hash only files with matching sizes. This shows practical optimization thinking.

1. Clarify Requirements and Constraints

Ask about file size limits, number of files, whether symbolic links should be followed, and if deletion should be permanent or to trash. This ensures the solution meets the actual needs.

2. Design Basic DFS Solution

Traverse the directory tree using DFS, compute a hash (e.g., SHA-256) for each file's content, and store files in a hash map keyed by hash. After traversal, delete all but one file per hash group.

3. Identify Inefficiencies

Point out that hashing every file is expensive, especially for large files. Also, DFS recursion may cause stack overflow for deep trees; consider iterative DFS.

4. Propose Optimizations

Suggest grouping files by size first, hashing only files with duplicate sizes. Use parallel processing for hashing, and consider incremental hashing or sampling for large files. Use a more memory-efficient data structure if needed.

5. Discuss Trade-offs and Edge Cases

Mention trade-offs between accuracy and speed (e.g., using checksums vs. full hashes), handling of empty files, and concurrency issues if deleting while traversing.

Key Points to Mention

  • Use of DFS for directory traversal and backtracking for deletion
  • Hashing file contents (e.g., MD5, SHA-1, SHA-256) to identify duplicates
  • Optimization: group by file size before hashing to reduce hash computations
  • Parallel processing for hashing files to speed up I/O-bound operations
  • Memory considerations: storing hashes and file paths, potential use of Bloom filters
  • Handling edge cases: empty files, symbolic links, permission errors, and concurrent modifications

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.