daltlc / front-end-interview

Front-End Interview Exercises

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

front-end-interview

Front-End Interview Exercises

First, Do This

  1. Make sure you have Git >= 2.13.2, Node.js >= 8.6.0 and Yarn package manager installed on your computer.
  2. Fork and clone this repository locally.
  3. Run yarn to install all the dependencies.
  4. Run yarn start to start the app in a new browser window (http://localhost:8080/). Each time you save changes to a file, the browser will reload with those changes.

Checkers

You are given a React app that renders a Checkers board.

Modify the existing code to create a functional Checkers game, by implementing these user requirements:

  1. As a user, I want to move any piece to any space it is allowed to go, so that the board is correctly updated as a result of that move.
    1. If a piece is captured, it is removed from the board.
    2. If a piece reaches the opposite side, it becomes a king.
    3. The "movement" interaction is up to you. It can be with simple mouse clicks, drag-n-drop if you're up for a challenge, or even the keyboard if you wish.
  2. As a user, I want to be able to take turns alternating between two local human players, so that Player One takes as many turns as possible and then Player Two does the same and so on until the game ends.
    1. If a player is allowed to make multiple moves, they are allowed to do so before the other player moves again.
    2. If the next player can't make a move or has no more pieces, they lose.

The rules of Checkers are available here.

Screenshot

Troubleshooting

Note: This is an incomplete list of errors. Feel free to make a pull request or add issues if you run across any bugs or issues.

Git Version

error: cannot spawn .git/hooks/pre-commit: No such file or directory on Windows

This error is caused by a requirement of Husky to be running git version 2.13.2 or later.

If you see this error on the command line version of git, you can update it by following these instructions.

If you ran into this error on a git client (such as GitHub Desktop), you may need to update your client as some clients have their own embedded version of git.

About

Front-End Interview Exercises


Languages

Language:JavaScript 100.0%