Aloha Technology interview question

Write a factorial program and explain it and define class syantax.