Thoughtworks interview question

Code pairing- oops desing question