← Applied Interview Insights

Applied·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Got a coding problem at Applied for a software engineer role, basically a filesystem duplicate finder. The problem itself was clean but the follow-ups pushed into system design territory pretty fast.

Questions Asked (4)

Q1

Given a list of files each with a full path and size, find all groups of duplicate files based on identical content. Groups of size one should be excluded from the output.

Algorithms & Data StructuresSystem Design
Author's notes

The core problem is straightforward enough but the real trick is not hashing everything blindly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: are we comparing files on the same machine or distributed? Then propose a multi-stage approach: first group by size, then by a quick hash (e.g., first few KB), and finally by a full cryptographic hash (e.g., SHA-256) to confirm duplicates. Discuss trade-offs between accuracy, speed, and memory usage, and how to handle large-scale data.

Pro tip: Mention that you would use a streaming hash to avoid loading entire files into memory, and that you can parallelize hashing across files to speed up the process. Also, consider using a database or external sort if the file list is too large to fit in memory.

1. Clarify requirements and constraints

Ask about scale (number of files, total size), whether files are on local disk or distributed, and if exact byte-for-byte comparison is required. This determines the algorithm and system design.

2. Group by file size

Files with different sizes cannot be duplicates, so group files by size first. This reduces the number of files to compare in subsequent steps.

3. Compute and compare hashes

For each size group, compute a fast hash (e.g., MD5 or SHA-1) of the first few KB to quickly filter out non-duplicates, then compute a full cryptographic hash (e.g., SHA-256) for remaining candidates to confirm duplicates.

4. Group by full hash and filter

Group files by their full hash; any group with more than one file is a set of duplicates. Exclude groups of size one.

5. Optimize for scale

Discuss parallelization, streaming, and external sorting or database indexing if the dataset is too large for memory. Mention trade-offs between hash collision risk and performance.

Key Points to Mention

  • Hash collisions and why full cryptographic hashes are used for final confirmation
  • Streaming file reads to handle large files without loading them entirely into memory
  • Parallel processing to speed up hashing across multiple files or machines
  • Using a database or external sort for datasets that don't fit in memory
  • Trade-offs between different hash algorithms (speed vs. collision resistance)
  • Handling edge cases: empty files, files with same content but different metadata, and symlinks

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

Q2

How would you design this to avoid hashing every file when most files are unique?

System DesignTechnical Trade-offs
Author's notes

Size bucketing gets you most of the way there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the goal: avoid full-file hashing when most files are unique, likely for deduplication or change detection. Propose a tiered approach using cheap metadata (size, timestamps, inode) as a first filter, then partial hashing or sampling for candidates, and full hashing only when necessary. Discuss trade-offs between accuracy, performance, and complexity.

Pro tip: Emphasize that the design should be adaptive: if the unique file ratio changes, the system can dynamically adjust the level of hashing to balance cost and accuracy. Also, mention that using a fast non-cryptographic hash for initial filtering can further reduce overhead.

1. Clarify Requirements and Constraints

Ask about the purpose (deduplication, change detection), file sizes, update frequency, and acceptable false positive/negative rates. This determines the appropriate trade-offs.

2. Use Cheap Metadata as First Filter

Compare file size, modification time, and possibly inode or path. If these differ, files are likely unique, so skip hashing. Only proceed if metadata matches.

3. Apply Partial Hashing or Sampling

For files with matching metadata, hash only a portion (e.g., first and last few KB) or sample chunks. This quickly identifies most unique files with minimal I/O.

4. Full Hash Only for Strong Candidates

If partial hashes match, compute the full hash to confirm. This ensures accuracy while minimizing full hashes.

5. Discuss Trade-offs and Optimizations

Address false positives, collision risks, and performance. Mention caching hashes, using faster hashes (e.g., xxHash) for filtering, and adapting thresholds based on workload.

