ZS Associates interview question

Critical thinking/ math on cases