💼 Interview Q&A
Interview Q&A: 🎬 The Anatomy of a Strong Linux Scenario Answer The chmod 777 reflex The interviewer asks: "A script fails with Permission denied in the CI pipeline but works loc
🎬 The Anatomy of a Strong Linux Scenario Answer
The chmod 777 reflex
The interviewer asks: "A script fails with Permission denied in the CI pipeline but works locally — what do you do?" In this film you will watch the difference between two answers: the reflex versus the structured one.
The weak reflex: "I would chmod 777 it, that always fixes it." Yes — it works. But what the interviewer sees is not a solution: it is a SECURITY BLINDNESS that grants everyone write access on a shared machine.
Layer 1 of the strong answer — EVIDENCE: "First I check the permission string with `ls -l` and which user CI runs as with `whoami`. Locally I am the owner; CI likely runs as another user — the difference may be born right there."
Layer 2 — command + RATIONALE: "I would use `chmod u+x`, because the need is only for the owner to execute. I deliberately REJECT 777 — write access for everyone is a security hole on shared CI." Naming the alternative you rejected is worth more than the command itself.
Layer 3 — the ROOT cause: "chmod is a temporary band-aid; a fresh checkout can drop the bit again. The permanent fix is committing the bit into the repo: `git update-index --chmod=+x`. That way the failure NEVER returns." This sentence separates the firefighter from the fire preventer.
Layer 4 — the Java bridge: "Linux permissions are Java access modifiers applied to the filesystem: 700 ≈ private, 644 ≈ a world-readable public field. Granting 777 is like making every field public and declaring 'it works now'." A bridge to a world you know makes the answer stick.
Final — the formula: evidence commands → command + rationale (with the alternative you rejected) → permanent root fix → Java analogy. Run your answer through these 4 layers for every interview question below; the candidate who thinks in order always beats the one who memorized commands.
Step by Step: Building a Linux Scenario Answer
Ask about the environment gap
Open by clarifying conditions: which user runs it, which distro, container or VM? Questioning the gap between "works locally" and CI is the answer's first point.
List the evidence commands
Say "first I look with `ls -l`, `whoami`, `echo $PATH`" — stating which command proves which layer is how you separate yourself from rote memory.