AltSource interview question

Small whiteboard exercise for a simple math function