Coding Question
This code is in python
1. Problem: Sum of Two Numbers
Ans. Given two integers, write a function to return their
Sum
2. Factorial of a Number
Ans. Write a function to calculate the factorial of a non-
negative integer.
3. Problem: Fibonacci Sequence
Ans . Write a function to generate the nth number in the
Fibonacci sequence
4. Problem: Palindrome Check
Ans. Write a function to check if a given string is a
palindrome.
5. Problem: Prime Number Check
Ans. Write a function to check if a given number is prime.
6. Problem: Reverse a String
Ans. Write a function to reverse a given string.
7. Problem: Count Digits in a Number
Ans. Write a function to count the number of digits in a
positive integer.
8. Problem: Find Maximum Number
Ans. Write a function to check if a given integer is even or
odd.
9. Problem: Check Even or Odd
Ans. Write a function to check if a given integer is even or
odd.
10. Problem: Calculate Power
Ans. Write a function to calculate the result of raising a
number to a given power.
This Code is in java
1. Reverse a String
Ans. Write a function to reverse a given string.
2. Check Palindrome
Ans. Write a function to check if a given string is a
palindrome.
3. Factorial of a Number
Ans. Write a function to calculate the factorial of a given
positive integer.
4. Fibonacci Sequence
Ans. Write a function to generate the nth Fibonacci
number
5. Check Prime
Ans. Write a function to check if a given positive integer is
prime.
6. Count Occurrences
Ans. Write a function to count the occurrences of a
specific element in an array
7. Check Anagram
Ans. Write a function to check if two given strings are
anagrams of each other
8. Reverse an Arra
Ans. Write a function to reverse the elements of an array
in-place.