CS FundamentalsHardAccenture · Capgemini technical pattern
A bug exists at the current commit but not at a commit 200 commits earlier. Using git bisect (a binary search through history), what is the maximum number of commits you would need to test to find the first bad one?
- A. 200
- B. 100
- C. 8
- D. 14
Correct answer: C. 8
Each test halves the range of candidates. 2⁷ = 128 < 200 ≤ 256 = 2⁸, so at most ⌈log₂ 200⌉ = 8 tests. 100 assumes a linear scan stopping half-way on average.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- What distinguishes continuous deployment from continuous delivery?
- In a unit test, the real payment gateway is replaced by an object that records calls so that the test can assert “charge() was called…
- Using a three-point PERT estimate, a task has optimistic time 4 days, most likely 6 days and pessimistic 14 days. What is the expected…
- An application is modified so that it keeps working after the company moves it to a new operating system version and a new database…
- Counts for a system: 10 external inputs, 8 external outputs, 6 external inquiries, 4 internal logical files and 2 external interface…
- What is the minimum number of test cases needed to achieve MC/DC (modified condition/decision coverage) for the decision if (A && B)?