This is a small exercise designed to evaluate your ability to create test cases.
Please read the instructions carefully to ensure a fair and accurate assessment.

Successfully completing this exercise will significantly increase your chances of securing a position with us.

Challenge


You will be using a public API for this exercise. We do not manage this API, so Create, Update, and Delete methods will not impact the database; the API is primarily for testing purposes. Since this API is public, no credentials or tokens are required.

Create Test Cases

Write two positive and two negative test cases for each method to verify the API works as expected.



API Endpoint

Base URL: https://jsonplaceholder.typicode.com

Endpoint: /posts

Example: Method: GET, Endpoint: https://jsonplaceholder.typicode.com/posts



Available Operations

  • GET /posts: Fetch all posts
  • Expected Response:
    • Status code: 200
    • Response Object: JSON list of all posts

  • GET /posts/id: Fetch a post by ID
  • Expected Response:
    • Status code: 200
    • Response Object: Post object in JSON format

  • POST /posts Create a new post
    • Body:
    • { "title": "title field expects a string", "body": "body field expects a string", "userId": 1 }
    Expected Response:
    • Status code: 201
    • Response Object: Post object in JSON format

  • PUT /posts/id Update a Post
    • Body:
    • { "id": 1, "title": "Updated post title", "body": "Updated content of the post.", "userId": 1 }
    Expected Response:
    • Status code: 200
    • Response Object: Post object in JSON format

  • DELETE /posts/id: Delete a Post
  • Expected Response:
    • Status code: 200

Use any text editor you prefer to complete this exercise. Once completed, upload your solution along with a detailed explanation to a public GitHub repository or any public file hosting service.