Yellow Pages interview question

Nothing difficut to answer