FastPrepWorkspace File System With Folders and Tables
Problems/Workspace File System With Folders and Tables

Workspace File System With Folders and Tables

Clay logoClay● MediumFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: A reported Clay workspace-file-system question specifies in-memory folders and tabular elements with creation, direct enumeration, and cascading removal. This executable command encoding and error behavior are declared adapters; the judged core matches about 95%.

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.

More Clay problems

  • Employee Count Median, Mean and ModePHONE SCREEN · Seen Nov 2026
  • Hierarchical In-Memory File SystemPHONE SCREEN · Seen Sep 2026
  • Minesweeper Board UpdateONSITE INTERVIEW · Seen Apr 2025
See Clay hiring insights
Saved
class Solution {
    public String[] runWorkspaceFileSystem(String[][] operations) {
      // Write your code here.
    }

}
Checking account…