🐙 Git, Maven and Gradle — interview questions
12 questions. Filter by what the role asks for; open one for the six layers of the answer. The course is where the answers come from.
12 of 12
01A teammate avoids creating branches for small changes because "branching is expensive — it copies the whole project." Is that true in Git, and what does `git branch feature` actually do?Git internalseasy0-2y02A developer runs `git checkout <some old commit hash>`, makes a few commits while poking around, then switches back to `main` without naming anything. Are those commits gone? What actually happened?Git internalseasy0-2y03A merge fails with `CONFLICT (content): Merge conflict in config.txt`, and the file has three lines. A developer assumes the whole file is now in question and starts rewriting it from scratch. What does Git actually mean by a conflict here, and what's the right way to read the markers?Branching and mergingeasy0-2y04A pull request that's been open for three weeks suddenly has conflicts across six files, even though the author only touched two of them. A teammate says "just rebase and force-push, that'll clear it up." What's the actual mechanism behind conflicts growing over time, and why does rebasing onto main help?Branching and mergingmedium3-5y05During an interactive rebase, a developer hits a conflict, looks at the `<<<<<<< HEAD` block, and — out of habit from resolving merge conflicts — keeps that side every time. The result quietly discards their own work. What went wrong?Branching and mergingmedium3-5y06A developer runs `git reset --hard HEAD~1` on the wrong branch, wiping out a commit they needed. `git log` no longer shows it. Is the commit actually gone, and how would you get it back?Git internalsmedium3-5y07A service compiles cleanly, but throws `NoSuchMethodError` in production on a code path that calls into a third-party library the team never directly wrote a version for. Where would you look first, and what's the actual mechanism that produces this?Build toolsmedium3-5y08A developer rebases their own feature branch and pushes with `git push --force-with-lease`, expecting it to refuse if a colleague pushed to the same branch in the meantime. It doesn't refuse, and the colleague's commit is gone from the remote. What went wrong with the safety it's supposed to provide?Branching and merginghard5-8y09A project imports the Spring Boot BOM, and a developer bumps just the Spring Security version by hand to pick up a patch, leaving the rest of the BOM's versions alone. Soon after, the app fails to start with a confusing bean-wiring error. What did the BOM actually provide, and what did overriding one version break?Build toolshard5-8y10A team migrates a service from Maven to Gradle, keeping the same declared dependency versions. A transitive dependency that resolved one way under Maven resolves to a different version under Gradle, and a test that passed before now fails. Why would the same declared dependencies produce two different classpaths?Build toolshard5-8y11A security review asks the team to prove that a specific jar deployed to production was built from a specific commit, byte for byte. What three things does the project need to have in place for that proof to actually be possible, and why does each one matter?Build toolssenior8+y12A parent POM lists three modules — `orders-domain`, `orders-api`, `orders-worker` — with no explicit build order given anywhere. How does Maven decide what order to build them in, and what stops a developer from accidentally importing `orders-api` classes into `orders-domain`?Build toolssenior8+y