Numerator interview question

Basics of java