Redfin Interview Question

to design a Russian blocks; one about tree, one about matrix.