0
0
Gitdevops~20 mins

Code review in pull requests in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pull Request Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of git command showing pull request status
What is the output of the following git command when checking the status of a pull request branch locally?
Git
git fetch origin pull/42/head:pr-42
 git checkout pr-42
 git status
Afatal: 'pull/42/head' does not appear to be a git repository
B
On branch pr-42
Your branch is up to date with 'pr-42'.
nothing to commit, working tree clean
C
On branch pr-42
Your branch is based on 'origin/main', but the upstream is gone.
nothing to commit, working tree clean
D
On branch pr-42
Your branch is ahead of 'origin/pr-42' by 1 commit.
nothing to commit, working tree clean
Attempts:
2 left
💡 Hint
Fetching a pull request creates a local branch named pr-42 tracking the PR head.
🧠 Conceptual
intermediate
1:30remaining
Purpose of code review in pull requests
What is the main purpose of performing a code review in a pull request?
ATo check code quality, find bugs, and ensure standards before merging
BTo deploy the code directly to production
CTo automatically merge code changes without human intervention
DTo delete the source branch after merging
Attempts:
2 left
💡 Hint
Think about why teams review code before merging.
🔀 Workflow
advanced
2:30remaining
Correct order of steps in a pull request review workflow
Arrange the steps in the correct order for a typical pull request code review workflow.
A1,2,3,4
B1,3,2,4
C2,1,3,4
D1,2,4,3
Attempts:
2 left
💡 Hint
Think about the natural flow from coding to review to update.
Troubleshoot
advanced
2:00remaining
Error when merging pull request due to conflicts
You try to merge a pull request but get this error: "Merge conflict in file.txt". What should you do next?
ADelete the pull request and create a new one
BForce push the pull request branch to overwrite conflicts
CFetch the latest main branch, merge it locally into the PR branch, resolve conflicts, then push
DIgnore the conflict and merge using --no-verify
Attempts:
2 left
💡 Hint
Conflicts mean changes clash and need manual fixing.
Best Practice
expert
3:00remaining
Ensuring accessibility in code review comments
Which practice best ensures accessibility when leaving code review comments on UI changes?
AApprove the PR without testing UI accessibility
BOnly comment on code style and ignore UI accessibility
CRequest the developer to add more animations for better UX
DCheck color contrast, keyboard navigation, and ARIA labels in the UI code
Attempts:
2 left
💡 Hint
Accessibility means making UI usable for everyone.