The question asked was to find the Number of islands in a grid (https://leetcode.com/problems/number-of-islands/) . I solved this with a reasonable amount of time left, which was then followed up with a few interesting question as follows -

Q.) What if the island could extend to a distance of K units including water (0) as a part of it ? How would this impact the functions and base condition of recursion?

Q.) What would be the time complexity in above case ?

Q.) Can we use parllelization/ multi threading to solve this problem ?

Q) If multiple threads are used in the below example, how would you determine which thread to terminate ?

[[1,0,0,0,0,1],

[1,0,0,0,0,1],

[1,0,0,0,0,1],

[1,0,0,0,0,1],

[1,1,1,1,1,1]],