Write a program to find the factorial of a number.
Answer:
Python3
def factorial(n): if n = = 0 : return 1 else : return n * factorial(n - 1 ) # Example usage print (factorial( 5 )) # Output: 120 |
Explanation: This recursive function calculates the factorial of a non-negative integer n
. If n
is 0, the factorial is 1. Otherwise, it recursively multiplies n
by the factorial of n-1
until reaching the base case of 0.
Software Developer Interview Questions
Software developer interview questions can cover a wide range of topics, depending on the specific role, company, and level of experience being targeted. The software developer interview questions aim to assess a candidate’s technical skills, problem-solving abilities, communication skills, and fit for the role and the company.
Table of Content
- Interview Questions for Internship and Fresher Level
- Interview Questions for Software Development Engineer SDE 1 level
- Interview Questions for Software Development Engineer SDE 2 level
- Interview Questions for Software Development Engineer SDE 3 level