This fork is a complete re-write of the existing backend and frontend. The backend, including the tests, have been rewritten to utilize a websocket approach. This, in my opinion, is a much more idiomatic way to handle a multiplayer game that is contingeant on latency and conccurent connections. The frontend has been built out to have a lobby system + UI improvements.
- Any time a player initializes the websocket connection, they will be required to enter a name.
- You will then be allowed to join existing game rooms or create one
- When you are in a room, it will display the other players present and an invite link
- You can then configure the number of questions (length of game) and start
- Once the game starts, there is a countdown and the game begins
- A player loses 10 points for incorrect answers and gains 10 points for correct answers.
- Due to mutex locking on the backend + websocket paradigm, only one player can answer a question correctly per question.
- After the game, the final scores are displayed and the game can be replayed.
Welcome to CapTrivia, a cap table trivia game developed by Pulley. This project is part of our engineering interview process, designed to assess your coding skills and problem-solving abilities. Currently, CapTrivia is a simple, single-player game. Your challenge is to develop it into a multiplayer experience.
- Current State: CapTrivia is a functioning single-player game with basic features. We tried our best to make it very ugly so that you have lots of room to improve it!
- Tech Stack: The front end is built with React (in
App.js
), and the back end with Go (inmain.go
). We also included a docker-compose.yml so that you can easily run this locally (it includes a PostgreSQL instance). - Objective: Transform CapTrivia into a multiplayer game where users can create games, invite others via a shareable link, and compete in real-time trivia challenges.
- Make sure you have Docker installed. https://docs.docker.com/engine/install/
- In the captrivia root directory, run
docker compose up
. - Open http://localhost:3000 in your browser to see the game.
Please complete the task appropriate to the position you are applying for.
- Refactor and Enhance: The current code is intentionally basic and contained in single files for both front and back ends. Your first task is to clean up and structure the codebase.
- Implement Multiplayer Functionality:
- Allow users to start a new game and generate a shareable link.
- Enable real-time joining of players in a waiting room.
- Implement a countdown and start the game simultaneously for all players.
- Introduce a scoring system with a configurable number of questions (default: 10).
- Players will compete to answer each question first. For each question, the player who answers first gets the points.
- Display the winner at the end and allow users to start new games.
Your task is to build a data pipeline to record and visualize analytics information about a player's performance.
- Stand up an analytics database: you may use the existing PostgreSQL database in the docker-compose.yml, or any other database of your choice.
- Instrument the backend application to report data on each answered question to the database.
- Start up the bot provided in bot to start playing games and feeding data into your database. Right now the bot uses a very simple strategy (always choosing the first answer); you will likely want to change its strategy to create more interesting data. If you like, your bot can "cheat" by using questions.json to sometimes figure out the right answer.
- Build and display some simple analytics on top of your analytics database.
There is no time restrictions on this challenge, you can take as much time as you need. This is to allow folks who might not know the tech stack to spend time learning or if you wanted to take the challenge to the next level. The most important part is achieving the task above.
As a baseline for someone proficient in the stack we expect this challenge to take around 3-5 hours. This figure is only to help set your own expectations about how much time you may need to allocate to complete it.
- Zip File: Zip up the code directory and send it to us. Please make sure you delete
node_modules
and any Go binaries that would bloat the zip. Leaving the.git
directory is preferred so we can see the history of how you implemented your solution. To automatically clean files that are not in git, you can usegit clean -fdx
(with appropriate caution as this deletes files). - Running Locally: Please ensure that we can run your version with
docker compose up
.
- Code Quality: Clean, readable, and well-structured code.
- Problem Solving: Effective and efficient solutions to the challenges presented.
- Creativity: We appreciate innovative approaches and ideas.
- Tool Utilization: Feel free to use tools like GitHub Copilot and ChatGPT. We value efficiency and resourcefulness.
Once we receive your solution, we'll schedule a live code pairing session. Here, you'll walk us through your code, and we'll collaboratively work on an additional small feature.
Thank you for participating in Pulley's engineering challenge. We're excited to see your approach to enhancing CapTrivia. Good luck, and have fun!