CMR Surgical interview question

Write a piece of code.