marcellodesales / in-memory-fs-coinbase

Design an in-memory file-system problem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In-memory File-system Problem

This is an implementation of an in-memory file-system + Web Service.

Problem asked during interviews with Coinbase

Setup

pip install -r requirements.txt

Core

Support: features implemented

  • mkdir: creates dir
  • write_file: creates file
  • read_file: read contents
  • read_dir: list the contents of dir

API

Run ws.py and go to localhost:8000/docs

Screen Shot 2022-03-29 at 9 33 50 PM

HTTP POST /fs/{path}

creates new dir or file

HTTP GET /fs/{path}

retrieves info about dir or file

HTTP HEAD /fs/{path}

verifies if the given path exists

HTTP DELETE: /fs/{path}

deletes the given path if it's file or empty dir

About

Design an in-memory file-system problem


Languages

Language:Python 100.0%