Skip to main content

Independent Refactoring Assessment

Allow 2–3 hours for an initial attempt; this is an estimate, not a speed gate. Close solution keys and reference implementations, record tools used, and explain concrete traces. Use the competency rubric.

A01​

A helper extraction passes all happy-path tests but changes a header write from before input validation to after it. Is it preserving this module’s invoice contract? Give a witness.

A02​

Three rows each cost 0.005, deadline is 10, and now is 10. Calculate the baseline total. Compare rounding only the final sum, then move now to 9.

A03​

A clock parameter defaults to a timestamp captured at module import. Explain why this is not equivalent to reading time after invoice iteration and propose a seam.

A04​

A PR includes two separate extraction commits and one rounding-policy change. A reviewer says Git bisect cannot work. Assess the claim and the evidence needed.

A05​

You inline twice(next()) where twice(x) returns x+x. The new expression is next()+next(). Diagnose and repair it.

A06​

The old parser looks up a SKU before converting quantity. For X 2x both are invalid. A new typed parse phase converts first. State the old and new outcomes and a preserving alternative.

A07​

A returns true after logging; B raises. Compare sequential same-result guards, A() || B() in JavaScript, and helper(A(),B()).

A08​

Old and new Grid clients pass separate tests, but an old write cannot be read by a new client. Identify the missing invariant and a bounded repair.

A09​

A provider accepts a write and then times out. A flag routes fallback to the old provider. What can go wrong, and what evidence would a retry policy need?

A10​

A compatibility alias has no callers in this repository. A migration also changed persisted records. Decide what is still needed before deleting the alias and rolling old code back.