Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Pre DSA Practice Set (Java)

A curated collection of fundamental Java programs designed to strengthen your basics, logic building, and problem-solving skills — the perfect foundation before diving into Data Structures & Algorithms (DSA).

These exercises cover conditionals, loops, functions, and pattern printing, helping you master Java syntax and core programming logic.


📁 Folder Structure

PRE-DSA-PRACTICE-SET/
│
├── 01basic/        # Basic logic and condition-based programs (33 questions)
│   ├── EvenOddFirst.java
│   ├── Product.java
│   ├── LeapYear.java
│   ├── SimpleCalculator.java
│   └── ...
│
├── 02loop/         # Programs using loops (for, while, do-while)
│
├── 03function/     # Programs using user-defined functions
│
├── 04basic2/       # Advanced logic-based programs (Perfect No., Palindrome, etc.)
│
└── 05pattern/      # 36 pattern problems (stars, numbers, alphabets)
    ├── StarPattern1.java
    ├── StarPattern2.java
    └── ...

🧩 Topics Covered

🟢 Basics

  • Print statements and simple calculations
  • Arithmetic operations (product, average, area of circle)
  • Conditional statements (if-else, switch)
  • Even or odd (multiple approaches)
  • Simple calculator using switch
  • Leap year check
  • Largest among numbers
  • Day of week using switch
  • Swap two numbers (with & without third variable)

🔵 Loops

  • Print numbers using for / while loop
  • Sum and product of natural numbers
  • Reverse a number
  • Factorial of a number
  • Multiplication table
  • Keep entering numbers until a condition is met

🟣 Functions

  • Product of two numbers using a function
  • Binomial coefficient (nCr)
  • Prime number check (optimized)
  • Print primes in a range
  • Prime factors of a number
  • Print first N natural numbers

🟠 Advanced Basics (Basic2)

  • Perfect number check
  • Count digits / Sum of digits
  • X raised to power Y
  • Fibonacci series
  • Palindrome number
  • Armstrong number
  • LCM and HCF
  • Convert Binary ↔ Decimal

🔺 Pattern Programs (05pattern)

Includes 36 pattern problems using nested loops:

  • Right-angled & inverted triangles
  • Pyramids and diamonds
  • Number & alphabet patterns
  • Mirror and combined patterns

Each file (StarPattern1.javaStarPattern36.java) demonstrates unique loop logic, helping you master nested iteration and space control.


🎯 Purpose

This practice set is designed to:

  • Strengthen core programming fundamentals
  • Improve logical and analytical thinking
  • Prepare you for Data Structures & Algorithms (DSA)
  • Build confidence in Java syntax & problem solving

After completing these, you’ll be fully ready to tackle Arrays, Strings, Recursion, and beyond.


🧰 Tech Stack

  • Language: Java
  • Editor: Visual Studio Code
  • Execution: Command line or integrated terminal

🚀 How to Run

# Step 1: Compile the program
javac FileName.java

# Step 2: Run the compiled class
java FileName

👨‍💻 Author

Ebadur Rahman 💼 Software Developer | MERN Stack | Laravel | PHP 🔗 LinkedIn


Contributions Welcome

You can:

  • Fork the repo and solve the same problems in another language
  • Add new questions or optimize existing solutions
  • Suggest improvements or alternative logic

📚 Next Steps

Once you complete this set, move on to:

  • Arrays & Strings
  • Searching & Sorting
  • Recursion
  • Linked List, Stack, Queue
  • Tree & Graph
  • Dynamic Programming (DP)

“Master the basics — everything else becomes easier.”

About

A collection of 60+ beginner-level programming and pattern problems designed to strengthen core logic, syntax, and problem-solving skills before starting Data Structures and Algorithms (DSA). Perfect for beginners to practice basic coding concepts in C, C++, or Java.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages