Java interview Questions
Java interview Questions
Java is one of the most widely used programming languages for building enterprise
applications, web services, and Android applications. Preparing for a Java interview
requires a strong grasp of fundamental concepts, object-oriented principles,
multithreading, collections, exception handling, and Java 8+ features.
This guide provides a structured set of Core Java interview questions along with
useful resources to help you prepare effectively.
What is a constructor?
Object-Oriented Programming
What is inheritance?
What is polymorphism?
What is abstraction?
What is encapsulation?
What is composition?
What is aggregation?
Multithreading
What is multithreading?
What is synchronization?
What is the difference between synchronized method and synchronized block?
What is deadlock?
Java 8 Features
Memory Management
What is externalization?
What is BufferedReader?
What is NIO?
Advanced Concepts
What is composition?
What is aggregation?
Java EE Basics
What is JDBC?
What is a servlet?
What is JSP?
Check the list of Operating System interview questions covering various topics like
definitions, memory management, processes, file systems, scheduling algorithms, and
advanced concepts, which will help you prepare well for interviews. This will be
useful for both beginners and experienced professionals.
1. Basic Concepts
What is a kernel?
What's the main purpose of an OS? What are the different types of OS?
What are the benefits of a multiprocessor system?
What is RAID structure in OS? What are the different levels of RAID
configuration?
What is GUI?
What are the different kinds of operations that are possible on semaphore?
What is multitasking?
What is caching?
What is spooling?
What is a dispatcher?
What is concurrency?
What are the necessary conditions which can lead to a deadlock in a system?
What is a deadlock?
2. Process Management
What is a process?
What is a process and process table?
Explain the states of a process (e.g., new, ready, running, waiting, terminated).
What is a Thread?
What is multithreading?
What is FCFS?
What is Reentrancy?
What is segmentation?
What is thrashing?
What is fragmentation?
4. File Systems
Explain the difference between FAT, NTFS, and ext4 file systems.
What is the purpose of the open(), read(), write(), and close() system calls?
What is the role of the File Allocation Table (FAT) in the FAT file system?
5. Deadlocks
What is a deadlock?
Explain the four necessary conditions for a deadlock (mutual exclusion, hold
and wait, no preemption, circular wait).
What is IPC?
What is a semaphore?
What is the producer-consumer problem, and how can IPC mechanisms solve
it?
What is the difference between RAID 0, RAID 1, RAID 5, and RAID 10?
What is the difference between a solid-state drive (SSD) and a hard disk drive
(HDD)?
What is a rootkit?
Explain the principle of least privilege.
9. Advanced Topics
What is a hypervisor?
Encapsulation : The concept of bundling data and methods that operate on the
data within a single unit (class). This helps protect the integrity of the data by
restricting direct access to it.
What is a class?
What is an object?
3. Encapsulation
What is encapsulation?
What is the difference between public, private, and protected access modifiers?
What is the concept of access specifiers, and when should we use these?
4. Abstraction
What is Abstraction?
What happens if a subclass does not implement all abstract methods of a parent
class?
5. Inheritance
What is a subclass?
Define a superclass?
What is an interface?
6. Polymorphism
What is Polymorphism?
What is composition?
What is an exception?
9. OOP in Practice
Are class and structure the same? If not, what's the difference between a class
and a structure?
What is a destructor?
What are the differences between the constructor and the method in Java?
Dear Students
3. What do you understand about Object Oriented Programming? Explain the major features of
object oriented programming.
7. Write a program to calculate the Least Common Multiple (LCM) of two numbers. Example :
Input : a = 10, b =15 Output : 30 a = 5, b = 7 Output : 35
8. Write a program to sort a given array of numbers. The sorting algorithm should give best
performance in every case (best, worst and average). Example : Input : arr = {3, 5, 7, 1, 2, 4, 6}
Output : {1, 2, 3, 4, 5, 6, 7}
9. You have 15 rupees on you. You enter a shop and the shopkeeper informs you that each
chocolate costs one rupee. He also informs you that in exchange for three wrappers, you will
receive a chocolate. How many chocolates can you eat in total?
10. What do you understand by super key, candidate key, primary key and foreign key in the
context of database management systems?
14. Explain the Open Systems Interconnection (OSI) model in the context of computer networks.
16. Write a query in SQL to find the details of an employee having the nth highest salary from a
given table Employee. The value of n needs to be taken as user input. Assume that the table
Employee has the following schema.
21. Given two unsorted arrays. Check if the second array is a subarray of the first array.
22. Given a string as an input, write a program to reverse the words in the given string and
display the new string.