Welcome to the Task Tracker API coding test! This test is designed to assess your skills in creating a production-quality RESTful API using Java, PostgreSQL, and robust error handling. Please read the instructions carefully and follow the steps to complete the test.
- Unless otherwise stated, please use JAVA.
Your task is to create a robust and production-quality RESTful API for a task tracking application using a PostgreSQL database as the backend store. The API should allow users to perform CRUD (Create, Read, Update, Delete) operations on tasks, with comprehensive error handling and data validation.
Each task has the following properties:
id
(String): Unique identifier for the task.title
(String): Title of the task.description
(String): Description of the task.dueDate
(Date): Due date of the task.
You need to implement the following endpoints:
POST /tasks
: Create a new task.GET /tasks/{id}
: Retrieve a task by its ID.GET /tasks
: Retrieve a list of all tasks.PUT /tasks/{id}
: Update an existing task by its ID.DELETE /tasks/{id}
: Delete a task by its ID.
- Set up a PostgreSQL database. Create a table named
tasks
with columnsid
,title
,description
, anddue_date
. - Implement comprehensive error handling for various scenarios, including invalid input data, database errors, and unexpected situations.
- Use appropriate HTTP status codes and response messages to communicate errors clearly to clients.
- Implement data validation to ensure that only valid and properly formatted data is stored in the database.
- Implement appropriate logging mechanisms to capture errors and important events.
- Write clean, well-documented, and modular code following best practices for Java development.
- Include unit tests and integration tests to ensure the correctness of your API and its error-handling capabilities.
- Include detailed instructions in the
README
file on setting up the database, building, testing, and running your API. - Once you're done, share the link to your repository with us.
You will be evaluated based on:
- Correctness and completeness of the implemented API endpoints with PostgreSQL integration and robust error handling.
- Comprehensive error handling and data validation for various scenarios.
- Effective usage of HTTP status codes, response messages, and logging mechanisms.
- Code quality, including readability, modularity, adherence to best practices, and proper use of design patterns.
- Thorough unit tests and integration tests covering different error scenarios.
- Documentation and instructions provided in the
README
file.
We're excited to review your submission and see your skills in action. Good luck!