Now I am curious to know whether I am too dense to get it or if the candidate was just that off the mark.
Is circle pattern sorta like iterating through a 2d array like a spiral (i.e., outer layer of the 2d-shape first, then one deeper, etc.)? And if yes, why would that ever be useful for just searching for a specific value in a 2d array?
I get how it could be useful for some more niche/specific problems where the layering of the 2d array would actually matter, but is it just entirely off the chain to recommend it here? Because I cannot for the life of me figure out why you would want to do that instead of just iterating, especially considering how significantly less trivial it is to code-up that “circular” iteration (as opposed to just a regular linear iteration).
Sidenote: Is there even a more efficient way to solve that problem, other than just sequentially iterating through the 2d array and simply tracking the value/position of the largest number until you finish iterating over the entire 2d array (assuming it is non-sorted)? It seems way too simple, so I feel like either I am missing something about the problem statement or there is a better solution than the one I proposed.