Domanda di colloquio di SEB AB

when would I consider abstracting code to its own method/pattern