← Adobe Interview InsightsSoftware Engineer

Adobe·Software Engineer·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Adobe system design phone screen that went deep on Linux internals. One question, but it had a lot of moving parts and I definitely underestimated how much they'd want on the inode side of things.

Questions Asked (1)

Q1

A process in one terminal is continuously writing to log.txt. Another terminal is running `tail -f log.txt`. You delete the file from a third terminal with `rm log.txt`. Walk through what happens to: the writer's file descriptor and ongoing writes, what the tailer sees, the directory entry and inode lifecycle, and when the disk space actually gets reclaimed. Also cover how `lsof | grep deleted` exposes the situation, and explain the discrepancy you'd see between `df` and `du` after this kind of delete.

System DesignTechnical Trade-offsRoot Cause Analysis
Author's notes

I knew the broad strokes: rm unlinks the directory entry but the inode stays alive while open file descriptors hold a reference.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Walk through the Unix file model: separate the directory entry, inode, and open file description, then trace each actor (writer, tailer, rm) against that model. Emphasize that the inode persists while any process holds an open descriptor, and use that to explain the tailer's continued reads, the writer's continued writes, and the df/du discrepancy.

Pro tip: Mention that the tailer keeps reading because it holds an open file descriptor to the inode, not the path — and that this is exactly why log rotation tools use copytruncate or signal the writer to reopen the file. Also note that `lsof +L1` is the faster way to find deleted-but-open files than `lsof | grep deleted`.

1. Establish the Unix file model

Explain that a file is a directory entry pointing to an inode, and that open file descriptors reference the inode, not the path. This separation is the key to the entire answer.

2. Trace the writer's behavior

The writer's file descriptor remains valid because it points to the inode, which still has a link count of 1 (the open fd). Writes continue to the same inode and are appended normally; the writer sees no error.

3. Trace the tailer's behavior

The tailer also holds an open fd to the same inode, so it continues to read newly written data. It does not notice the unlink because it never re-resolves the path.

4. Explain the directory entry and inode lifecycle

rm removes the directory entry and decrements the inode's link count to 0, but the inode is not freed while open fds remain. The inode becomes anonymous and is only reclaimed when the last fd is closed.

5. Cover disk space reclamation and df/du discrepancy

Disk space is freed only when the last fd closes. Until then, df shows the space as used while du (which walks the directory tree) does not see the file, creating the classic df/du mismatch. lsof | grep deleted (or lsof +L1) reveals the deleted-but-open inode.

Key Points to Mention

  • Open file descriptors reference the inode, not the pathname, so unlink does not affect existing fds.
  • The inode's link count drops to 0 on rm, but the inode persists while any process holds it open.
  • The writer continues writing to the same inode; the tailer continues reading from it.
  • Disk space is reclaimed only when the last open fd to the inode is closed.
  • df reports filesystem-level usage including the orphaned inode, while du walks the directory tree and misses it, causing a discrepancy.
  • lsof | grep deleted (or lsof +L1) identifies processes holding deleted files open, which is the root cause of the space not being freed.

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