Skip to content

Dhinaanithi/Freshwork-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freshworks Assignment



Freshworks Assignment

About

About

This Project was one of the Interview Round by Freshworks.

Problem Statement

Build a file-based key-value data store that supports the basic CRD (create, read, and delete) operations. This data store is meant to be used as local storage for one single process on one laptop. The datastore must be exposed as a library to clients that can instantiate a class and work with the data store.

Requirements

  • Python 3

How to use

from crud import CRUD # import the crud.py as Library

x = CRUD() # Instantiate the CRUD class

print(x.read()) # Access the class functions 

print(x.create("college","St.Joseph's Insitute of Technology"))

print(x.read())

print(x.update("college","St.Joseph's Insitute of Technology"))

print(x.delete("college"))

Operation Supported:

  • Create
  • Read
  • Update
  • Delete

Functionalities Supported:

  • It can be initialized using an optional file path. If one is not provided, it will reliably create itself in a reasonable location on the laptop.
  • A new key-value pair can be added to the data store using the Create operation. The key is always a string - capped at 32chars. The value is always a JSON object - capped at 16KB.
  • If Create is invoked for an existing key, an appropriate error must be returned
  • A Read operation on a key can be performed by providing the key, and receive the value in the response, as a JSON object.
  • A Delete operation can be performed by providing the key.
  • Appropriate error responses must always be returned to a client if it uses the data store in unexpected ways or breaches any limits.
  • The size of the file storing data must never exceed 1GB.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages