Rubique interview question

Data structure questions.