Reported September 2026
Claydesign

Workspace File System With Folders and Tables

Reported by candidates from Clay's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Clay OA. Under 2s to a working solution.
Founder's read

Clay put a workspace file system question in front of candidates in September 2026, and the whole thing hinges on one data structure: a tree of nodes keyed by path segment. You get folders, tables, recursive creation, sorted listing and cascading delete. None of it is hard alone. The risk is a pile of small edge cases in one design problem. If you've got an OA invite, expect to build this fast and cleanly. StealthCoder is the safety net if you blank mid-assessment, but the structure below should get you most of the way there.

The problem

Model a workspace containing folders and table items.
CREATE_FOLDER path recursively creates missing folders and returns whether no table blocks the path.
CREATE_TABLE path creates a table when its parent folder exists and the path is unused.
LIST path returns direct children sorted as comma-separated F:name and T:name.
DELETE path removes a table, or a folder and all nested folders and tables. Root cannot be deleted.
Return one string per operation.

Function
runWorkspaceFileSystem(operations: String[][]) → String[]

Examples
Example 1
operations = [["CREATE_FOLDER","/sales/2026"],["CREATE_TABLE","/sales/2026/q1"],["LIST","/sales/2026"],["DELETE","/sales"],["LIST","/"]]
return = ["true","true","T:q1","true",""]
Folder creation is recursive and deletion cascades through the table.
Example 2
operations = [["CREATE_FOLDER","/b"],["CREATE_FOLDER","/a"],["CREATE_TABLE","/z"],["LIST","/"]]
return = ["true","true","true","F:a,F:b,T:z"]
Direct children are typed and sorted.

Constraints
1 <= operations.length <= 10000
Paths are normalized absolute paths.
Each path is either a folder or a table, never both.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Build a trie-style tree. Each node has a type (folder or table) and a map of children keyed by name. Split the path on slash and walk from the root. CREATE_FOLDER walks segment by segment, creating missing folders, and returns false the moment it hits a table. CREATE_TABLE needs the parent to exist as a folder and the final name to be unused, otherwise false. LIST sorts the direct children and formats them as F:name or T:name. Check example 2: F:a,F:b,T:z, so sort by name and check whether sorting should put folders first or just go alphabetically by the example. DELETE removes the node from its parent's map, and garbage collection handles the subtree. Pitfalls: deleting root, listing a path that doesn't exist, listing a table, and splitting the root path into an empty segment list. Pick return values for those and stay consistent. If you freeze live, StealthCoder can hand you a working skeleton as a hedge.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Workspace File System With Folders and Tables cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as design in memory file system. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Clay's OA.

Clay reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Workspace File System With Folders and Tables FAQ

What's the core trick in the Clay workspace file system problem?+

Model it as a tree where each node stores a type and a children map. Every operation splits the path on slash and walks from the root. Once the walk helper is solid, create, list and delete are each a few lines on top of it.

How hard is this OA really?+

Medium on difficulty, but wide on edge cases. There's no clever algorithm. You're graded on clean design and handling cases like a table blocking a folder path, a missing parent, or deleting the root. Careful reading beats speed here.

How should LIST sort its output?+

Collect the direct children of the node, sort them by name, then prefix each with F: or T: based on node type. Example 2 shows F:a,F:b,T:z, which is consistent with plain name sorting. Check the order against both examples before you submit.

Do I need recursion for DELETE?+

No. Remove the target from its parent's children map and the whole subtree goes with it. Just block deleting the root first. Recursion is only needed if you track extra state like counts, and this problem doesn't ask for that.

How do I prepare for this in 48 hours?+

Write a small in-memory file system from scratch twice, with mkdir, create, ls and rm. Practice splitting paths and walking a nested map. Then test the weird cases: a table in the middle of a path, the root path, and a missing parent.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Clay.

OA at Clay?
Invisible during screen share
Get it