Explain GitOps and how an agent knows when to apply changes

Tests declarative infrastructure and pull-based reconciliation. A strong answer says Git is the source of truth and the agent polls or watches for drift, then applies diffs. Red flag: calling a push-based CI pipeline GitOps.
What's really being asked
This question probes whether you see GitOps as a paradigm rather than a tool. The interviewer wants to know if you understand the difference between push-based CI/CD and pull-based reconciliation, and whether you can articulate why Git serves as the single source of truth for declarative infrastructure. Senior candidates should demonstrate that they grasp immutable desired state, drift detection, and self-healing clusters.
The full answer
A good answer hits four things in order. First, define the core principle: Git is the single source of truth for the desired state of the system, and all infrastructure is declared in version-controlled files. Second, explain the mechanism: the GitOps agent runs inside the cluster and continuously polls the Git repository at a set interval, or optionally receives webhook events, to notice new commits. Third, describe the reconciliation loop: the agent compares the desired state stored in Git against the actual live state of the cluster by querying the Kubernetes API. Fourth, state the action: when the agent detects drift or new desired state, it applies changes to converge the cluster toward the Git-defined state, and it can also prune resources that were removed from Git.
The mistakes people make
A common wrong answer is saying the CI server pushes changes to the cluster after a build. That describes traditional CI/CD, not GitOps. Another red flag is claiming the agent relies solely on human approval or manual sync for every change; while sync windows or manual gates exist, the fundamental model is automated reconciliation. Some candidates also conflate GitOps with simply storing YAML in Git and running kubectl apply from a laptop, missing the continuous loop entirely.
What usually comes next
Interviewers often follow up by asking how you would handle secrets in GitOps, since plain text secrets should not live in Git. They may ask about disaster recovery and whether you can rebuild a cluster from Git alone. Another common tangent is comparing polling versus webhooks for change detection, or asking how you would manage multiple environments and promotion strategies without breaking the GitOps model.
A concrete example
Imagine a team uses Argo CD to manage a microservices fleet. A developer merges a pull request that changes a Deployment replica count from three to five in the main branch. Argo CD polls the repository every three minutes, detects the new commit, reads the updated manifest, compares it against the live Deployment object in the cluster, sees a mismatch in the replicas field, and patches the Deployment to five replicas. If a manual operator later scales the Deployment to seven via kubectl, Argo CD will detect that drift on its next poll and scale it back to five, demonstrating self-healing.
Interview question
A developer manually scales a Deployment to seven replicas via kubectl, but Git declares three. What does the GitOps agent do on its next reconciliation?
- a.Update the Git repository to match the live seven-replica state
- b.Do nothing because the change did not originate from Git
- c.Scale the Deployment back to three replicas to match GitCorrect
- d.Wait for manual approval before making any changes
Why? this is the answer
The GitOps agent continuously reconciles live cluster state against Git as the single source of truth, so it self-heals by scaling back to three. Distractor B is wrong because Git, not the live cluster, is the authoritative desired state, so the agent does not write drift back to the repository.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
- #gitops
- #cicd
- #kubernetes
- #argo-cd
- #flux
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on gitops — each one lists the topics its interview covers.
See open roles