Complete Java Coding Topics for MNC Company
Interviews
1. Basic Java Programs
• ■ Print Hello World
• ■ Swap two numbers (with and without third variable)
• ■ Find even or odd number
• ■ Find largest of 3 numbers
• ■ Check leap year
• ■ Check palindrome (number & string)
• ■ Reverse a number / string
• ■ Find factorial (loop & recursion)
• ■ Fibonacci series
• ■ Check prime number
• ■ Sum of digits
• ■ Armstrong number
• ■ Strong number
• ■ Perfect number
• ■ Find GCD / HCF / LCM
• ■ Count digits
• ■ Check vowel or consonant
• ■ Check positive, negative, or zero
• ■ Print multiplication table
• ■ Find power without Math.pow()
2. Array-Based Programs
• ■ Find largest/smallest element
• ■ Find second largest/smallest
• ■ Sum and average
• ■ Sort array
• ■ Reverse array
• ■ Copy array
• ■ Remove duplicates
• ■ Find missing number
• ■ Separate even and odd numbers
• ■ Merge arrays
• ■ Rotate array
• ■ Find frequency of elements
• ■ Check if array is palindrome
• ■ Find common elements
• ■ Linear and Binary search
3. String Programs
• ■ Reverse string
• ■ Check palindrome string
• ■ Count vowels/consonants
• ■ Count words in string
• ■ Find frequency of characters
• ■ Remove white spaces
• ■ Remove duplicate characters
• ■ Find first non-repeating character
• ■ Check anagram
• ■ Convert to uppercase/lowercase
• ■ Check substring present or not
• ■ Sort characters
• ■ Find word occurrence
• ■ Replace vowels
• ■ Swap two strings without third variable
4. Pattern Programs
• ■ Pyramid
• ■ Inverted pyramid
• ■ Diamond
• ■ Floyd’s triangle
• ■ Pascal’s triangle
• ■ Number triangle
• ■ Star hollow patterns
• ■ Right-angle triangle
• ■ Reverse right-angle triangle
• ■ Square and rectangle patterns
5. OOPs Concepts
• ■ Class and Object
• ■ Constructors
• ■ Method overloading/overriding
• ■ Inheritance
• ■ Abstract class/method
• ■ Interface
• ■ Encapsulation
• ■ Polymorphism
• ■ Static keyword
• ■ This & Super keyword
• ■ Final keyword
• ■ Wrapper classes
• ■ Exception handling
• ■ Custom exception
• ■ instanceof operator
6. Collections Framework
• ■ ArrayList operations
• ■ LinkedList example
• ■ HashSet & TreeSet
• ■ HashMap operations
• ■ Iterate through Map
• ■ Sorting using Collections.sort()
• ■ Comparator & Comparable
• ■ Convert Array <-> List
• ■ Count frequency using HashMap
• ■ Find duplicates using Set
7. Recursion and Logical Programs
• ■ Factorial
• ■ Fibonacci
• ■ Sum of digits
• ■ Reverse number
• ■ Tower of Hanoi
• ■ Binary search recursive
• ■ Count vowels recursively
• ■ Power of number recursively
8. File Handling & Streams
• ■ Write file using FileWriter
• ■ Read file using BufferedReader
• ■ Copy contents
• ■ Append text
• ■ Count lines, words, characters
9. Java 8 Features
• ■ Lambda expressions
• ■ Functional Interface
• ■ Stream API (filter, map, collect)
• ■ Optional class
• ■ Method reference
• ■ forEach() method
• ■ Sort list using streams
10. Mini Coding Challenges
• ■ Check string rotation
• ■ Find pairs with sum
• ■ Check balanced parentheses
• ■ Find subarray with given sum
• ■ Find first repeating/non-repeating element
• ■ Move zeros to end
• ■ Find duplicate characters
• ■ Check happy number
• ■ Find intersection of arrays
• ■ Reverse words in sentence