Preparing your design workspace

Loading the problem and your saved attempt…

Design and Implement a Path-Value File System

Model a small hierarchical path registry that creates paths with integer values and retrieves them safely.

For this exercise, assume an in-memory path-value file system exposes createPath(path, value) and get(path). Paths are absolute slash-separated strings. The root path exists but stores no user value.

createPath succeeds only when the path is valid, does not already exist, and its immediate parent exists; it creates exactly one node and associates the supplied integer value. get returns the stored value or a distinguishable NotFound result.

Reject empty paths, the root as a created path, trailing slashes, empty segments, dot segments, and duplicate creation. Preserve the hierarchy rather than treating paths as unrelated strings. Design the object model, public contracts, interactions, and errors, then implement the bounded createPath and get behavior.

Deletion, rename, file contents, permissions, links, persistence, and distributed coordination are outside scope.