Aptitude · Prompt engineering

Prompt engineering, made easy

💡 The idea

In a hiring test, your prompt is run on hidden inputs and the reply must match exactly. A good prompt leaves the AI nothing to guess: what the input looks like, what to do with tricky cases, and exactly what to output.

Task→Input→Rules for tricky cases→Exact output + ONLY→Example→{input} last
The parts of a prompt that passes hidden tests

🧭 The method: 3 steps

  1. Say what the input looks like and what to do with it.
  2. Add a rule for every tricky case: repeats, ties, capitals, empty input, rounding, boundaries.
  3. Give the exact output format with “Reply with ONLY…”, one tiny example, and put {input} last.

🎬 Every kind of question, in pictures

Pick a kind. Guess the answer first, then watch the picture work it out. Tap any step to see it in the picture.

Loading the pictures…

✏️ Worked examples

Example 1. “Who won the vote? {input}” fails hidden tests. Why?

  1. No output format: the AI writes a sentence
  2. No rule for a name on several lines (add them up)
  3. No rule for ties
  4. Better: “Each line is : . Add up repeated names; ties → first in the list. Reply with ONLY , (e.g. Ana,12). Votes: {input}”

Example 2. The AI replied “```json [...] ```” but the test failed. Fix?

  1. The answer itself was right
  2. The ``` code block is extra text
  3. Add: “no ``` code block, all on one line”

⚠️ Where people go wrong

  • A grand role (“You are a world-class expert…”) does not fix a missing output format.
  • Asking the AI to explain its answer adds text and fails exact-match tests.
  • Forgetting the {input} placeholder: the AI never sees the test data.

📌 Remember

  • Input → rules → format → example → {input}
  • Reply with ONLY …
  • Repeats, ties, empty, capitals, rounding
  • Try it on tricky inputs: Prompt lab

🧪 Now try the real thing: the Prompt lab

In hiring tests you write a prompt that is run on hidden test cases. The Prompt lab has HackerRank-style tasks: write your prompt, run it in your own AI, paste the reply, and see how many test cases pass.

Open the Prompt lab →

🎯 Now you try

Fresh questions every time, with the full solution. Pick a level and go.

Loading questions…

⏱️ Take a 10-question timed test: Prompt engineering