HARMAN interview question

Factorial, sql