Micro Challenges

Quick drills on XPath, CSS selectors, Playwright locators, Unix commands, SQL, and HTTP status codes — the fundamentals interviewers reach for constantly.

0/40 correct · 0%
Score 60%+ to unlock a downloadable certificate.

XPath

Write an XPath for a button with the exact text "Submit".

Write an XPath for any div whose id starts with "panel-".

Write an XPath for the second li inside a ul with class "menu".

Write an XPath for an input whose placeholder attribute contains "search".

Write an XPath for an anchor (a) tag that is a direct child of a nav element.

Write an XPath selecting the parent of any element with class "error".

Write an XPath for a span whose text contains "Total:" anywhere in the page.

CSS Selectors

Write a CSS selector for a p element immediately after an h2.

Write a CSS selector for an input with placeholder="Enter email".

Write a CSS selector for an anchor whose href starts with "https".

Write a CSS selector for a div with class "modal" that is a direct child of #app.

Write a CSS selector for any input inside a form with class "login".

Write a CSS selector for the last li in a list.

Write a CSS selector for a button that is disabled.

Write a CSS selector for an element with both class "btn" and "primary".

Playwright Locators

Write a Playwright locator for a button with the accessible name "Save".

Write a Playwright locator for an input with placeholder "Email".

Write a Playwright locator for text matching exactly "Welcome back".

Write a Playwright locator for an element with data-testid="submit-btn".

Write a Playwright locator for the first element among all ".item" elements.

Write a Playwright locator for the input associated with a label "Username".

Unix Commands

Show the last 20 lines of a file called app.log.

Find all files named "*.test.js" under the current directory.

Count the number of lines in a file called data.csv.

Recursively search for the string "ERROR" in all files under the current directory.

Show which process is listening on port 8080.

Make script.sh executable for its owner.

SQL

Select all columns from a users table where email is 'a@b.com'.

Count the number of rows in an orders table.

Get the 5 highest-paid rows from an employees table (salary column).

Find duplicate emails in a users table.

Join orders to customers on customer_id, selecting customer name and order total.

HTTP Status Codes

What status code means "Created", typically after a successful POST?

What status code means the client sent a request the server can't parse?

What status code means the resource has moved permanently?

What status code means the client is sending too many requests (rate limited)?

What status code means the server understood the request but refuses to authorize it?

What status code means the requested resource doesn't exist?

What status code means the server hit an unexpected error?

What status code means the request succeeded but there's no content to send back?