Cornerstone OnDemand interview question

Write a factorial program in java.