What is method swizzling and when to use it?
Essence
Swizzling is replacing the implementation (IMP) of an existing method at runtime through the Obj-C runtime API. Most often it is swapping the IMPs of two selectors with method_exchangeImplementations, less often a direct replacement with method_setImplementation while keeping the old IMP. The effect is global: all instances of the class change, and of all subclasses that did not override the method.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep