Please read the instructions and the requirements carefully before you start working on the assignment.
In case of any issues with the video, you can find the instruction video in the instruction_assets folder.
- The solution of the challenge should be inside the frontend folder.
- Specifically in the frontend/src folder.
- The frontend/src/App.css has a global css reset.
- You may modify/remove/restructure any file in the frontend/src/components folder as you see fit, but the assignment can be solved optimally with the existing structure/files as well
- All the assets are in the frontend/src/assets folder.
- The frontend/src/services has the socket service. It shouldn't be necessary to edit this.
- The colors can be found as css variables in the frontend/src/index.css file.
- As this project uses Redux Toolkit, you can find the typed
useAppSelector
anduseAppDispatch
hooks in the frontend/src/hooks/redux.ts file. - For the effects (such as the glow effects of the stock card) you need to replicate the effect as close as possible.
- Do not submit any changes to the backend and socket folders.
- You might find it helpful to reduce the update interval of the price updates during the development
- You might find it helpful to use tools/extensions such as
React Profiler
andRedux DevTools
. Please do not use tools such asLighthouse
to measure performance as the metrics are irrelevant for this project.
You need yarn version 2 or higher.
- Run
yarn install
in the root directory to install all the dependencies. - Run
yarn start
in the root directory to start all of the services - Go to http://127.0.0.1:5173/ to access the application
Before running the commands, make sure you have installed the dependencies first by running yarn install
in all
the directories.
- Start the mocked backend server in backend by running
yarn start
- Start the mocked socket server in socket by running
yarn start
- Start the development server in frontend by running
yarn dev
You should push the starting project monorepo to a private (personal) repository (Such as GitHub, GitLab ...)
- The starting project should be on the
main
branch. - The solution should be on a separate branch
- There should be an opened pull request from the solution branch to the
main
branch - The pull request should have a description of the changes
- There should be an opened pull request from the solution branch to the
- Once you're done, make the repository public and let us know by sharing its URL via email!
You need to replicate the functionality and design as closely as possible to what is shown in the videos and images.
- Fully replicate the card , including:
- Shake Animation (It is provided in the CSS)
- The Glow states
- The scaling and glow on user interaction (select/unselected)
- The trend indicator (red/green arrows)
- The implementation of the
SymbolCard
should be as granular as possible, i.e. SymbolCard should be a "smart" component built with "dumb" components.
- The Cards container
- Visually
- The scroll behavior
- The layout change between desktop and mobile devices.
- Price chart should be visible only when a card is selected.
- "+info" functionality (Show/hide the info on the cards)
- Persistence of the active/selected card when navigating to other tabs.
- Responsiveness
- Performance is critical!
- Formatting of the currency
- Improve initial loading time (do not try to measure, think of bundle size)
- Fix race condition (Price History chart)
- Follow established guidelines/practices in the project, such as:
- Components structure
- Imports/exports
- Leverage Redux/RTK
- React Dev Tools is your friend
- The final solution should be highly optimized and implemented as efficiently as possible. In other words, the number of re-renders of the components and the bundle size on initial load should be as low
as possible. For example:
- When the effects are active (shaking, glowing, etc.) the children of the component should not be re-rendered.
- You should avoid re-rendering the whole component when only a part of it needs to be updated.
- (Hint: For the initial bundle size, in router/index.ts, something combined with
Suspense
will get you there.)
- Please ensure that the code you submit reflects your best work and you use best practices.
- The commit history should be granular with descriptive commit comments
- You should write custom CSS (in other words, do not use UI Libraries). Using BEM methodology for CSS classes is a nice to have but not required.
- You can use postcss, sass, less, etc. if you prefer.
- Avoid writing inline styles.
The layout consists of a heading
,info cards
, news cards
, navigation
, stock cards list
and price chart
.
You only need to take care of the stock cards list
part
The layout should be responsive and should be able to be displayed on desktop, tablet and mobile devices.
- On desktop devices the price chart should take
400px
of the width. The remaining width should be used for the stock cards list. - On tablet/mobile and other devices with screen smaller than
1024px
, the price chart should be displayed above the stock cards list.
The cards should be displayed in a responsive container. The container should take the remaining of the height from the page
- bellow the title and navigation on desktop
- bellow the title, navigation and chart on tablet/mobile
- The user should be able to select a stock card by clicking on it. When a card is selected, it should be highlighted with black shadow and scaled up by around 2-4%. (Check video/images)
- If there is an active/selected card, the other cards should be scaled down by around 2-4%. (Check video/images)
The price history chart shows the price history of the selected stock. It should be visible only when a stock is selected. The API call functionality is implemented. There is a flaw in the implementation in the hook which can cause unintended behaviour. Try to fix this.
(Hint: The flaw is in the useEffect
hook. If for any reason the user has a slow connection,
sometimes the price chart won't behave as expected)
The stock card should be a responsive component.
- Default (no trend)
- Positive trend (green upwards arrow)
- Negative trend (red downwards arrows)
-
Header: Header title is the stock symbol. On the right side of the header there is a trend marker (only if the trend is available)
-
Trend Marker: Some stocks may have a positive or negative trend which is indicated by green (positive) and red (negative) arrows. Assets for this can be found in the frontend/src/assets folder.
-
assets
folder. -
Price (in USD): Formatted price of the stock.
-
Company Name, Industry and Market cap: Info fields about the stock. Assets for this can be found in the frontend/src/assets folder.
- If the price changes for more than 25% from the previous price, the card should shake
- The shake animation class can be found in the frontend/src/components/SymbolCard/symbolCard.css
symbolCard__shake
.
- The shake animation class can be found in the frontend/src/components/SymbolCard/symbolCard.css
- If the
last price
change ispositive
, the card should flash withgreen shadow
. (Check videos) - If the
last price
change isnegative
, the card should flash withred shadow
. (Check videos) - If the card is currently selected, it should have a black shadow around it. (Check videos)
- NOTE: The flashing shadow from the price changes takes precedence over the black shadow that is shown when a card is selected. (Check videos)
--- GOOD LUCK ---
If you have any questions, please send email to hiring.tech@mrq.com .