IBM Interview Question

GD was a bit tough