J.P. Morgan interview question

behavior question with a bit coding ones