git clone <url> # Clones an existing repo from a remote server
Scenario Questions
0-2 years experience
1We need to start a new small project. Walk me through the exact commands you'd run to create a local Git repository and push it to GitHub.
2If you run `git init` inside a directory that already contains a `.git` folder, what happens and how would you recover?
2-5 years experience
1Your team is adding a new microservice and you need to set up its repository. How would you initialize it, configure the remote, and ensure the initial commit follows our team's branching policy?
2During a sprint, you notice that after running `git init` and adding files, the CI pipeline fails because the repository lacks a proper `.gitignore`. How would you diagnose and fix the issue?
5-8 years experience
1Our organization uses a monorepo for many services but occasionally spins off independent repos. Describe how you'd create a new repo, set up appropriate hooks, and integrate it with our internal tooling while minimizing impact on existing CI/CD pipelines.
2When creating a new repository for a large data‑science project, we need to enforce large‑file storage (Git LFS) and access controls. Explain the steps you’d take and the trade‑offs involved.
8+ years experience
1We are migrating hundreds of legacy projects to a new centralized Git hosting platform with strict compliance requirements. How would you design a process for bulk creation of new repositories, including naming conventions, default branch protection, and automated onboarding?
2Our company wants to standardize repository creation across multiple teams worldwide, integrating with internal ticketing and audit systems. What architecture would you propose to automate repo provisioning while ensuring security and traceability?
Follow-up Questions
What would you do if the remote repository already existed but used a different default branch?
How do you handle large binary files when initializing a new repository?
Can you explain how you would enforce a naming convention for new repositories across teams?
Sharethis question
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.