CS FundamentalsVery hardProduct-company placement · Git internals
A brand-new repository's first commit contains a.txt (content 'hello'), src/b.txt and src/c.txt, where b.txt and c.txt have identical content ('same'). How many objects does Git store for this commit?
- A. 6
- B. 4
- C. 7
- D. 5
Correct answer: D. 5
Blobs are content-addressed, so there are 2 blobs ('hello' and 'same'); trees for the root and src make 2; plus 1 commit object: 5. Counting one blob per file gives 6.
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
- In a hexagonal (ports-and-adapters) architecture, the order-processing core defines an interface OrderRepository, implemented by a…
- A module handleIO(kind, data) contains one big switch: kind 1 reads from the keyboard, kind 2 writes a file, kind 3 sends a network…
- For integer variables, what is the weakest precondition wp(x := x + 1; y := 2 x, y > 10)?
- Which Hoare triple is valid for integer variables (partial correctness)?
- This loop sums an array: python i = 0; s = 0 while i < n: s = s + a[i] i = i + 1 Which assertion is a loop invariant (true every time the…
- Two identical servers run in parallel (the system works while at least one does). Each fails independently with an exponential failure…