Harvey Software Engineer Interview Experience — A File System Design Screen With a Confusing Interviewer

Harvey·Software Engineer·Jul 2025
Technical ScreenIn progressmedium

The file system question that's been going around the forum. Here's my report.

Similar to a file system — implement two functions:

  • addFile(String path): given a string like "path/to/somewhere/file.txt", store this file.
  • getFile(String path): given "path/to/somewhere", return the content of file.txt; given "path/to", return the folder "somewhere".

There wasn't much of a self-introduction, we jumped right in. The interviewer was American, but his English was honestly hard to follow. He explained the problem once and I didn't catch it, so I just read it myself — pretty blunt intro. I just added a dict of dict and passed it down level by level, that's it.

Follow-up 1: each level can have at most 5 things (including folders and files) — once the current level's keys exceed 5, you can't add a new folder or file, even for just one new path. Just brute-force count the keys.

Follow-up 2: if there's a duplicate name, you need to handle it the way an OS does — file.txt, file(1).txt, file(2).txt. Just parse it (split around the ".") and maintain a counter that increments. One test case was add(file.txt), add(file.txt), add(file(1).txt), and the expected result was file.txt, file(1).txt, file(1)(1).txt. The interviewer struggled with this test case himself for a while, then after running it asked me if I understood what these test cases were checking. This requirement was never mentioned the whole time — he didn't explain when I asked, and he didn't say anything while he was fumbling through writing it either (how was I supposed to know what he wanted?). But my answer was correct.

There was also a follow-up on how to tell if two files are the same. Thanks to the forum write-ups, I'd prepared for this one — I answered with file hashing, like SHA-256 and MD5.

Passed.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Harvey
Role
Software Engineer
Rounds
Technical Screen
Outcome
In progress
Difficulty
medium
Interview date
Jul 2025
Questions from this interview
1 question

Real Harvey interview experiences

First-hand reports from Harvey candidates — the rounds, the questions they were asked, and how it went.

All 6 Harvey interview experiences