J.P. Morgan Interview Question

behavior question with a bit coding ones