Diff Two File Manifests From Consecutive Backups
Last updated: November 29, 2026
Quick Overview
Given two manifests mapping file path to content hash from consecutive backups of a file share, return the added, removed and modified paths.
Rubrik
November 29, 20260
0
0 solved
Given two manifests mapping file path to content hash from consecutive backups of a file share, return the added, removed and modified paths.
Comparing file listings between snapshots powers Rubrik features like changed-file browsing and anomaly reports. In an online assessment this checks basic hash map fluency and clean, deterministic output.
What the Interviewer Expects
- Use set or dict membership rather than nested loops
- Separate added, removed and modified correctly
- Return sorted, deterministic output
- State O(n + m) time
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you detect renames (same hash, different path)?
- The manifests have 500 million entries and do not fit in memory. What do you do?
- How would you report directory-level change counts for a UI tree view?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Inputs are two dicts path -> hash. Added: in new only. Removed: in old only. Modified: in both with different hashes. Unchanged files are not reported....
High-Level Design
Three membership passes over the dicts. Each lookup is O(1) on average....