EY interview question

Capital gain computation