Frage im Vorstellungsgespräch bei Microsoft

Num of Islands Leetcode variation, Object oriented programming question