XYZ interview question

inheritance loops classes