Checkr interview question

Selenium pseudo code:: Window handling scenario