Object-Oriented Programming · DoorDash · Medium
Problem Design a hierarchical key-value store that organizes keys as directory-like paths (for example, /a/b/c). The store always starts with a root path / that holds the string value "root". You must support creating new paths under existing parents, assigning values to existing paths, reading values, and deleting leaf paths only — the root can never be removed. Implement the PathKeyValueStore class with the following methods: PathKeyValueStore(): Initializes the…