BNY interview question

Some oops and sql related questions (medium difficulty)