Coding

How would you code a function to add a directory to a file tree, insert a file into a chosen directory, navigate the file tree, and remove files or directories?

Frontend Engineer

Meta

Shopify

Lyft

Electronic Arts

Zynga

Atlassian

Did you come across this question in an interview?

  • How would you code a function to add a directory to a file tree, insert a file into a chosen directory, navigate the file tree, and remove files or directories?
  • Can you demonstrate how to write functions for creating and managing a file tree, including adding directories, inserting files, navigating the structure, and deleting elements?
  • What's your approach to developing a set of functions that manage a file tree, including directory creation, file addition, structure navigation, and element deletion?
  • In programming a file tree management system, how would you implement functions for directory creation, file insertion, tree navigation, and file or directory removal?
  • Could you show me how to write code for a file tree structure that allows adding directories, inserting files, navigating the tree, and deleting elements?
  • How do you envision constructing functions to create and manage a file tree, including adding directories, files, navigating the tree, and removing items?
  • In your experience, how do you create a comprehensive file tree management function set, covering directory and file additions, navigation, and deletions?
  • Can you outline a method for implementing a file tree system, focusing on functions for directory creation, file addition, tree exploration, and element removal?
  • What steps would you take to build functions for a file tree system that includes creating directories, adding files, navigating the structure, and deleting elements?
  • Implement a function to create a directory in a file tree structure. Write code to add a file to a specific directory in the file tree. Create a function to navigate through the file tree and display the file structure. Implement a method to delete a file or directory from the file tree.

Interview question asked to Frontend Engineers interviewing at Guerrilla Games, Hi-Rez Studios, Funcom and others: How would you code a function to add a directory to a file tree, insert a file into a chosen directory, navigate the file tree, and remove files or directories?.