MathProblems.java - An short programming interview question asked by Amazon SLO