Implement deleteDirectory in a Virtual File System

Asked at Google · Coding Questions · Difficulty: Medium

You are implementing a virtual file system. There is a method `list(path)` that returns all direct child paths under `path` (each child may be a file or a directory). Implement `deleteDirectory(path)` that recursively deletes the directory at `path` and all of its contents (files and subdirectories).

Loading the problem…