AlgoMaster Logo

Debugging & Troubleshooting - Quiz

1 min readUpdated December 2, 2025
Listen to this chapter
Unlock Audio

Debugging & Troubleshooting Exercises

30 quizzes

1
Code Completion

List files that still have merge conflicts after a failed merge

shell
1
git

Click an option to fill the blank:

2
Code Completion

Create a new branch to preserve work done in a detached HEAD state

shell
1
git save-detached-work

Click an option to fill the blank:

3
Code Completion

Undo the last commit but keep all its changes staged for another commit

shell
1
git --soft HEAD~1

Click an option to fill the blank:

4
Code Completion

Check the integrity of all objects in the current repository

shell
1
git

Click an option to fill the blank:

5
Code Completion

Track all .psd design files with Git LFS in the current repository

shell
1
git lfs "*.psd"

Click an option to fill the blank:

6
Multiple Choice

Which situation most commonly leads to a merge conflict?

7
Multiple Choice

What is the main risk of working in a detached HEAD state?

8
Multiple Choice

Which command is best when you need to undo a public commit without rewriting history?

9
Multiple Choice

What does git gc primarily do?

10
Multiple Choice

Why use Git LFS for large binary assets?

11
Sequencing

Order the steps to resolve a merge conflict in file.txt and complete the merge.

Drag and drop to reorder, or use the arrows.

12
Sequencing

Order the steps to recover a deleted local branch using the reflog.

Drag and drop to reorder, or use the arrows.

13
Sequencing

Order the steps to clean up stale remote branches locally.

Drag and drop to reorder, or use the arrows.

14
Sequencing

Order the steps to start using Git LFS for .mp4 files in an existing repository.

Drag and drop to reorder, or use the arrows.

15
Output Prediction

HEAD is currently at commit abc1234 on branch feature-login. What does this command print?

1git rev-parse --short HEAD
16
Output Prediction

You are on branch hotfix-123. What does this command print?

1git branch --show-current
17
Output Prediction

You have an unpushed local commit on main. What does this command print?

1git rev-parse --abbrev-ref HEAD
18
Output Prediction

Your repository has a valid object database with no corruption. What does this command print?

1git rev-parse --git-dir
19
Bug Spotting

Find the incorrect command in this attempt to undo and then recover a hard reset.

Click on the line(s) that contain the bug.

shell
1
git reset --hard HEAD~1
2
git reflog
3
git checkout recovered-branch <hash-from-reflog>
4
git checkout -b recovered-branch <hash-from-reflog>
20
Bug Spotting

Identify the incorrect step in this workflow to clean up large files using filter-repo.

Click on the line(s) that contain the bug.

shell
1
git filter-repo --path-large-file.bin --invert-paths
2
git push origin main
3
git push --force-with-lease origin main
21
Bug Spotting

Spot the mistake in this attempt to resolve a merge conflict and finish the merge.

Click on the line(s) that contain the bug.

shell
1
git status
2
git add conflicted-file.txt
3
git merge --continue
4
git commit -m "Finish merge"
22
Matching

Match each Git concept to its description.

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

23
Matching

Match Git commands to their use in fixing mistakes.

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

24
Matching

Match the Git LFS and large-file tools to their purposes.

Click an item on the left, then click its match on the right. Click a matched item to unmatch.

25
Fill in the Blanks

Complete the commands to safely recover a deleted branch using its last known commit from reflog.

shell
1
git reflog
2
git ___
3
git ___ recovered-branch

Click an option to fill blank 1:

26
Fill in the Blanks

Complete the commands to clean up unreachable objects after verifying them with fsck.

shell
1
git ___
2
git gc --___

Click an option to fill blank 1:

27
Fill in the Blanks

Complete the commands to avoid committing large video files by default.

shell
1
echo "" >> .gitignore
2
git ___ .gitignore
3
git commit -m ""

Click an option to fill blank 1:

28
Hotspot Selection

Click the line that indicates a merge conflict in app.js.

Click on the line to select.

shell
1
On branch feature-ui
2
You have unmerged paths.
3
  (fix conflicts and run "git commit")
4
 
5
Unmerged paths:
6
  (use "git add <file>..." to mark resolution)
7
	both modified:   app.js
8
 
9
no changes added to commit (use "git add" and/or "git commit -a")
29
Hotspot Selection

Click the line showing that HEAD is detached at a specific commit.

Click on the line to select.

shell
1
Note: switching to '83a1b2c'.
2
 
3
You are in 'detached HEAD' state.
4
You can look around, make experimental changes and commit them,
5
and you can discard any commits you make in this state without impacting any branches by switching back to a branch.
6
 
7
HEAD is now at 83a1b2c Fix critical bug
30
Hotspot Selection

Click the line that shows an unreachable blob reported by git fsck.

Click on the line to select.

shell
1
$ git fsck
2
unreachable blob b4c3d2e0c3de9b83a4dbb3e9e2f6d2a3b0c9e3f2
3
dangling commit 0d4c9d2c5e3f2c9e5d3c2c4e9b1e3d2c4d1e2b3