LinkedIn interview question

A question about modular inverse basically had a pnc problem