Syed Interview Question

1) loops 2) logical thinking question