Google Interview Question

Screening question: Write a "recursiveDescription" function for a UIView that prints out subviews tree in a following example: <UIView> | <UIScrollView> | | <UIView> | | | <UILabel> | <UIView> | | <UILabel> A similar example could be a recursive iteration in folders/files or a tree.

Interview Answer

Anonymous

Jun 17, 2022

Recursion is a good way to resolve especially taking into account that a view tree cannot be cyclical.