Giter VIP home page Giter VIP logo

assignment's Introduction

Instructions for setting up and running your application and tests.

1. Install the dependencies

npm install

2. Run the application

npm run start

3. Run the tests

npm run test

A brief explanation of your design choices, particularly how you optimized for performance and scalability.

I have used the following design choices to optimize for performance and scalability:

  1. Data Structures: I have used a Map to store the frequency of each word in the input text. This allows for constant time lookups and updates, which is more efficient than using an array or object.

  2. Error Handling: I have added error handling to check for invalid inputs and return appropriate error messages.

  3. Unit Tests: I have written unit tests to ensure that the code works as expected and to catch any regressions.

  4. Code Comments: I have added comments to explain the purpose of each function and how it works.

  5. Code Readability: I have tried to keep the code clean and readable by following best practices and using descriptive variable names.

  6. Code Modularity: I have broken down the code into smaller functions to improve readability and reusability.

  7. Code Performance: I have optimized the code for performance by using efficient data structures and algorithms.

  8. Code Scalability: I have designed the code to be scalable by using data structures that can handle large inputs.

Assumptions you made during implementation.

  1. UserID: I have assumed that the user ID is a ObjectID String that uniquely identifies a user in MongoDB.

Test Cases

Test Cases

assignment's People

Contributors

abhi3566 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.