This project was bootstrapped with Create React App.
In the project directory, you can run:
To install dependency packages
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Assignment and Instructions: A retailer offers a rewards program to its customers, awarding points based on each recorded purchase. A customer receives 2 points for every dollar spent over $100 in each transaction, plus 1 point for every dollar spent over $50 in each transaction (e.g. a $120 purchase = 2x$20 + 1x$50 = 90 points). Given a record of every transaction during a three month period, calculate the reward points earned for each customer per month and total.
###Checklist
-
Goal of the assignment: showcase great craftsmanship in area of REACT JS. Solution should be designed in a way that shows healthy architecture (solutions with 2-3 files will not be accepted). Solution should show the data flow and good practices in working with backend from the UI perspective
-
Time required: anywhere between 3-6h depending on proficiency
-
Technical guidelines:
- Can use https://create-react-app.dev/ to get started quickly
- avoid additional frameworks and Typescript – only REACT JS
- Make up a data set to best demonstrate your solution (can use tools to generate data or manually create some data)
- Check solution into GitHub and share the URL(Make it Public)
- Plan your code composition structure (e.g separate service to simulate API request, separate file to calculate points, split UI into few readable files, etc.)
- No hardcoded / magic numbers. Use constant definitions/dynamic props
- Code should be clean, nicely formatted, easy to read and understand and follow best practices
- UI needs to be reasonably OK. Not expecting a fancy UI.
- No errors or warnings in runtime
- Code must compile and run, there should be an instruction in README.md file how to run the application.
- Nice to have: unit tests
- Nice to have: error handling after loading application
- Nice to have: handling of data loading – e.g. spinner