design a good question is not easy.
although most of the UI design (layout, animation, verification) could done without script,
at least basic level of coding skill is required.
from the structure of code been used,
you might see if the thought and logic is clear.
it seem can be done with single loop,
but you need some extra control,
which may make the loop - condition not so reading friendly,
as for double loop solution,
which may be more easier to read and understand for most of the people.
this question should not have a "standard answer".
but why they explain why they doing this way.
Yes, there is no standard answer, the problem is that they can't even produce the answer.
You want to do it via nested loop, single loop or even just pop off the array and console.log it at each iteration. I'm ok, as long as you can produce the result and explain the thought process.
The frontend candidates so far seem to think that by asking them questions like these, means we're expecting their workload to be algorithmically heavy and say things like "we don't do calculatiosn in the frontend".