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
Coding & Algorithms
Software Engineer
Rubrik
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

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
hash maps
set difference
file metadata
snapshot diff
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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....


Submit Your Answer
Markdown supported

Related Questions