Thank you for your interest in being part of HexLabs Tech Team! We work across the stack on lots of projects used in our events and want to understand both your technical skills and interest in HexLabs. You will be working on a tiny API that hands out projects to judges at a hackathon expo, specifically implementing one function. We are interested in not just if you can complete this task but how well you understand your work and how the codebase works! Please read the README.md very carefully for the task requirements.
Please fork this repo, complete the task in your fork, and add the link to your fork in the form.
npm install
npm start # API on http://localhost:3000
npm test # run the testsNeeds Node 20+. There is nothing else to install: MongoDB runs in memory and is seeded on start. The first run downloads a MongoDB binary (~200MB), so it can take a minute.
10 projects (p1-p10), 12 judges (j1-j12), and assignments. An assignment links a judge to a
project and is either QUEUED (the judge is judging it now) or COMPLETED.
Implement assignNext(judgeId) in src/assign.ts. It backs POST /assign/:judgeId.
- A judge never gets a project they have been assigned before (any status).
- A project that another judge currently has
QUEUEDis not available. - Among the projects that are available, pick one with the fewest
COMPLETEDassignments. Break ties randomly. - A judge can hold only one
QUEUEDassignment at a time. If they already have one, returnjudge-busy. - If nothing is available, return
none-available.
The routes in src/app.ts already map those results to HTTP codes. Make npm test pass. Tests are not comprehensive.
Change whatever you need, but keep the assignNext(judgeId) signature and the seed data.