Key Points to Mention

  • Metadata comparison (size, mtime, inode) as a cheap first pass
  • Partial hashing or sampling to reduce I/O
  • Full hashing only for candidates that pass earlier filters
  • Trade-offs between accuracy (false positives/negatives) and performance
  • Use of fast non-cryptographic hashes for filtering
  • Adaptive strategies based on unique file ratio or system load

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

Q3

How do you handle extremely large files, say over a gigabyte, without loading the whole thing into memory?

System DesignTechnical Trade-offs
Author's notes

Stream and hash in chunks.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the file type and processing goal, then describe streaming or chunked processing to avoid loading the entire file. Emphasize memory efficiency, I/O patterns, and trade-offs between simplicity and performance.

Pro tip: Mention that you'd first check if the file can be processed line-by-line or in fixed-size chunks, and use memory-mapped files only when random access is needed. Also, highlight the importance of backpressure and error handling in streaming pipelines.

1. Clarify requirements

Ask about the file format (text, binary, CSV, etc.), the processing needed (filter, transform, aggregate), and whether random access is required. This determines the best approach.

2. Choose a streaming strategy

For sequential processing, use line-by-line or fixed-size chunk reading. For random access, consider memory-mapped files or indexing. Avoid reading the entire file into memory.

3. Implement with appropriate libraries

Use language-specific streaming APIs (e.g., Python's file iterator, Java's BufferedReader, Node.js streams) or memory-mapped files (e.g., mmap). Process chunks incrementally and release memory.

4. Handle edge cases and performance

Address backpressure, error handling, and partial reads. Optimize buffer sizes and consider parallel processing if chunks are independent.

5. Discuss trade-offs

Compare streaming vs. memory-mapping vs. external sorting. Mention memory usage, speed, complexity, and suitability for different file types.

Key Points to Mention

  • Streaming/chunked reading to keep memory usage constant
  • Memory-mapped files for random access without loading entire file
  • Language-specific APIs like BufferedReader, Node.js streams, or Python's file iterator
  • Backpressure and flow control in streaming pipelines
  • Trade-offs between simplicity, speed, and memory efficiency
  • Error handling and partial reads in large file processing

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

Q4

If hash collisions are a concern, how would you confirm two files are actually duplicates?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Byte-by-byte comparison as a final check.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that hash collisions are possible but rare, so hashes are a good first filter. Then explain that to confirm duplicates, you must compare the actual file contents byte-by-byte. Finally, discuss how to optimize this comparison to avoid unnecessary full reads.

Pro tip: Mention that you can use a cryptographic hash like SHA-256 to make collisions practically impossible, but still verify with a byte-by-byte comparison for absolute certainty. Also, consider using file size as a quick pre-check to avoid hashing files of different sizes.

1. Use hashes as a first pass

Compute a strong hash (e.g., SHA-256) for each file. If hashes differ, files are definitely not duplicates; if they match, they are likely duplicates but not guaranteed.

2. Compare file sizes

Before comparing contents, check if file sizes match. Different sizes mean files cannot be duplicates, saving time.

3. Perform byte-by-byte comparison

If hashes and sizes match, read both files in chunks and compare byte-by-byte. This confirms duplicates with 100% certainty.

4. Optimize for performance

Use buffered reads and early exit on first mismatch. For large files, consider memory-mapped I/O or parallel processing to speed up comparison.

5. Consider alternative approaches

If performance is critical, discuss using a Merkle tree or comparing multiple hashes (e.g., MD5 and SHA-1) to reduce collision risk, but note that byte-by-byte is the only definitive method.

Key Points to Mention

  • Hash collisions are possible but extremely rare with strong cryptographic hashes.
  • Byte-by-byte comparison is the only way to be 100% certain.
  • File size check can quickly rule out non-duplicates.
  • Use buffered I/O and early exit to optimize comparison.
  • For large files, consider memory-mapped files or parallel processing.
  • Mention trade-offs: hashing is fast but not definitive; byte comparison is definitive but slower.

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