Zinier Interview Question

Design an organization model. Write an algorithm which takes memberId and returns the entire hierarchy down to it's node. Logical question on 2D matrix. Need to derive a mathematical formula that would evaluates to find the minimum distance taken by Robot on 2D matrix. Abstract Reasoning and circumstantial questions were really good.