Giter Club home page Giter Club logo

5-star-rating-system's Introduction

Star Rating System

Goal

The goal of this assessment is to evaluate your capabilities with React, familiarity with modern web development practices, and code cleanliness.

Problem Statement

Implement a 5-star rating system (like you would use on Yelp or Uber). When you click on one of the stars, it will fill that star and all the stars up until that one (i.e. when you select the third star, the first, second, and third stars become filled).

You should implement this using React and in the project scaffolding provided. You have up to 2 hours to complete the assessment but do not feel compelled to spend the full 2 hours if you complete the assessment early.

Please attempt this problem by completing the following requirements in order. Even if you do not complete all the requirements, please submit what you have.

Requirements

  1. Displays 5 empty stars.
  2. When you click on a star, it will fill that star and all the stars up until that one. The remaining stars stay empty.
  3. When the user hovers over a star, it will fill or highlight that star and all the stars up until that one.
  4. Make total number of stars dynamic based on a prop passed into the RatingSystem component.
  5. When the user clicks the same star twice, it resets the selected stars.

Running Locally

The assessment requires Node 10 LTS or above. You can download & install Node.JS here.

  1. Clone the repo locally, run git clone <hackerrank repo url> in your terminal.
  2. Go into the directory, run cd <repo name> in your terminal.
  3. Install dependencies, run npm install in your terminal.
  4. Run the app, run npm start in your terminal.
  5. Open http://localhost:8000 to view it in the browser. The page will reload if you make edits. You will also see any lint errors in the console.

Making Changes

The browser should automatically reload whenever you save your changes. However, if the browser is not automatically reloading, sometimes a page refresh is needed.

Feel free to refactor src/App.js. You can use it as guidance but don't feel obligated to keep or use any of the code that is currently there.

Committing Changes

  1. Use git to commit your changes by running git add <filename> then git commit <filename> in your terminal.

  2. Push your changes back up to HackerRank by running git push origin master in your terminal.

Submitting Work

When you are done with the assessment, submit the work on HackerRank. Double check your work has been correctly pushed up to HackerRank.

Please contact your recruiter if you're having any setup or submission issues.

Good luck!

This project was bootstrapped with Create React App.

5-star-rating-system's People

Contributors

kadijahw avatar

Watchers

 avatar  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.