Back to all questionsCoding
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?
Tags
Data Analyst
Marketer
General
Use a recursive tree structure with clear interfaces for each operation, and handle edge cases like duplicate names or deleting non-empty directories.
Companies Asking this quesiton.
Very hard Difficulty
Very-hard questions are the ultimate test of your expertise and preparation. They demand not just knowledge, but creativity and strategic thinking, often addressing unique or highly technical aspects of your field.
Coding question
Coding questions assess your programming abilities and thought process. Showcase your problem-solving approach, coding style, knowledge of data structures, and ability to write clean, efficient, and maintainable code.