Step 7 — Principal Engineer Review
Answer in writing. Several have defensible answers on more than one side; "it depends" is acceptable only if you say on what.
1. Users report the dashboard "gets slow after a few hours". Nothing reproduces on a fresh load. Give three hypotheses — at least one that is not a memory leak — and the cheapest experiment that distinguishes them. What single field would you add to your triage runbook so the next person does not have to be clever?
2. An engineer reports a leak: "heap grew 40 MB over ten minutes of use." What do you ask before accepting it? Your measurement in Step 6 produced R² = 0.742 on a clean workload — use it.
3. A teammate proposes a lint rule requiring every addEventListener to have a matching
removeEventListener. Make the strongest case for, then against. What would you actually ship,
and what would it fail to catch?
4. Your design system ships a useResizeObserver hook used by 40 teams. Specify its teardown
contract. What must it not let callers do? What happens if a caller stores the observed element
in a module-level Map — is that your problem, and how would you know it happened?
5. A team fixes a detached-DOM leak by adding element = null in 30 places. It works. What is
your review comment? Under what circumstances is the diff actually correct?
6. You must choose between WeakMap and an LRU cache for a query cache keyed by request
objects. What information decides it? Give a scenario where WeakMap is dangerous rather than
merely insufficient.
7. Memory is not in your organisation's performance budget. Propose an addition. What is measured, what is the threshold, where is it enforced, and what makes it resistant to being disabled after the third false positive?
8. A third-party analytics script retains DOM across route changes: ~2 MB per navigation. Legal requires the script. Enumerate your options in ascending blast radius, say which you propose, and say how you would get agreement from the team that owns the relationship.
9. Your soak test has failed intermittently for three weeks. Nobody has investigated. What went wrong — technically and organisationally — and what do you change first?
10. Explain to a senior engineer why a memory leak can present as an INP regression, and why optimising the interaction handler will not help. What one measurement settles it?
11. WeakRef and FinalizationRegistry are proposed to fix a cache. Explain why this is
almost certainly wrong, and name the narrow cases where it is right.
12. You have one week to reduce leak risk across a 200-engineer frontend organisation. You cannot review every codebase. What do you do, and what do you deliberately not do?
Record
File answers as RESULTS.md in the module directory. Questions 4, 7 and 12 are natural ADRs —
write at least one in ../fe-00-roadmap/docs/decisions/ using the seven-field template, and make
the reversibility and migration sections real rather than perfunctory.
Anything unanswerable goes in ../fe-00-roadmap/docs/learning-log.md §2 as an open question.