Java Programming Practice Questions
Easy-Level Coding Questions
Easy Level - Arrays
1. Find the Maximum Element in an Array
2. Reverse an Array
3. Check if an Array Contains a Specific Value
4. Calculate the Sum of All Elements in an Array
5. Remove Duplicates from an Array
6. Find the Second Largest Element in an Array
7. Move All Zeroes to the End of the Array
8. Rotate an Array by One Position
9. Find the Missing Number in a Sequence
10. Check if the Array is Sorted
Easy Level - Strings
1. Check if a String is a Palindrome
2. Reverse a String Without Using Built-in Functions
3. Count the Number of Vowels and Consonants in a String
4. Remove Duplicate Characters from a String
5. Check if Two Strings are Anagrams
6. Capitalize the First Letter of Each Word in a String
7. Check if a String Contains Only Letters and Digits
8. Count the Occurrences of a Specific Character in a String
9. Replace All Spaces in a String with a Given Character
10. Convert All Lowercase Characters to Uppercase in a String
Easy Level - OOP
1. Implement an Abstract Class and Its Subclass
2. Demonstrate Method Overloading in Java
3. Demonstrate Method Overriding in Java
Java Programming Practice Questions
4. Use the 'super' Keyword in Inheritance
5. Create an Interface and Implement It in a Class
6. Demonstrate Polymorphism with a Simple Example
7. Implement Encapsulation in a Java Class
8. Use of 'this' Keyword in Java
9. Create a Class Hierarchy Representing Different Types of Vehicles
10. Override the 'toString' Method in a Custom Class
Medium-Level Coding Questions
Medium Level - Arrays
1. Find the Leader Elements in an Array
2. Implement Kadane's Algorithm for Maximum Subarray Sum
3. Rotate an Array by K Positions
4. Find the Duplicate Number in an Array
5. Merge Overlapping Intervals in an Array
6. Find the Intersection of Two Arrays
7. Find the Union of Two Arrays
8. Find the Longest Consecutive Sequence in an Array
9. Sort an Array of 0s, 1s, and 2s Without Using Sorting Algorithms
10. Find the Majority Element in an Array
Medium Level - Strings
1. Find the Longest Substring Without Repeating Characters
2. Compress a String by Replacing Repeated Characters with Their Count
3. Group Anagrams from a List of Strings
4. Find the Longest Palindromic Substring in a Given String
5. Check if Two Strings are Isomorphic
6. Implement a Function to Perform Basic String Compression
7. Check if a String is a Valid Shuffle of Two Other Strings
Java Programming Practice Questions
8. Find All Permutations of a Given String
9. Count the Number of Words in a String
10. Convert a Roman Numeral to an Integer
Medium Level - OOP
1. Design a Class Hierarchy for Geometric Shapes (Circle, Rectangle, Triangle)
2. Implement a Real-World Scenario Using Abstraction (e.g., Banking System)
3. Demonstrate Polymorphism with a Vehicle Example (Car, Bike, Truck)
4. Use Interfaces to Achieve Multiple Inheritance in Java
5. Override the 'equals' and 'hashCode' Methods in a Custom Class
6. Implement a Singleton Design Pattern in Java
7. Create a Factory Design Pattern for Creating Different Types of Objects
8. Implement the Observer Design Pattern in Java
9. Demonstrate the Use of Abstract Classes and Interfaces Together
10. Create a Custom Exception and Use It in a Program
Additional Resources with Links
Additional Resources with Links
Arrays:
- Top 50 Array Coding Problems:
https://www.geeksforgeeks.org/top-50-array-coding-problems-for-interviews/
- Java Arrays Practice Problems: https://www.geeksforgeeks.org/java-arrays-coding-practice-problems/
- Conceptual Array Questions: https://www.geeksforgeeks.org/top-array-interview-questions-and-answers/
Strings:
- Top 50 String Coding Problems:
https://www.geeksforgeeks.org/top-50-string-coding-problems-for-interviews/
- Java Strings Practice Problems: https://www.geeksforgeeks.org/java-strings-coding-practice-problems/
Java Programming Practice Questions
- String Problems by Topic: https://www.geeksforgeeks.org/string-problems-topicwise/
OOP:
- Java OOPs Practice Problems: https://www.geeksforgeeks.org/java-oops-coding-practice-problems/