Deutsche Bank interview question

Nothing difficult if you know core Java and not stupid