Pregunta de entrevista de Webtech Developers

in technical interview they asked 2 coding questions first was factorial with some modifications