https://github.com/ethyca/python-takehome-2
https://github.com/ethyca/python-takehome-2
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ethyca/python-takehome-2
- Owner: ethyca
- Created: 2021-07-27T00:54:47.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-31T02:20:05.000Z (almost 5 years ago)
- Last Synced: 2025-05-25T04:33:59.197Z (about 1 year ago)
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ethyca Technical Challenge -- Open Source Engineer (Python)
## User Story
As a keen noughts and crosses (/tic-tac-toe) player (and aspiring champion), I need a web service that allows me to play against a computer via a REST API. The API must allow me to create a new game, make the next move in a game, and list all games previously played.
### Noughts and Crosses (Tic-tac-toe)
Tic-tac-toe (American English), noughts and crosses (British English) is a game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a diagonal, horizontal, or vertical row is the winner. ~It is a solved game with a forced draw assuming best play from both players.~
An example game series can be represented as:
```
# A blank board
[
[".", ".", "."],
[".", ".", "."],
[".", ".", "."],
]
# First move
[
[".", ".", "."],
[".", "X", "."],
[".", ".", "."],
]
# Second move
[
[".", ".", "."],
[".", "X", "."],
[".", ".", "O"],
]
# Third move
[
[".", ".", "X"],
[".", "X", "."],
["O", ".", "O"],
]
...and so forth
```
## Your Task
Use Python (any flavour) to develop a REST API that:
- Allows me to create a new game of Noughts and Crosses, and returns the game ID.
- Allows me to make the next move by specifying the co-ordinates I wish to move on. e.g. `{"x": 1, "y": 1}` would denote a move to the middle square by the requesting player, and returns the new state of the board _after_ the computer has made its move in turn. __Note: There is no need to create an AI opponent, random moves are fine__
- Allows me to view all moves in a game, chronologically ordered.
- Allows me to view all games I have played, chronologically ordered.
- Surprise us! Use your inherent style and panache to sprinkle that extra bit of gee-whizz atop your solution.
## Notes
- Please work independently without code review by others.
- It's our intention that you spend between 3 and 4 hours on this task.
- This challenge is deliberately vague on detail to give candidates the opportunity for a wide range of solutions. That being said, feel free to reach out and ask questions as needed.
- There is no 100% correct solution, be creative! We are just as interested in your approach to problem solving as we are in your actual solution.
- Remember that we'll schedule a debrief interview with you afterwards to discuss the code and ask questions, so you'll be able to explain what you've done!
- Code style, comments, and general code hygiene matter despite this being a test!
## Delivery
- Once completed, please create a README file describing:
- How to run your project (or where it is hosted),
- How much time you spent building the project,
- Any assumptions you made,
- Any trade-offs you made,
- Any special/unique features you added,
- Anything else you want us to know about,
- Any feedback you have on this technical challenge -- we care deeply about our hiring process here at Ethyca, and about the engineers who go through it (that's you!) -- we wholeheartedly promise any feedback will be met with a warm thank you!
- The assignment can be published and shared with us via any code sharing platform such as Github, Gitlab, or sent as a .zip file to the Ethyca employee who sent you this task.
- We'll review your submission in advance of your debrief interview, and look forward to talking to you about it!