Design an In-Memory File System
A file system tree built on the Composite pattern: a directory's size is its children's, paths normalised as text then walked with the error a shell would give, mkdir and mkdir -p, mv's four outcomes and its cycle check, a byte quota checked inside the lock, and one lock for the whole tree.
01 · Two classes, one shell
LLD-17 · Design an In-Memory File System
mkdir -p, ls, cat, mv, du. Two classes, one interface.
Build the shell's file system
Make directory with dash p.
0:00 / 13:42