Candidate implementation:
My solution for this assignment is in thetask-apidirectory:
- Main implementation README:
task-api/README.md- Bug report:
task-api/BUG_REPORT.md- Notes (coverage, next tests, questions):
task-api/NOTES.md
A 2-day take-home assignment. You'll read unfamiliar code, write tests, track down bugs, and ship a small feature.
Read ASSIGNMENT.md for the full brief before you start.
You're welcome to use AI tools. What we're evaluating is your ability to read and reason about unfamiliar code — so your submission should reflect your own understanding, not just generated output.
Concretely:
- For each bug you report: include where in the code it lives and why it happens
- For the feature you implement: briefly explain the design decisions you made
- If something surprised you or you had to make a tradeoff, say so
Prerequisites: Node.js 18+
cd task-api
npm install
npm start # runs on http://localhost:3000Tests:
npm test # run test suite
npm run coverage # run with coverage reporttask-api/
src/
app.js # Express app setup
routes/tasks.js # Route handlers
services/taskService.js # Business logic + in-memory data store
utils/validators.js # Input validation helpers
tests/ # Your tests go here
package.json
jest.config.js
ASSIGNMENT.md # Full brief — read this first
The data store is in-memory. It resets every time the server restarts.
| Method | Path | Description |
|---|---|---|
GET |
/tasks |
List all tasks. Supports ?status=, ?page=, ?limit= |
POST |
/tasks |
Create a new task |
PUT |
/tasks/:id |
Full update of a task |
DELETE |
/tasks/:id |
Delete a task (returns 204) |
PATCH |
/tasks/:id/complete |
Mark a task as complete |
GET |
/tasks/stats |
Counts by status + overdue count |
PATCH |
/tasks/:id/assign |
Assign a task to a user (to implement) |
{
"id": "uuid",
"title": "string",
"description": "string",
"status": "pending | in-progress | completed",
"priority": "low | medium | high",
"dueDate": "ISO 8601 or null",
"completedAt": "ISO 8601 or null",
"createdAt": "ISO 8601"
}Create a task
curl -X POST http://localhost:3000/tasks \
-H "Content-Type: application/json" \
-d '{"title": "Write tests", "priority": "high"}'List tasks with filter
curl "http://localhost:3000/tasks?status=pending&page=1&limit=10"Mark complete
curl -X PATCH http://localhost:3000/tasks/<id>/completeSee ASSIGNMENT.md for full submission requirements. At minimum, include:
- Test files — covering the endpoints and edge cases you identified
- Bug report — what you found, where in the code, and why it's a bug (not just symptoms)
- At least one fix — with a note on your approach
PATCH /tasks/:id/assignimplementation — plus a short explanation of any design decisions (validation, edge cases, etc.)