AlgoMaster Logo

Collaboration - Quiz

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

Collaboration Exercises

30 quizzes

1
Code Completion

Update your local main branch with the latest changes from the central repository before starting work

shell
1
git origin main

Click an option to fill the blank:

2
Code Completion

Create a new feature branch from your current branch to isolate changes

shell
1
git -b feature/collab-workflow

Click an option to fill the blank:

3
Code Completion

Send your completed feature branch to the shared remote so teammates can open a pull request

shell
1
git origin feature/user-settings

Click an option to fill the blank:

4
Code Completion

Download the latest changes from the upstream repository into your fork without modifying your working files

shell
1
git upstream

Click an option to fill the blank:

5
Code Completion

Create a new release branch from the develop branch in a Gitflow workflow

shell
1
git -b release/2.0.0 develop

Click an option to fill the blank:

6
Multiple Choice

In a Centralized Workflow, what do most developers typically commit directly to?

7
Multiple Choice

What is the main benefit of a Feature Branch Workflow compared to committing directly to main?

8
Multiple Choice

In Gitflow, which branch is always considered production-ready?

9
Multiple Choice

Why is the Forking Workflow especially common in open-source projects?

10
Multiple Choice

During a code review, what is the MOST appropriate focus?

11
Sequencing

Order the steps to contribute to an open-source project using the Forking Workflow and a pull request.

Drag and drop to reorder, or use the arrows.

12
Sequencing

Order the steps to keep your fork’s main branch in sync with the upstream main branch.

Drag and drop to reorder, or use the arrows.

13
Sequencing

Order the steps for implementing a new feature in a Feature Branch Workflow and integrating it into main.

Drag and drop to reorder, or use the arrows.

14
Sequencing

Order the steps for handling a hotfix using Gitflow.

Drag and drop to reorder, or use the arrows.

15
Output Prediction

You are currently on branch feature/login. What will this command print?

1git branch --show-current
16
Output Prediction

On your fork, you just ran git checkout -b feature/docs from main. What will this command print?

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

Your current branch is develop. What will this command print?

1git symbolic-ref --short HEAD
18
Output Prediction

You just ran git remote add upstream https://github.com/org/project.git. What will this command print?

1git remote get-url upstream
19
Bug Spotting

Find the incorrect command in this Centralized Workflow sequence.

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

shell
1
git clone https://example.com/repo.git
2
cd repo
3
git add .
4
git commit -m "Initial work"
5
git push origin commit
6
 
20
Bug Spotting

Find the incorrect command while preparing a feature branch for a pull request.

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

shell
1
git checkout main
2
git pull origin main
3
git checkout -b feature/reports
4
git add .
5
git commit -m "Add reports feature"
6
git push feature/reports origin
7
 
21
Bug Spotting

Find the incorrect command in this Gitflow hotfix sequence.

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

shell
1
git checkout main
2
git checkout -b hotfix/login-bug
3
git add .
4
git commit -m "Fix login bug"
5
git merge main
6
 
22
Matching

Match each workflow with its key characteristic.

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

23
Matching

Match each pull request concept with its description.

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

24
Matching

Match each code review guideline with its purpose.

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 update your local main from upstream and push it to your fork.

shell
1
git fetch
2
git checkout
3
git merge /main
4
git push main

Click an option to fill blank 1:

26
Fill in the Blanks

Complete the commands to start a new feature in a Gitflow-style project.

shell
1
git checkout
2
git pull origin
3
git checkout -b /

Click an option to fill blank 1:

27
Fill in the Blanks

Complete the commands to prepare code for review from a feature branch.

shell
1
git status
2
git add
3
git commit -m
4
git push origin

Click an option to fill blank 1:

28
Hotspot Selection

Select the line that shows the current branch in a collaborative Branch model.

Click on the line to select.

shell
1
  main
2
* feature/payment-flow
3
  feature/cleanup
4
 
29
Hotspot Selection

Select the line indicating the remote that points to the original repository (upstream).

Click on the line to select.

shell
1
origin   https://github.com/YOU/project.git (fetch)
2
origin   https://github.com/YOU/project.git (push)
3
upstream https://github.com/ORIGINAL_OWNER/project.git (fetch)
4
upstream https://github.com/ORIGINAL_OWNER/project.git (push)
5
 
30
Hotspot Selection

Select the line that shows your own review comment on a pull request diff.

Click on the line to select.

shell
1
diff --git a/app.js b/app.js
2
+ console.log('Hello');
3
Comment (you): Consider removing this debug log before merging.
4
Comment (teammate): Agreed, please clean this up.
5