Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4247204
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:04:35+00:00 2026-05-21T04:04:35+00:00

All, I was recently asked in one of the technical interviews to write a

  • 0

All,

I was recently asked in one of the technical interviews to write a high level design for a File Sysem. My answer to the question was as follows. I would request everyone to please review and let me know if there are suggestions/improvement:

  interface BaseFileSystem
{
    /*Basic file/folder attributes are:
      1. File/Folder Size
      2. File/Folder Date created
      3. File/Folder Date Modified
      4. File/Folder permissions - Read, write and execute
      5. File/Folder Owner - Owner of the file who defines permissions for other users
      6. File/Folder Visibility - Hidden or Visible
      7. File/Folder Name 

      Hence each one of the above attributes would have public <return type> get() and public void set<AttributeName>(<variable datatype>) */
}

public class File implements BaseFileSystem
{
       /*The `File` class should implement all of the methods from interface `BaseFilesystem`.
         In addition, it must also implement following specific methods that can only be associated with physical files*/

        public String getFileExtension(){….}

        public void setFileExtension(String value) {….}

        public String[] getAssociatedPrograms(){ …..}

        public void executable(){ …. };
}

public class Folder implements BaseFileSystem
{

      /*The `Folder` class should implement all of the methods from interface `BaseFileSystem`. In addition, it must also implement following specific methods that can only be associated with the physical 'folders'*/

        public BaseFileSystem[] getSubFoldersAndFiles(){ …. }

        public void addSubFolderAndFiles(BaseFileSystem fileObj) { …. }

        public void executable(){throw new UnsupportedOperationException();}
}

Additionally, any general pointers to such design questions would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:04:36+00:00Added an answer on May 21, 2026 at 4:04 am

    There are three essential operations, that are missing:

    • reading the contents of a file
    • writing the contents of a file
    • testing whether a BaseFileSystem is a File or a Folder

    On the other hand, there are some operations that I do not consider essential for a file system:

    • the file extension does not have any significance in all operating systems. Then why should a method exists for setting and retrieving it?
    • the associated programs only have a meaning in a single computer/os combination. In a general purpose file system, the programms might exists only temporarily (because a different os is booted or the device is moved). It should IMHO not be stored as part of the meta information of a file, because of separation of concerns.
    • public void executable() seems out of place. But this is only a guess, because I do not know what this method is supposed to do. If this executes an executable file: that should be done by the operating system manually. Also, it has no business being defined in class Folder.

    Furthermore, the attributes that you defined in BaseFileSystem make some assumptions about the requirements of the file system. Maybe your simple permissions system is not sufficient or the purpose of the file system and ACLs are needed. Maybe visibility is determined by the name of the file (like in UNIX). You should clarify that beforehand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently asked this question: Expose XML or Objects - thanks all for the
I was recently asked to write 3 test programs for a job. They would
This question was inspired by one I asked almost a year ago - any-orms-that-work-with-ms-access-for-prototyping
I recently asked a question about the same function, that solved my probelem and
I run my blog using Wordpress and all too recently became a big believer
We recently were given a client requirement to encrypt all their data while at
I just recently changed out all my hard drives and in the process of
Recently there has been quite some hype around all the different mocking frameworks in
I have recently started exploring Maven, but I feel a bit overwhelmed of all
I have recently learned the Ruby programming language, and all in all it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.