InterviewDB Experience

Backend Assignment Interview: Build a REST API for a Task Management Service

Backend Onsite

Interview Experience

Round 1 Coding

Problem

You are given a take-home backend assignment. Implement a REST API for a task management service with the following requirements:

  • POST /tasks — create a task with title, description, status (todo/in_progress/done), due_date
  • GET /tasks — list all tasks; support filtering by status and sorting by due_date
  • GET /tasks/{id} — retrieve a single task
  • PATCH /tasks/{id} — update task fields
  • DELETE /tasks/{id} — delete a task
python
# Expected request body for POST /tasks
{
  "title": "Write tests",
  "description": "Cover all edge cases",
  "status": "todo",
  "due_date": "2025-06-01"
}

Example

POST /tasks          -> 201 {"id": 1, "title": "Write tests", ...}
GET  /tasks?status=todo&sort=due_date  -> [{...}, ...]
PATCH /tasks/1       -> 200 {"id": 1, "status": "done", ...}
DELETE /tasks/1      -> 204

Follow-ups

  1. How do you validate the due_date format and reject invalid status values?
  2. What HTTP status codes do you return for a missing task or bad request body?
  3. How would you add user authentication so each user only sees their own tasks?
  4. Describe how you would write integration tests for the PATCH endpoint.

Full Details

Round 1 Coding

Problem

You are given a take-home backend assignment. Implement a REST API for a task management service with the following requirements:

  • POST /tasks — create a task with title, description, status (todo/in_progress/done), due_date
  • GET /tasks — list all tasks; support filtering by status and sorting by due_date
  • GET /tasks/{id} — retrieve a single task
  • PATCH /tasks/{id} — update task fields
  • DELETE /tasks/{id} — delete a task
python
# Expected request body for POST /tasks
{
  "title": "Write tests",
  "description": "Cover all edge cases",
  "status": "todo",
  "due_date": "2025-06-01"
}

Example

POST /tasks          -> 201 {"id": 1, "title": "Write tests", ...}
GET  /tasks?status=todo&sort=due_date  -> [{...}, ...]
PATCH /tasks/1       -> 200 {"id": 1, "status": "done", ...}
DELETE /tasks/1      -> 204

Follow-ups

  1. How do you validate the due_date format and reject invalid status values?
  2. What HTTP status codes do you return for a missing task or bad request body?
  3. How would you add user authentication so each user only sees their own tasks?
  4. Describe how you would write integration tests for the PATCH endpoint.

About This Question

This is a candidate experience report from a glean interview for a backend role during the onsite round.

It covers the following topics: Coding, Onsite .