Library › Coding AI › HR and recruiting
Write the HR system update for a promotion
Practice: Keeping the AI to your sources. About 5 minutes.
About this exercise
Build the JSON body for Maya Chen's promotion in exactly the doc's shape. It takes effect December 1, 2026. Only her title and manager change, so put only those two fields in changes. Set requested_by to Dana Ruiz's employee ID, 000207. Her pay raise goes through a separate approval, so no pay or salary field anywhere. Keep IDs as strings with their leading zeros. One code block with only the JSON, then under 30 words outside the code.
Common mistakes when you ask AI for this
- Not mentioning leading zeros. The AI writes the ID as the number 482, so the system can't find her. Try: Add: "IDs are strings with leading zeros, like \"000482\"."
- Including unchanged fields. The AI fills in department and location too, which this API treats as changes. Try: Add: "Only title and manager in changes."
- Not giving the approver or the pay rule. The AI can't know Dana's ID, and it may add the salary from the email. Try: Add: "requested_by is 000207. No pay or salary field; that's a separate approval."
- Getting a menu of options. The AI likes to offer two or three versions of the payload, so you're left to pick and test them yourself. Try: Add: "Give one payload only, in one code block, no alternatives."
- Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 8 words. Nothing else."
What a strong prompt includes
- Keeps leading zeros
- Limits the changes
- Gives the approver and leaves out pay
- Gives the date
- Asks for one answer only
Related exercises
- Accept a job offer and confirm the exact terms (Writing AI · Job seekers)
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)