Distribusion interview question

Code refactoring of a method.