Revinate interview question

How to code?