The function works for one event. Then the same event arrives again and the total changes twice. It is a small failure with a useful hiring question behind it: can the candidate connect the symptom to the state the code keeps?
A coding assessment does not need an elaborate puzzle to reveal engineering ability. It needs a relevant problem, clear expectations, and a way to inspect the candidate’s choices.
LunaPrompts coding assessments evaluate programming fundamentals, problem-solving, debugging, and code review. Hiring teams can assess languages such as Java, Python, and C++ while choosing tasks that reflect the engineering work of the role.
Debug duplicate order events
Engineering reviewerIllustrative scenario01 / 03The first event succeeds
An order event increases the processed total as expected.
Supply a small function that processes order events and updates a total. Give each event an identifier. State that receiving the same event twice should not count it twice, then provide an implementation that violates that requirement.
Ask the candidate to reproduce the defect, correct it, and show a check that fails before the change and succeeds afterward. This makes the review concrete: the team can inspect the failing input, the implementation, and the test.
For a junior role, a correct local solution and clear explanation may cover the intended scope. For a more experienced role, ask what happens when the process restarts or two workers handle the same event. Make any extra requirement explicit; do not silently score a small in-memory exercise as if the candidate had been asked to build a distributed service.
If AI tools are allowed, examine how the candidate reviews the suggested fix. If they are not allowed, state that before the task. In either case, ask why the implementation prevents the observed failure and what it does not yet guarantee. That discussion connects programming fundamentals to ownership of the result.
Assess more than the happy path
A useful coding assessment gives candidates a clear problem and gives reviewers observable evidence. The solution should be checked against the task's requirements, including relevant edge cases and constraints.
Passing tests matters. The way a candidate structures the implementation, handles failure, and explains the approach adds more information. A short task can reveal these skills when its scope is chosen carefully.
Four kinds of coding evidence
Writing working code
Use a task with an explicit outcome and a reasonable scope. Review correctness, handling of inputs, and whether the candidate's implementation fits the stated constraints. Include performance considerations when they are relevant to the job.
Reading unfamiliar code
Most engineering roles involve existing systems. Ask the candidate to explain a small code path, identify assumptions, or predict behavior for a particular input. This can reveal understanding that a memorized solution does not show.
Debugging a failure
Provide a reproducible problem and ask the candidate to investigate it. Look for a connection between the observed behavior, the proposed cause, and the change they make. The explanation is especially useful when more than one fix is possible.
Reviewing AI-generated code
Use an example change that looks plausible but contains a relevant defect. Ask the candidate to identify the issue, suggest a correction, and describe how they would verify it. This reflects the review responsibility that comes with AI-assisted development.
Match language choice to the job
If the role needs immediate depth in Java, a Java task may be appropriate. If the role primarily requires algorithmic reasoning, allowing a suitable supported language can help focus the evaluation on that skill.
Confirm the available language, runtime version, libraries, and execution constraints when configuring the assessment. A broad language catalog is useful only when the candidate has the environment needed for the specific task.
Keep the difficulty proportionate
A junior role may need clear implementation and basic debugging. A senior role may need more attention to interfaces, maintainability, and tradeoffs. Avoid turning every coding test into the most difficult algorithm problem the team can find.
The best question for calibration is simple: would success on this task provide evidence about the work this person will actually do?
A review framework your team can use
The following is an editorial checklist for this workflow. Adapt it to the role, the candidate journey, and your configured environment.
| Review area | What to establish |
|---|---|
| Reproduce | A failing input that demonstrates the defect |
| Repair | A change linked to the cause |
| Regress | A check that guards against recurrence |
| Explain | The scope and limits of the solution |
Hidden requirements create noise. Hidden test inputs can check disclosed requirements, but should not introduce a different task after submission.
Put the guide to work
Choose an ordinary bug from a sanitized example project. Write the observable failure, the expected behavior, and one follow-up matched to the role level.
Download the editable worksheet to record the decisions and open questions with your team. The examples in this guide are illustrative, not customer results or validated selection rules. Product availability and setup depend on the workflow agreed for your account.
A focused checklist, a worked scenario, and questions to resolve together.
Frequently asked questions
Why assess coding if the team uses AI assistants?
Engineers still need to understand, verify, and maintain the implementation. Coding ability helps them identify mistakes and give better instructions when using an assistant.
Can we assess debugging instead of writing a solution from scratch?
Debugging is a useful task pattern for roles that work on existing systems. Define the problem, the expected correction, and the evidence your reviewers should examine.
Should we score only the number of tests passed?
Test results are an important input. Include other relevant criteria, such as explanation and maintainability, when they are part of the role and can be assessed consistently.
Keep building your hiring workflow
- AI coding tools: Let them use the assistant. Then inspect what they accept.
- System design: The diagram looks complete. Change one requirement.
- Candidate analytics: The scores match. The follow-ups should not.
Explore coding assessments with LunaPrompts or browse all 19 hiring field guides.
