The customer case
A customer asks you to standardize internal identifiers across a large repository. You already have a function that converts one name to the new convention. Design a migration that preserves external APIs, third-party calls and runtime behavior, while producing changes maintainers can review.
Original exercise informed by a second-hand Google Senior FDE phone-screen report. Its interview date is unspecified and the retrieved page gives only relative publication age. The account is promotional and unverified; this is not a confirmed Google question or expected solution. Reviewed September 26, 2026.
1. Agree on what may change
Start with a written boundary: which languages, packages and symbol kinds are in scope? Assume a Python service repository with generated clients, external integrations and some dynamic attribute access. Internal local names may change; public function parameters, serialized field names, database columns and third-party identifiers remain stable unless separately versioned. Ask who consumes supposedly internal packages before labeling them private.
Success means preserved observable behavior and a reproducible migration, not the largest number of changed files. Spend 5 interview minutes on boundaries, 10 on analysis, 10 on transformation, 10 on verification and 10 on rollout. An FDE must negotiate a feasible first slice when the customer asks to migrate everything in one weekend.
2. Build an inventory before changing source
Logical flow: immutable repository snapshot → language-aware symbol inventory → risk classification → proposed rename map → deterministic transformation → verification → reviewed patch batches. Pin the baseline revision, dependencies and tool versions. Record each proposed symbol's definition, references, owner, new name, exclusion reason and unresolved uses.
Use a parser and scope/binding information to distinguish identifiers from comments, strings, attributes and unrelated names in other scopes. A concrete syntax tree can preserve formatting while rewriting Python, but parsing alone is not whole-program symbol resolution. Dynamic imports, reflection, decorators, plugins and monkey patching require explicit exceptions or runtime evidence.
Give the tool a dry-run mode that emits a change manifest and diff without writing the customer branch. Stop on unresolved ambiguity instead of silently falling back to text replacement. Exclude vendored/generated directories and regenerate owned generated code from its source definition when a change is actually authorized.
3. Work through a deceptively simple rename
Suppose fetchUser(userId) becomes fetch_user(user_id). Renaming a local positional parameter may be safe, but callers using fetchUser(userId=7) depend on the keyword name. An HTTP response containing {"userId": 7} is a separate wire contract; converting that string breaks clients. An external SDK call such as sdk.fetchUser(7) must remain unchanged.
Check collisions before applying the map: parseURL and parseUrl could both become parse_url. Preserve exported aliases or compatibility wrappers where needed, with an explicit removal plan. A wrapper must preserve signatures, exceptions and async behavior; wrapping a coroutine with an ordinary function can change how it is called.
For reflection such as getattr(service, configured_name), the source reference may live in configuration outside the repository. Classify it as unresolved until the owner supplies the contract. Unit tests passing on one configuration do not establish that every deployed integration is safe.
4. Verify behavior independently of the rewrite
Run baseline checks first and record pre-existing failures. After transformation, parse every changed file, run language-specific static checks where configured, and execute tests with frozen dependencies. Add focused before/after fixtures for shadowed variables, imports, decorators, keyword callers, collisions and ignored string keys. Applying the migration twice should produce no second diff.
Do not let the same transformation rewrite every assertion into agreement with its own mistake. Preserve independent API contract fixtures and run representative requests against old and new builds, comparing normalized outputs, exceptions and side effects. Nondeterministic timestamps need normalization; masking every difference defeats the check.
In a Python repository, a type checker can find some broken references only to the extent that types and import configuration are accurate. For a TypeScript variant, compiler checking with no emitted artifacts helps catch binding errors, but still cannot prove external API compatibility. A green compiler is evidence, not a behavior proof.
5. Estimate delivery effort rather than promising magic
Assume 12,000 source files, 40 ms average analysis time per file and eight independent workers. Pure analysis has an ideal lower bound of 12,000 × 0.04 / 8 = 60 seconds; repository-wide resolution, startup, I/O and skew add time. Verification may dominate: a 45-minute integration suite is not made cheap by a one-minute transform.
If 2,000 symbols are candidates and 8% require manual treatment, that is 160 symbols. At six minutes each, review alone is 16 person-hours before fixes and retesting. Sample the uncertainty rate early, report a range and use a smaller pilot to calibrate estimates. File count is a poor proxy for semantic risk.
Batch by dependency boundary and ownership, not arbitrary chunks of 1,000 lines. Twenty tightly coupled callers may be safer to migrate together than two distant exported symbols. Too many tiny batches repeat full CI cost; one enormous patch hides risky cases. Choose a batch size maintainers can understand and revert.
6. Handle branch drift and customer acceptance
Make transformation output conditional on the analyzed source revision or file digest. If concurrent edits change a file, rerun analysis against the new revision rather than applying an old offset patch. Keep the manifest so reviewers can tell deterministic edits from manual exceptions. If a tool crashes halfway, discard or resume its isolated output; never leave a production checkout in an uncertain partially rewritten state.
Pilot one owned package, review its contracts, then expand through dependency-aware batches. Preserve compatibility across mixed old/new deployments where required. Rollback restores a known artifact and its compatible interfaces; reverting names cannot undo external data-schema changes, which are intentionally outside the baseline scope.
Hand over the tool, pinned environment, exclusions, reproducible commands, acceptance evidence and an owner for remaining exceptions. Report unresolved symbols openly. If an AI assistant proposes fixes, treat its output as an untrusted patch subject to the same checks; repository text must not grant the tool new credentials or production access.
7. Defend the trade-off
Foundation: explain why global replacement changes more than symbols. Senior: handle keyword arguments, dynamic references and transformed tests. Staff: negotiate compatibility across independently deployed consumers and incomplete ownership information.
Score 0–2 each for scope, binding-aware transformation, independent verification, branch-drift handling and customer handoff. Two points require a mechanism and a limitation. Compare with production rollout and agent execution boundaries.
Sources and next steps
- Second-hand Google FDE migration report — topic inspiration only.
- LibCST codemod documentation — transformation tooling background.
- TypeScript noEmit option — static-checking variant.
The example repository, migration protocol, effort estimates and rubric are original educational material.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.