Sample questions
Question 1Easy
Why do teams create branches in version control?
- To develop features or fixes in isolation without disturbing the main line
- To delete old history
- To give each file a separate owner who must approve every change made to it
- To compress the repository
Answer: A. To develop features or fixes in isolation without disturbing the main line
Explanation
Branches let work proceed in parallel; changes are merged back once they are reviewed and tested.
Step-by-step solution
- A branch is a separate line of work.
- Teams use branches to build features or fixes without affecting the main line.
- Changes are merged back after review: option A.
Why the other options are wrong
- B. Branches add history; they do not delete it.
- C. Branches do not assign per-file owners who must approve every change.
- D. Branches do not compress the repository.
Tip: Branch = isolated work; merge it back when it is reviewed and tested.
Question 2Easy
Software Configuration Management (SCM) is mainly concerned with:
- Writing user manuals
- Setting up the server hardware, operating system and network configuration for the production environment
- Hiring and managing developers
- Identifying, controlling and tracking changes to software artifacts and their versions
Answer: D. Identifying, controlling and tracking changes to software artifacts and their versions
Explanation
SCM covers version control, change control, baselines, build and release management and configuration audits.
Step-by-step solution
- Software Configuration Management (SCM) manages the software and its versions.
- It covers identifying, controlling and tracking changes to artifacts.
- That matches option D.
Why the other options are wrong
- A. Writing user manuals is documentation, not SCM.
- B. Server hardware and network setup is infrastructure work, not SCM.
- C. Hiring and managing developers is people management, not SCM.
Tip: SCM = version control, change control, baselines, builds and releases.
Question 3Easy
What is the key difference between a centralised and a distributed version control system?
- Centralised systems keep no history
- Distributed systems have no branches
- Centralised systems cannot store binary files, so images and documents must be kept in a separate repository
- In a distributed system every developer has a full copy of the repository history
Answer: D. In a distributed system every developer has a full copy of the repository history
Explanation
In a centralised system the history lives on one server; in a distributed system each clone holds the full history, so many operations work offline.
Step-by-step solution
- A centralised system keeps the history on one server.
- A distributed system gives each clone the full repository history.
- So in a distributed system every developer has a full copy of the history: option D.
Why the other options are wrong
- A. Centralised systems do keep history, on the central server.
- B. Distributed systems have branches; branching is a core feature of Git.
- C. Centralised systems can store binary files, so this limit is false.
Tip: Distributed = full history on every clone, so most operations work offline.
Question 4Easy
Which of the following is a distributed version control system?
- CVS
- Subversion (SVN)
- Git
- Perforce in its classic centralised mode
Answer: C. Git
Explanation
Git and Mercurial are distributed; SVN and CVS use a central server as the single source of history.
Step-by-step solution
- Git is a distributed version control system.
- CVS and Subversion use one central server as the source of history.
- Perforce in centralised mode also depends on the server.
- So Git is the answer: option C.
Why the other options are wrong
- A. CVS is centralised.
- B. Subversion (SVN) is centralised.
- D. Perforce in its classic centralised mode is centralised.
Tip: Git and Mercurial are distributed; CVS and SVN are centralised.
Question 5Medium
In semantic versioning (MAJOR.MINOR.PATCH), a library at 2.4.7 releases a backward-compatible bug fix. What is the new version?
- 3.0.0
- 2.4.8
- 2.4.7.1
- 2.5.0
Answer: B. 2.4.8
Explanation
PATCH is incremented for backward-compatible bug fixes; MINOR and MAJOR stay the same.
Step-by-step solution
- Semantic versioning is MAJOR.MINOR.PATCH.
- A backward-compatible bug fix increases PATCH.
- 2.4.7 becomes 2.4.8: option B.
Why the other options are wrong
- A. 3.0.0 is for breaking changes, which a bug fix is not.
- C. 2.4.7.1 is not a valid semantic version; there are only three parts.
- D. 2.5.0 is for a new backward-compatible feature, not a bug fix.
Tip: Bug fix = PATCH; new compatible feature = MINOR; breaking change = MAJOR.
Question 6Medium
What is a tag in version control usually used for?
- Marking a specific commit, such as a release, with a permanent name
- Pointing to the newest commit and moving forward automatically whenever new work is committed
- Storing passwords
- Locking a file against edits
Answer: A. Marking a specific commit, such as a release, with a permanent name
Explanation
Tags label points in history (for example v2.1.0); unlike branches, they do not move as new commits are added.
Step-by-step solution
- A tag gives a fixed name to one specific commit.
- Tags such as v2.1.0 mark releases.
- Unlike branches, a tag does not move when new commits are added: option A.
Why the other options are wrong
- B. This describes a branch, not a tag; a tag stays fixed.
- C. Tags are not used for storing passwords.
- D. Tags do not lock files; locking is a separate feature.
Tip: Branch moves forward with new commits; tag stays on one commit.
Question 7Medium
In trunk-based development, developers:
- Integrate small changes into a single main branch frequently, often at least daily
- Never use automated tests
- Keep long-lived feature branches for months and merge them all together just before each release
- Commit only once per release
Answer: A. Integrate small changes into a single main branch frequently, often at least daily
Explanation
Frequent integration into trunk keeps merges small and pairs naturally with continuous integration and feature flags.
Step-by-step solution
- Trunk-based development keeps one main branch, called trunk.
- Developers merge small changes into trunk frequently, often daily.
- That is option A.
Why the other options are wrong
- B. Trunk-based development relies on automated tests, so this is false.
- C. Long-lived feature branches are the opposite of trunk-based development.
- D. Committing only once per release is the opposite of frequent integration.
Tip: Small, frequent merges to trunk keep conflicts small.
Question 8Medium
Older centralised tools often used a 'lock-modify-unlock' model. What model do most modern tools use instead?
- Single-writer queue
- Lock-modify-delete
- Read-only checkout
- Copy-modify-merge
Answer: D. Copy-modify-merge
Explanation
Developers work on their own copies concurrently and merge changes, resolving conflicts when they overlap, which supports parallel work.
Step-by-step solution
- Lock-modify-unlock stops other people from editing while one person holds the lock.
- Modern tools let each developer copy the code, modify it and merge the changes.
- Conflicts are resolved when changes overlap: copy-modify-merge, option D.
Why the other options are wrong
- A. A single-writer queue is not the modern model; many people work at once.
- B. Lock-modify-delete is not a standard model.
- C. Read-only checkout blocks editing, which the modern model allows.
Tip: Copy-modify-merge supports parallel work; lock-modify-unlock serialises it.
Question 9Hard
In a three-way merge, what are the three versions the tool compares?
- Three random commits from each branch
- The first commit, the last commit and HEAD
- The two branch tips and their common ancestor (merge base)
- The working copy, the staging area and the remote
Answer: C. The two branch tips and their common ancestor (merge base)
Explanation
Comparing each tip with the merge base shows what each side changed, so non-overlapping changes merge automatically and overlapping ones conflict.
Step-by-step solution
- A three-way merge compares the two branch tips.
- It also compares both tips with their common ancestor, the merge base.
- So the three versions are the two tips and the merge base: option C.
Why the other options are wrong
- A. Random commits do not give a meaningful comparison.
- B. The first commit, last commit and HEAD are not the three merge inputs.
- D. The working copy, staging area and remote are not the three merge inputs.
Tip: Three-way merge = two tips plus their common ancestor.
Question 10Hard
Under semantic versioning precedence rules, which list is in increasing order?
- 1.0.0-beta, 1.0.0-alpha, 1.0.0, 1.1.0
- 1.1.0, 1.0.0, 1.0.0-beta, 1.0.0-alpha
- 1.0.0, 1.0.0-alpha, 1.0.0-beta, 1.1.0
- 1.0.0-alpha, 1.0.0-beta, 1.0.0, 1.1.0
Answer: D. 1.0.0-alpha, 1.0.0-beta, 1.0.0, 1.1.0
Explanation
A pre-release version has lower precedence than the normal version it precedes, and pre-release labels are compared alphabetically (alpha before beta).
Step-by-step solution
- A pre-release version is lower than the normal version it leads to.
- Among pre-releases, alpha comes before beta.
- So 1.0.0-alpha < 1.0.0-beta < 1.0.0 < 1.1.0, which is option D.
Why the other options are wrong
- A. 1.0.0-beta comes before 1.0.0-alpha in this list, which is wrong; alpha is lower.
- B. The list is in decreasing order, not increasing.
- C. 1.0.0 is listed before the pre-releases, but a pre-release is lower than 1.0.0.
Tip: Precedence: alpha < beta < normal release < next minor version.
Practise all 15 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →