SoftwareTestPilot
LearnCoding RoundsCommunityJobsQA Resources
All questions
BasicAPI testing~5 min

API: health-check endpoint

Warm-up in API automation rounds

Points available

100/100

Your mission

  1. Read
  2. 2Run
  3. 3Submit
  4. 4Solve

request works like Playwright's APIRequestContext (get, post, ... returning a response with status(), ok(), json(), headers()).

Write isHealthy(request) that calls GET /health and returns true only if the status is 200 and the body's status is "up".

`request` works like Playwright's API client: get/post/put/patch/delete with headers, params and data; responses have status(), ok(), json() and headers(). Create one yourself with mockApi({ "GET /health": { status: 200, body: { status: "up" } } }) to experiment.

Hints

Each hint costs 10 points on a full solve.

Interviewer follow-ups

  • Which edge cases would you add?
  • How would this look in your real framework?

Ctrl+Enter to run · add Shift to submit

1
2
3
4
Tab inserts two spaces. Press Escape, then Tab, to leave the editor.
Terminal

$ node solution.js

Run executes the open file. Submit scores solution.js against hidden tests.

SoftwareTestPilot

Learn QA, prove your skills, connect with testers and grow your career.

Platform
  • Learn
  • Community
  • Jobs
Resources
  • QA Resources
  • Interview Questions
  • QA Tools
  • Articles
  • Products
Company
  • About
  • Contact
  • Authors & Reviewers
  • Editorial Policy
  • Sitemap
© 2026 SoftwareTestPilot. All rights reserved.
Operated by SoftwareTestPilot · Pune, Maharashtra, India · softwaretestingsapiens@gmail.com
PrivacyTermsCookiesDisclaimerRefundsAccessibility