30 Practice Questions (JavaScript)

🔹 🟢 Easy Level (1–10)

  1. Check if a number is positive or negative
  2. Check if a number is even or odd
  3. Check if a person is eligible to vote (18+)
  4. Find the largest of two numbers
  5. Print numbers from 1 to 10 using for loop
  6. Print numbers from 10 to 1 (reverse)
  7. Print even numbers from 1 to 20
  8. Print odd numbers from 1 to 20
  9. Take a number and print its square
  10. Check if a number is divisible by 5

🔹 🟡 Medium Level (11–20)

  1. Find the largest of three numbers
  2. Check if a number is multiple of 3 and 5
  3. Print numbers from 1 to N (user input)
  4. Find the sum of first N natural numbers
  5. Print the multiplication table of a number
  6. Count numbers from 1 to 50 divisible by 7
  7. Reverse a number (e.g., 123 → 321)
  8. Count digits in a number
  9. Check if a number is palindrome
  10. Print this pattern:
*
**
***
****
*****

🔹 🔴 Hard Level (21–30)

  1. Find the factorial of a number
  2. Check if a number is prime
  3. Print all prime numbers from 1 to 100
  4. Generate Fibonacci series up to N terms
  5. Print this pattern:
1
12
123
1234
12345
  1. Find the sum of digits of a number
  2. Find the largest digit in a number
  3. Create a simple calculator using switch ( + – * / )
  4. Guessing game with limited attempts (5 tries)
  5. Print this pattern:
*****
****
***
**
*

🎯 Bonus Challenge (for smart students)

👉 FizzBuzz (very popular interview question)

  • Print numbers 1–50
  • If divisible by 3 → “Fizz”
  • If divisible by 5 → “Buzz”
  • If both → “FizzBuzz”