Leadership, Coding & Communication
Strengthen practical coding and SQL while preparing staff-level stories, design writing, remote influence, mentoring, and conflict resolution.
Learning objectives
This chapter turns seniority into observable behavior: sound decisions, useful written artifacts, calm coding, and evidence that other people became more effective because of your work.
- Build six truthful leadership stories that separate personal ownership from team outcomes.
- Lead an ambiguous architecture decision without relying on title or authority.
- Write an async design memo, decision record, status update, and review comment that lets others act.
- Solve coding problems by clarifying contracts, selecting a pattern, proving correctness, and testing edges.
- Handle practical Python, SQL, API, and debugging screens with production judgment.
- Review AI-assisted code as accountable engineering work, not as trusted output.
Make staff-level scope visible
A senior answer is not made senior by saying “I led.” It becomes senior when the interviewer can trace how you framed an unclear problem, changed a consequential decision, created leverage beyond your own code, and verified the result.
ambiguity → framing → decision → alignment → delivery → leverage → evidence
The six-story portfolio
Prepare one story for each row. A story may cover more than one row, but do not force every question into the same heroic project.
| Story | Decision worth explaining | Evidence to bring |
|---|---|---|
| Architecture without authority | How you converted competing constraints into an accepted direction | Decision memo, rejected alternatives, rollout gate |
| Standards and leverage | Why a reusable pattern was better than another one-off | Reference implementation, adoption trail, maintenance effect |
| Mentoring | How you diagnosed a capability gap and transferred ownership | Review progression, learning plan, later independent decision |
| Disagreement | What evidence changed the discussion and what you conceded | Experiment, ADR, decision log, follow-up result |
| Technical debt or incident | Why remediation displaced other work | Risk model, incident timeline, prevention and detection controls |
| Customer or product outcome | How field evidence altered requirements or sequencing | Discovery notes, success measure, rollout feedback |
Use STAR-L, but keep the “A” inspectable
Situation gives only the context needed to understand the stakes. Task names your mandate and constraints. Action should consume roughly half the answer: questions asked, analysis performed, options rejected, people aligned, safeguards added, and course corrections. Result separates measured outcomes from impressions. Learning says what you would repeat or change.
Lead decisions, not meetings
Influence without authority comes from improving the decision environment. Make the problem legible, expose trade-offs, invite the right objections, and leave a durable record.
Frame
Name the decision, owner, deadline, non-goals, constraints, and reversible versus irreversible parts.
Compare
Evaluate two or three viable options against explicit criteria such as quality, latency, operability, privacy, and migration cost.
De-risk
Run the smallest experiment that resolves the largest uncertainty. Do not prototype what documentation already answers.
Commit
Record the chosen option, dissent, triggers for revisiting it, rollout, rollback, and who owns follow-through.
A compact architecture decision record
Title: Choose the retrieval serving path
Status / owner / decision date:
Context: users, scale, sensitivity, current failure
Decision drivers: quality, p95 latency, cost, operations
Options: A / B / C, with evidence and migration effort
Decision: chosen option and why now
Consequences: gains, accepted debt, new risks
Rollout: shadow → limited cohort → broader release
Rollback and revisit triggers:
The record is not a ceremony. It is a compression mechanism: a teammate in another time zone should be able to challenge or execute the decision without reconstructing a meeting.
Resolve disagreement with a ladder
- Restate the shared objective and the other position until its owner agrees.
- Classify the disagreement: facts, forecasts, values, constraints, or ownership.
- Seek disconfirming evidence and define a time-boxed test when the decision is reversible.
- Ask the accountable owner to decide when evidence cannot remove uncertainty.
- Disagree, commit, and log a revisit trigger rather than relitigating continuously.
Write so work can continue without you
Current Remote and Sourcegraph role pages explicitly emphasize structured writing, async work, customer communication, autonomy, and substantive review. Treat writing as part of system reliability: missing context creates coordination failures just as missing timeouts create runtime failures. See the live Remote Senior Forward Deployed Engineer role and Sourcegraph Agent Engineer role.
The five-block async update
Outcome: what changed for the user or project
Evidence: test, metric, trace, screenshot, or decision
Risk: what could still invalidate the result
Next: owner and date for the next concrete action
Ask: one explicit decision or help request, if needed
Lead with the outcome, not an activity diary. Replace “worked on evaluation” with “the release gate now catches the three known citation regressions; the multilingual slice is still below its proposed threshold.”
Design memo anatomy
A two-page memo should cover problem and non-goals, users and success measures, constraints and assumptions, proposed flow, alternatives, failure modes, security, operations, rollout, and unresolved questions. Put the recommendation near the top. Attach detailed benchmarks rather than burying the decision beneath them.
Code-review comments that create leverage
Tag the nature of the comment: blocker for correctness or safety, important for maintainability, suggestion for a worthwhile alternative, and nit for optional polish. State the consequence and, where useful, a concrete path forward. Google’s engineering review guide and GitHub’s pull-request review documentation are useful primary references for review practice and review states.
Translate trade-offs for customers
Use consequence language. “A reranker adds another model call” is technical description. “A reranker may improve the difficult queries we sampled, but adds latency and cost to every request; we propose enabling it only for low-confidence queries and measuring both task success and p95 latency” is a decision a customer can evaluate.
Make coding reasoning observable
Senior coding screens still require fundamentals, but the strongest signal is controlled problem solving: establish the contract, choose the simplest correct structure, prove the invariant, and test the boundaries.
The 40-minute loop
- Clarify: input size, ordering, duplicates, empty values, mutation, return contract, and error behavior.
- Example: walk one normal case and one adversarial case by hand.
- Baseline: give a correct simple approach and its time/space cost.
- Pattern: choose map/set, two pointers, sliding window, stack, heap, binary search, traversal, backtracking, greedy, or dynamic programming because a specific invariant fits.
- Implement: name state by meaning and narrate only consequential choices.
- Verify: trace edges, state complexity, and identify what would change at production scale.
| Signal | Likely pattern | Invariant to explain |
|---|---|---|
| Longest/shortest contiguous range | Sliding window | When moving the left edge restores validity |
| Top k or repeatedly smallest | Heap | Heap contains only the best candidates seen |
| Reachability or dependencies | BFS/DFS/graph | Visited state prevents repeated work or cycles |
| Monotone answer predicate | Binary search on answer | All values on one side share feasibility |
| Overlapping choices | Dynamic programming | State captures all information future choices need |
Practise the work-shaped screens
The syllabus calls out async Python, SQL, APIs, transformations, tests, unfamiliar code, and reading Go or TypeScript. These exercises reward production instincts more than puzzle tricks.
Async Python: concurrency needs ownership
import asyncio
async def fetch_all(ids, fetch_one):
async with asyncio.TaskGroup() as group:
tasks = {item_id: group.create_task(fetch_one(item_id))
for item_id in ids}
return {item_id: task.result() for item_id, task in tasks.items()}
TaskGroup gives the subtasks a lifetime owned by the context. Discuss timeouts, bounded concurrency, partial-result policy, and cancellation cleanup; the Python documentation explains that task-group failure cancels remaining tasks and that cleanup should propagate cancellation after finally work. Read the official coroutines and tasks documentation.
SQL: express the business question first
WITH ranked AS (
SELECT tenant_id, run_id, cost_usd,
row_number() OVER (
PARTITION BY tenant_id ORDER BY cost_usd DESC
) AS cost_rank
FROM agent_runs
WHERE started_at >= :window_start
)
SELECT tenant_id, run_id, cost_usd
FROM ranked
WHERE cost_rank <= 3;
This asks for the three most expensive runs per tenant, not the three most expensive globally. Explain tie semantics (row_number versus rank), indexes supporting the filter, and why an execution plan matters. Use the official PostgreSQL guides to window functions and EXPLAIN.
API implementation checklist
- Validate request shape and semantic constraints; return stable error contracts.
- Derive identity and tenant scope from authentication, not caller-supplied fields.
- Define idempotency, timeout, retry, concurrency, and transaction boundaries.
- Test happy path, malformed input, duplicate request, dependency timeout, and forbidden access.
- Expose correlation identifiers and useful telemetry without logging secrets.
Debugging unfamiliar code
Restate the symptom, bound the blast radius, reproduce with the smallest input, trace data across boundaries, and form ranked hypotheses. Change one variable at a time. A senior candidate distinguishes mitigation from root-cause correction and adds a regression test plus a detection improvement.
AI-assisted code is still your code
Record the prompt or intent when relevant, inspect every changed line, verify dependencies and licenses, threat-model new data paths, run targeted and broader tests, and be ready to explain the result without the assistant. Current Sourcegraph and Automattic application material asks candidates for concrete opinions about coding agents; speak from a real workflow, while never presenting generated code as independently trustworthy.
Syllabus checkpoint: complete coding-pattern coverage
Keep a compact mental map rather than memorizing isolated solutions. Arrays and strings reward index discipline, maps/sets capture membership and counts, and two pointers or sliding windows exploit ordered or contiguous structure. Stacks model nested or monotonic state; queues model FIFO work; linked lists test pointer ownership and edge cases. Binary search needs a monotone predicate, while interval problems require explicit boundary semantics.
Trees and graphs share traversal machinery but different invariants: tree DFS supports subtree/postorder reasoning, BFS supports levels and minimum unweighted hops, and general graphs require cycle/visited handling. Heaps maintain an extremum or top-k frontier. Backtracking explores a choice tree with pruning; greedy algorithms require an exchange or staying-ahead argument; dynamic programming requires a state that contains all information future choices need. For every pattern, explain correctness, time/space complexity, empty/singleton/duplicate cases, and how you would test it.
Interview playbook
Choose the framework that matches the signal being tested, then keep the answer evidence-led.
Leadership answer: Scope → Judgment → Leverage → Evidence → Learning
- Scope: users, stakes, constraints, your mandate, and what was ambiguous.
- Judgment: alternatives and the pivotal decision, including what you rejected.
- Leverage: how you aligned people or created a pattern others could use.
- Evidence: measured result, rollout observation, or honest qualitative outcome.
- Learning: a specific correction you would make next time.
Coding answer: Contract → Baseline → Invariant → Code → Tests → Cost
Clarify the contract, state a correct baseline, name the invariant behind the better approach, implement, trace tests, then give time and space complexity. Mention production concerns only after solving the asked problem.
Common traps
- Using “we” throughout so the interviewer cannot locate personal ownership.
- Claiming consensus when a real decision owner or disagreement existed.
- Giving activity metrics instead of an outcome or risk reduction.
- Narrating every keystroke during coding instead of decisions and invariants.
- Ignoring cancellation, authorization, duplicates, or failure behavior in practical tasks.
- Claiming AI assistance made work faster without showing verification or a quality boundary.
Question bank
Answer aloud. Keep leadership answers near two minutes initially; allow follow-up probes to reveal the deeper evidence.
Q1Tell me about an architecture you led without formal authority.
Strong answer outline
- Define the ambiguous decision, affected teams, constraints, and your actual mandate.
- Show the options, evidence, dissent, and the mechanism used to reach a decision.
- Close with adoption, measured or observed outcome, and one learning.
Follow-up probes
- Who initially disagreed, and why?
- Which outcome belongs to you versus the team?
A strong answer makes influence mechanisms and personal actions inspectable; “I convinced everyone” without evidence does not pass.
Q2Two senior engineers disagree about an agent framework. How do you move the decision forward?
Strong answer outline
- Align on workload, reliability boundary, team capability, and decision deadline.
- Turn preferences into criteria; test the highest-risk unknown with a thin vertical slice.
- Let the accountable owner decide, record dissent and revisit triggers, then commit.
Follow-up probes
- What if the benchmark is inconclusive?
- When would you override consensus?
Include ownership and reversibility. Endless consensus-seeking or framework feature comparison alone is insufficient.
Q3How would you make a build-versus-buy decision for an LLM gateway?
Strong answer outline
- Define required routing, policy, observability, data handling, provider support, and exit constraints.
- Compare total ownership cost, integration risk, control, roadmap fit, and vendor lock-in.
- Propose a reversible pilot with acceptance thresholds and an exit plan.
Follow-up probes
- What evidence would reverse your choice?
- How do security review and incident ownership change the answer?
The answer must address lifecycle and migration, not just license price or feature count.
Q4A capable teammate repeatedly ships prompt changes without evaluation. How do you mentor them?
Strong answer outline
- Use a concrete escaped regression to establish the capability gap without personal blame.
- Pair on a minimal golden set, threshold, and review checklist; explain why each layer exists.
- Transfer ownership and later inspect whether they can design the next gate independently.
Follow-up probes
- What if delivery pressure rewards the shortcut?
- How do you know mentoring worked?
Pass only if the story changes the system and builds independent judgment, rather than merely correcting one pull request.
Q5Write the verbal version of an async update after a failed canary deployment.
Strong answer outline
- Lead with outcome: canary rolled back and stable version remains serving.
- Give evidence and scope: triggering SLI, affected cohort, and current customer impact.
- Name leading hypothesis, next owner/date, and one explicit ask; avoid declaring root cause prematurely.
Follow-up probes
- What details belong in the incident channel rather than the executive update?
- When do you update again?
The update must let readers understand safety, uncertainty, ownership, and next action in under a minute.
Q6What makes a code-review comment blocking rather than optional?
Strong answer outline
- Block correctness, security, privacy, data loss, broken contracts, or unacceptable operability risk.
- Explain consequence and evidence, not authority or taste.
- Offer a correction or clarify the acceptance condition; label non-blocking design ideas honestly.
Follow-up probes
- What if the style issue violates a team standard?
- How do you handle a disputed blocker?
A good answer preserves a high bar without using review as a vehicle for preference or scope expansion.
Q7Design an O(n) solution for the longest substring with at most k distinct characters.
Strong answer outline
- Clarify empty input, k ≤ 0, and character model.
- Maintain a frequency map for a window; advance right, then move left until distinct count is valid.
- Each pointer moves at most n times: O(n) time and O(min(n, alphabet)) space.
Follow-up probes
- How would you return the substring, not its length?
- Which invariant must hold before updating the maximum?
Trace a repeated-character case and a window requiring multiple left moves; state the invariant precisely.
Q8When would you choose BFS rather than DFS for a dependency graph?
Strong answer outline
- Use BFS for minimum unweighted hop count or level-order processing.
- Use DFS for exhaustive exploration, cycle detection patterns, or postorder dependencies when recursion depth is controlled.
- State directedness, cycle behavior, visited state, and memory trade-off.
Follow-up probes
- How do you produce a topological order?
- What changes for weighted edges?
Do not claim one traversal is universally faster; tie the choice to the required output and graph shape.
Q9An async endpoint fans out to three model providers. Define timeout and cancellation behavior.
Strong answer outline
- Set an end-to-end deadline and derive smaller per-attempt budgets; bound concurrency.
- Choose first-valid, quorum, or all-results semantics before selecting a primitive.
- Cancel work that can no longer affect the response, propagate cancellation after cleanup, and record provider outcomes.
Follow-up probes
- When would shielding be justified?
- How do retries interact with the deadline?
Pass if the answer covers ownership, cleanup, partial results, and retry amplification—not merely asyncio.gather.
Q10Write SQL for the three highest-cost agent runs per tenant and explain tie behavior.
Strong answer outline
- Use a window function partitioned by tenant and ordered by cost descending.
- Select
row_numberfor exactly three rows orrank/dense_rankwhen ties should be preserved. - Filter in an outer query; discuss time predicate and supporting index using
EXPLAIN.
Follow-up probes
- How do null costs sort?
- What if tenant cardinality is extremely skewed?
The query and verbal contract must agree on ties, time window, and deterministic ordering.
Q11An unfamiliar webhook service creates duplicate payroll actions. How do you debug it?
Strong answer outline
- Mitigate harmful processing, preserve evidence, and bound affected events and tenants.
- Trace provider delivery IDs through ingress, queue, worker, and database transaction; test retry and crash boundaries.
- Fix with durable idempotency at the side-effect boundary, add replay tests and duplicate-rate telemetry.
Follow-up probes
- What if the provider supplies no stable event ID?
- How do you reconcile already duplicated actions?
Distinguish duplicate delivery from duplicate effect and mitigation from root cause.
Q12How do you review code produced by a coding agent?
Strong answer outline
- Re-establish requirements and inspect the diff, dependencies, and changed trust boundaries.
- Run targeted tests, adversarial cases, static checks, and broader regression tests appropriate to risk.
- Refactor or reject code you cannot explain; record material AI assistance when policy requires it.
Follow-up probes
- Which failures are tests unlikely to reveal?
- When is generated code inappropriate?
A credible answer includes a real verification workflow and makes the engineer—not the tool—accountable.
Q13Explain a relevance-versus-latency trade-off to a non-technical customer.
Strong answer outline
- Start with the user consequence: harder questions may improve while every response could slow.
- Show representative evidence and important slices, not a single aggregate score.
- Offer a bounded decision: selective reranking, a latency guardrail, cohort rollout, and stop condition.
Follow-up probes
- What if the customer asks for “best quality” at any cost?
- How will users notice the difference?
Avoid jargon-only explanations; include choice, consequence, evidence, and control.
Q14How do you decide whether technical debt should displace roadmap work?
Strong answer outline
- Quantify recurring delivery drag, incident exposure, security risk, and option value.
- Compare remediation size and timing against roadmap impact; separate urgent containment from durable repair.
- Propose a measurable slice with owner, success signal, and stop rule.
Follow-up probes
- What if the risk has never caused an incident?
- How do you avoid a vague “20% debt” program?
Prioritize by expected consequence and leverage, not by developer annoyance or architectural purity.
Proof artifact: the senior-signal packet
Create one reviewable packet that combines leadership, writing, implementation, and explanation. Use a real project only where you can disclose it; otherwise build a clearly labeled sandbox case.
Build it
- Choose a decision such as adding a reranking stage to a multi-tenant RAG service.
- Write a two-page design memo and one ADR with criteria, alternatives, security, operations, rollout, rollback, and revisit triggers.
- Implement a small async API plus a SQL report. Add tests for invalid input, timeout, cancellation, duplicate requests, and cross-tenant access.
- Request or simulate review; classify comments and record which feedback changed the design.
- Prepare a two-minute leadership account that states personal ownership without inventing project results.
Measure it
- Memo: decision visible in the first 200 words; every risk has an owner or acceptance statement.
- Code: test pass rate, branch coverage for critical failure paths, static checks, and p50/p95 latency under a declared load.
- Communication: a reviewer can state the decision, main trade-off, and next action after one read.
- Practice: solve and explain the coding task within a fixed time; log clarification, implementation, and verification minutes separately.
If you need numbers before measurement, label them as targets. For example: “hypothetical target: p95 below 800 ms at 20 requests/second,” never as a achieved result.
Inject failure deliberately
Make one downstream call exceed its timeout, send the same idempotency key twice, cancel the client request mid-flight, and attempt a cross-tenant identifier. Verify cleanup, stable error behavior, one durable side effect, and useful trace context. Then seed an AI-generated implementation with a subtle missing tenant predicate and demonstrate that review or tests catch it.
Present it
Bring the memo, ADR, small repository, test report, one trace, review log, and a ten-minute recording. Present the decision in two minutes, code invariant in two, failure evidence in three, and learning in one; reserve two minutes for questions.
Chapter review
Leadership is decision quality plus leverage. Coding is a visible chain from contract to proof. Remote communication is successful when another person can decide or act without recovering missing context.
Glossary
- ADR
- A short, durable record of an architecture decision, its context, consequences, and revisit conditions.
- Invariant
- A property that remains true while an algorithm progresses and supports its correctness argument.
- Leverage
- An intervention that improves the output or judgment of people beyond the author’s own task.
- Structured concurrency
- A model in which concurrent tasks have explicit ownership and bounded lifetimes.
- Revisit trigger
- Observable evidence that should cause a prior decision to be re-examined.
- Window function
- A SQL calculation across related rows while retaining each input row.
Mastery checklist
- I have six distinct, truthful stories with personal actions and defensible evidence.
- I can name the decision owner, rejected option, and revisit trigger in each architecture story.
- I can write an outcome-led update and a two-page memo without a meeting transcript.
- I can distinguish blocker, important, suggestion, and nit review feedback.
- I can solve representative map/window, graph, heap, and basic DP problems while explaining invariants.
- I can reason about async cancellation, SQL ties, API idempotency, authorization, and failure tests.
- I can explain exactly how I verify AI-assisted code.
Primary sources
- Remote — Senior Forward Deployed Engineer (role active when checked).
- Sourcegraph — Agent Engineer IC4 (role active when checked).
- Python documentation — coroutines and tasks.
- PostgreSQL documentation — window functions and using EXPLAIN.
- Google Engineering Practices — code review.
- GitHub Docs — pull-request reviews.
Checked: 2026-08-04. Role requirements and URLs are volatile; re-open the official posting before applying.