Skip to content

Latest commit

 

History

History
73 lines (68 loc) · 1.87 KB

File metadata and controls

73 lines (68 loc) · 1.87 KB

Script

  1. Using the command line, make an HTTP GET request to the following endpoint and save the output to a local file called "users.json":
    http://localhost:5000/users

  2. Using Python 3, NodeJs, or Java 8, write a program to convert "users.json" into "users.csv". Only built in libraries are permitted.
    ## Solutions
    NodeJS

  3. Normalize Path Given a string s containing an absolute Unix-based directory path write a program hat normalizes this path using the following rules.
    •  Remove . from the path, which means stay in the same directory: /a/./b becomes /a/b
    •  Remove .. from the path, which means go to the parent directory: /a/../b becomes /b
    •  Remove consecutive / characters from the path: /a////b becomes /a/b
    •  Remove trailing / characters from the path: /a/b/ becomes /a/b
    •  Paths cannot go beyond the root directory: /../a becomes /a
    •  All other path characters are valid: ..., null, spaces.
    •  The method must return the normalized path a string.
     Input: "/usr/local/./../bin/."
     Output: "/usr/bin"
    
     Input: "/home/../.."  Output: "/"
     Input: "/etc/system/../../home/user"  Output: "/home/user"
    ## Solutions NodeJS

Operating System

  1. You run the command du over a filesystem. The file system is full, but if you look into it you see no files. What's happening? how can you solve it?
  2. You are logged in a shell, you try to run ps command and it fails with 'cannot fork' error while if you run echo it works. What's happening? how can you fix it?