Facebook Pixel

File Explorer: Complete Interview Checklist

The complete checklist for building a file explorer in a machine coding interview.

File Explorer: Complete Interview Checklist

Core Features

  • Tree data structure (name, type, children).
  • Recursive render function.
  • Expand/collapse on folder click.
  • Icons for files and folders.
  • Indentation based on depth.
  • stopPropagation on child clicks.

Advanced Features

  • Expand all / collapse all buttons.
  • File type icons (by extension).
  • Search files.
  • Context menu (right-click).
  • Active file highlight.
  • Drag and drop to move files.

CSS

  • Hover state on tree nodes.
  • Cursor pointer for folders.
  • Font weight for folders (bold).
  • Scrollable container (overflow: auto).
  • Consistent indentation.

Testing

  • Test: expand/collapse folders.
  • Test: nested folders (3+ levels).
  • Test: empty folders.
  • Test: files at root level.
  • Test: click does not toggle parent.

The Takeaway

Checklist: core (tree data, recursion, expand/collapse, icons, indentation, stopPropagation), advanced (expand/collapse all, file icons, search, context menu, active highlight, drag and drop), CSS (hover, cursor, scrollable), and testing (expand/collapse, nesting, empty folders, root files, stopPropagation).

Core (tree data, recursive render, expand/collapse, icons, indentation, stopPropagation), advanced (expand/collapse all, file type icons, search, context menu, active highlight, drag and drop), CSS (hover, cursor, scrollable), and testing (expand/collapse, nesting, empty folders, root files, no parent toggle on child click).

Tree data structure, recursive rendering, expand/collapse on click, icons for files/folders, indentation by depth, and stopPropagation to prevent child clicks from toggling parents. These are the minimum required features.

Expand/collapse all buttons, file type icons by extension, search files, context menu (right-click with rename/delete/new), active file highlight, and drag and drop to move files. Add these after the core works.

Test expand/collapse on folders, nested folders (3+ levels), empty folders (should not expand), files at root level, and verify clicking a child does not toggle the parent (stopPropagation).

Hover state (.tree-node:hover { background: #e0e0e0; }), cursor: pointer for folders, font-weight: bold for folders, a scrollable container (overflow: auto), and consistent indentation (paddingLeft: depth * 20).

Ready to master React completely?

Want to upskill yourself, crack your next interview, and get your dream job? Join our comprehensive course to dive deeper with high-quality video tutorials, solve interview questions, and a premium community.

Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.