Skip to content

Job simulations / FREE RESOURCE

Backend job simulation: support ticket API

Design and implement a small PHP API with validation and ownership checks.

2026 edition · By EgoTECH · No login required
← All job simulations

Fictional practice brief · Suggested effort: 2–4 hours · Not a job offer, hiring test or certificate.

Your assignment

A fictional help desk needs student support tickets. A student may read only their tickets; an agent may view all. Implement locally with synthetic accounts, and document your authentication assumption.

Download starter brief / data

1. Write the contract

Define GET /tickets and POST /tickets, required fields, allowed statuses, response shapes and error codes. Include pagination.

2. Implement safely

Use a local database or a repository abstraction. Validate subject length, reject invalid statuses and enforce ownership on the server.

3. Prove failure behavior

Test missing subject, unknown ticket, another user’s ticket, duplicate submission and a database failure. Do not expose raw exceptions.

4. Deliver the review

Include schema, seed data, sample requests, test results and a short note on what must change before production.

Review your submission

Choose 0 = missing, 1 = partial, or 2 = demonstrated with evidence. The result is your self-assessment.

Self-review: 0 / 8

Reviewer guidance

Start with a small contract and an explicit current-user boundary. Filter reads by owner server-side. Prepared statements protect data values; allowlist sort fields separately. If using mock authentication, label it and do not expose the mock service publicly.

Notes save on this device. Avoid entering passwords or sensitive information.

Keep exploring