Google swe sre Onsite round 1
- Posted
- 9 Dec 2025
Summary
I had an onsite interview for the SRE role at Google, where I was tasked with designing and implementing file system utility functions, including a crucial follow-up to delete an entire directory tree.
How it went
I recently had my first onsite interview round for the Software Engineer, Site Reliability Engineer (SRE) role at Google. The interview focused heavily on file system operations and design. I was initially asked to implement several core file system utility functions, which served as building blocks for a more complex problem. The primary challenge involved efficiently deleting a directory tree.
Questions asked (2)
- 01
File System Utility Functions
Data Structures & Algorithms
Implement the following file system utility functions which could be used to interact with a file system:
fs.GetDirectoryChildren(path): Given a path to a directory, return a list of its immediate children (files and subdirectories).fs.Delete(path): Delete a file or an empty directory at the given path.bool fs.IsDirectory(path): Determine if the given path corresponds to a directory.
- 02
Delete Directory Tree
Data Structures & Algorithms
As a follow-up, implement the function
deleteDirectoryTree(path). This function should recursively delete a directory and all its contents (subdirectories and files) starting from the given path. You should leverage the previously defined file system utility functions likeGetDirectoryChildren,Delete, andIsDirectoryto achieve this efficiently.