DRW interview question

linear algebra and probability problems, easy~medium difficulty