No-account self-check — Pull Request Review
Practice now without an account
Answer each question before opening its answer. This browser page does not submit, score, or save anything. Closing it clears your unsaved work.
Scope: This fictional, clean-room practice is not certification, a hiring assessment, or evidence of job readiness. Do not use employer or client code, credentials, or data.
Create a free account to save progress and take the scored check
Pull Request Review — 8 questions
How to use this page: choose one answer in your notes or aloud, then open the reveal. For a shuffled, scored attempt with saved feedback, create a free account.
What is the strongest first anchor for reviewing the NeighborLink change?
The acceptance requirements and the behavior they make observable
The author’s seniority
The number of files changed
The reviewer’s preferred coding style
Show answer and explanation
Answer: A
The acceptance requirements and the behavior they make observable
Answer feedback
Correct. Requirements provide the standard for deciding whether the proposed behavior is acceptable.
Why this matters
Begin with the intended behavior, constraints, and evidence. Then read the diff against that map.
The new log line records the full email and Authorization header. What is the best review decision?
Approve because logs are visible only to developers
Mark it non-blocking and ask for shorter variable names
Block the merge; remove the token and use an approved redacted or non-identifying event record
Copy the token into the review comment so the author can reproduce the issue
Show answer and explanation
Answer: C
Block the merge; remove the token and use an approved redacted or non-identifying event record
Answer feedback
Correct. The change violates the explicit confidentiality requirement and may expose a bearer token.
Why this matters
Security findings should identify the exposed value, the applicable boundary, and the safe change without repeating the secret.
Which change most directly controls the injection risk in the fictional SELECT and INSERT statements?
Escape apostrophes with a string replacement
Validate that the email contains an @ character
Add a comment saying the email is trusted
Use parameterized statements or the project’s safe data-access API
Show answer and explanation
Answer: D
Use parameterized statements or the project’s safe data-access API
Answer feedback
Correct. Bind input as data rather than constructing executable SQL text.
Why this matters
Input validation and parameterized access solve different problems. Use both where the contract requires both.
Why is changing <= to < not enough to satisfy the capacity requirement?
The endpoint must return XML instead of JSON
Two requests can read the same remaining place before either write commits
The variable name registration_count is too long
A smaller comparison operator always rejects every request
Show answer and explanation
Answer: B
Two requests can read the same remaining place before either write commits
Answer feedback
Correct. The read/check/write sequence must be protected as one database operation.
Why this matters
The requirement covers both the boundary value and concurrent behavior. The control must be atomic, not only arithmetically correct.
What is the strongest control for preventing two concurrent duplicate registrations?
A database uniqueness constraint on event and email, with the conflict returned as 409
A second identical SELECT immediately before INSERT
A warning in the user interface
A nightly report of duplicates
Show answer and explanation
Answer: A
A database uniqueness constraint on event and email, with the conflict returned as 409
Answer feedback
Correct. The database enforces the invariant at the shared write boundary.
Why this matters
Put a critical uniqueness invariant at the authoritative data boundary, then handle the expected conflict explicitly.
The same attendee is submitted twice for the same event. Which response matches the stated fictional contract?
200 because the endpoint always returns ok
201 because a duplicate is another successful creation
500 because every duplicate is an unexpected server failure
409 because the requested registration conflicts with an existing one
Show answer and explanation
Answer: D
409 because the requested registration conflicts with an existing one
Answer feedback
Correct. R5 assigns 409 to a duplicate or full event.
Why this matters
Exact response codes are part of the interface. Tests should make each required outcome observable.
Which review comment is most actionable?
This code is bad. Rewrite it.
Blocking — capacity branch: <= admits a write when count equals capacity, and the read/update is not atomic. Please protect the check and write in one database operation and add full-capacity and concurrent-request tests.
Maybe there is a race somewhere?
Use my favorite library instead.
Show answer and explanation
Answer: B
Blocking — capacity branch: <= admits a write when count equals capacity, and the read/update is not atomic. Please protect the check and write in one database operation and add full-capacity and concurrent-request tests.
Answer feedback
Correct. It identifies classification, location, evidence, impact, and an observable request.
Why this matters
A useful comment makes the decision and the path to resolution understandable without guessing the author’s intent.
What is the most important defect in the supplied test?
It uses the word response instead of result
It does not print the response body
It expects 200 for one happy path and does not exercise authorization, invalid input, duplicates, capacity, concurrency, or sensitive logging
It runs too quickly to be trustworthy
Show answer and explanation
Answer: C
It expects 200 for one happy path and does not exercise authorization, invalid input, duplicates, capacity, concurrency, or sensitive logging
Answer feedback
Correct. The test neither matches the contract nor establishes the high-risk branches.
Why this matters
Tests should trace to requirements and include the boundary and failure conditions that could invalidate approval.
Want a saved, scored attempt?
Create a free account to save progress and take the scored check
An account lets you take the native Moodle quiz, keep attempts and feedback, and return later. The course remains free.