Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Java interview Questions

The document is a comprehensive guide for preparing for Core Java and Operating System interviews, featuring a structured list of interview questions across various topics such as Java fundamentals, object-oriented programming, multithreading, and operating system concepts. It emphasizes the importance of understanding these concepts for technical interviews and provides insights into best practices and design patterns. The guide also includes advanced topics and Java EE basics, making it a valuable resource for both beginners and experienced professionals.

Uploaded by

ADITYA VERMA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Java interview Questions

The document is a comprehensive guide for preparing for Core Java and Operating System interviews, featuring a structured list of interview questions across various topics such as Java fundamentals, object-oriented programming, multithreading, and operating system concepts. It emphasizes the importance of understanding these concepts for technical interviews and provides insights into best practices and design patterns. The guide also includes advanced topics and Java EE basics, making it a valuable resource for both beginners and experienced professionals.

Uploaded by

ADITYA VERMA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Core Java Interview Questions 2025

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.

Basic Java Concepts

 What is Java and what are its main features?

 Explain the difference between JDK, JRE, and JVM.

 What is platform independence in Java?

 What is the difference between path and classpath?

 What are the different types of variables in Java?

 What is the difference between local and instance variables?

 What are static variables?

 What is a constructor?

 What are the different types of constructors?

 What is the difference between break and continue statements?

 What is the difference between final, finally, and finalize?

 What is the difference between throw and throws?

 What is the difference between == and .equals()?

 What is the difference between String, StringBuilder, and StringBuffer?

 Why is String immutable in Java?


 What is the String pool?

 What are wrapper classes?

 What is the difference between primitive and reference types?

 What is the difference between stack and heap memory?

 What is the difference between shallow copy and deep copy?

 What is the difference between System.out.println() and System.err.println()?

 What is the difference between import and static import in Java?

 What is the difference between instanceof and isInstance()?

Object-Oriented Programming

 What are the main principles of OOP?

 What is the difference between a class and an object?

 What is inheritance?

 Why doesn't Java support multiple inheritance?

 What is method overloading?

 What is method overriding?

 What is polymorphism?

 What is the difference between compile-time and runtime polymorphism?

 What is abstraction?

 What is encapsulation?

 What is the difference between abstract class and interface?

 What is composition?
 What is aggregation?

 What is the difference between association, aggregation, and composition?

 What is the singleton pattern?

 What is the factory pattern?

 What is dependency injection?

 What is the difference between strategy and factory pattern?

 What is the observer pattern?

 What is the decorator pattern?

 What is the difference between tight coupling and loose coupling?

 What is the difference between a concrete class and an abstract class?

 What is the difference between a static method and an instance method?

Data Types and Variables

 What are primitive data types in Java?

 What is type casting?

 What is autoboxing and unboxing?

 What is the difference between == and .equals()?

 What is the difference between String, StringBuilder, and StringBuffer?

 Why is String immutable in Java?

 What is the String pool?

 What are wrapper classes?

 What is the difference between primitive and reference types?


 Explain final keyword with variables, methods, and classes.

 What is the difference between stack and heap memory?

 What is the difference between shallow copy and deep copy?

 What is the difference between int and Integer?

 What is the difference between float and double?

 What is the difference between char and Character?

Control Flow and Exception Handling

 What are the different types of loops in Java?

 What is the switch statement?

 What is exception handling?

 What is the difference between checked and unchecked exceptions?

 What is the try-with-resources statement?

 Explain the hierarchy of Exception classes.

 What is the difference between throw and throws?

 What is the finally block?

 Can we have try without catch?

 What is exception propagation?

 What is the difference between final, finally, and finalize?

 What is the difference between Error and Exception?

 What is the purpose of the assert keyword?

 What is the difference between throw and throws?


Collections Framework

 What is the Collections Framework?

 What is the difference between List and Set?

 What is the difference between ArrayList and LinkedList?

 What is the difference between HashSet and TreeSet?

 How does HashMap work internally?

 What is the difference between HashMap and Hashtable?

 What is the difference between HashMap and ConcurrentHashMap?

 What is the load factor in HashMap?

 What is the difference between fail-fast and fail-safe iterators?

 How to make a collection read-only?

 What is the difference between shallow copy and deep copy?

 What is the difference between Iterator and ListIterator?

 What is the difference between Comparable and Comparator?

 What is the difference between Vector and ArrayList?

Multithreading

 What is multithreading?

 What is the difference between process and thread?

 What are different ways to create threads?

 What is synchronization?
 What is the difference between synchronized method and synchronized block?

 What is deadlock?

 What is thread starvation?

 What is the volatile keyword?

 What is the difference between wait() and sleep()?

 What is thread pool?

 What is the difference between final, finally, and finalize?

 What is the difference between notify() and notifyAll()?

 What is the difference between yield() and join()?

 What is the difference between Callable and Runnable?

Java 8 Features

 What are lambda expressions?

 What are functional interfaces?

 What is Stream API?

 What is the difference between intermediate and terminal operations in


streams?

 What is Optional class?

 What are default methods?

 What is method reference?

 What is the difference between Comparator and Comparable?

 What are the new features in Java 8 Date/Time API?


 What is forEach() method in Iterable interface?

 What is the difference between Predicate and Function?

 What is the difference between map() and flatMap() in Stream API?

 What is the purpose of Collectors in Java 8?

Memory Management

 How is memory managed in Java?

 What is garbage collection?

 What are different types of references in Java?

 What is memory leak?

 What is the difference between stack and heap memory?

 What is the OutOfMemoryError?

 What are different types of garbage collectors?

 What is the finalize() method?

 What is the difference between final, finally, and finalize?

 How to force garbage collection?

 What is the difference between SoftReference and WeakReference?

 What is the difference between Minor GC and Major GC?

 What is the purpose of the System.gc() method?

File Handling and I/O

 What is the difference between FileInputStream and FileReader?


 What is serialization?

 What is the transient keyword?

 What is externalization?

 What is the difference between Reader/Writer and InputStream/OutputStream?

 What is BufferedReader?

 What is the difference between getPath() and getAbsolutePath()?

 What is NIO?

 What are channels and buffers?

 What is memory-mapped file I/O?

 What is the difference between FileInputStream and BufferedInputStream?

 What is the purpose of the RandomAccessFile class?

 What is the difference between File and Path in Java NIO?

Advanced Concepts

 What is reflection in Java?

 What are annotations?

 What is marker interface?

 What is the difference between abstract class and interface?

 What is composition?

 What is aggregation?

 What is the difference between association, aggregation, and composition?

 What is the singleton pattern?


 What is the factory pattern?

 What is dependency injection?

 What is the difference


between ClassNotFoundException and NoClassDefFoundError?

 What is the difference between ClassLoader and Class?

 What is the purpose of the Proxy class in Java?

Java EE Basics

 What is JDBC?

 What is the difference between Statement and PreparedStatement?

 What is connection pooling?

 What is a servlet?

 What is JSP?

 What is the difference between forward and redirect?

 What is the MVC pattern?

 What are Java Beans?

 What is the difference between GET and POST methods?

 What are cookies and sessions?

 What is the difference between HttpServlet and GenericServlet?

 What is the purpose of the Filter in Java EE?

 What is the difference between JSP and JSF?


Best Practices and Design

 What are SOLID principles?

 What is clean code?

 What is the difference between shallow copy and deep copy?

 What is immutable class?

 How to create an immutable class?

 What is the difference between strategy and factory pattern?

 What is the observer pattern?

 What is the decorator pattern?

 What are design patterns?

 What is the difference between composition and inheritance?

 What is the difference between Builder and Factory pattern?

 What is the purpose of the Adapter pattern?

 What is the difference between Facade and Proxy pattern?

Interview Questions for MindTreeLTTI


Operating System Interview Questions

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.

What is an Operating System?

An Operating System (OS) is system software that manages computer hardware,


software resources, and provides common services for computer programs. It acts as
an intermediary between users and the computer hardware.
Why Operating System is Important from a Placements Perspective

Having a strong understanding of Operating System concepts is crucial for technical


interviews, particularly for roles related to system-level programming, software
engineering, and IT infrastructure. Here's why it should be a priority for you:

 Core Knowledge: Operating systems are fundamental to understanding how


computer systems function, and many technical interviews test your knowledge
of OS concepts.

 Real-World Relevance: OS knowledge is crucial in handling memory,


processes, and scheduling in real-world applications and server environments.

 Performance Tuning: An understanding of OS concepts helps in optimizing


system performance, especially for backend or embedded systems roles.

 Problem-Solving Skills: OS interview questions often involve problem-


solving in areas like resource allocation, synchronization, and deadlock
handling, showcasing your analytical skills.

 Industry Demand: Professionals who are proficient in OS concepts, especially


in areas like system design and multi-threading, are in high demand across
various industries, including tech, embedded systems, and telecommunications.

1. Basic Concepts

 What is an operating system?

 What are the main functions of an operating system?

 Explain the difference between monolithic and microkernel architectures.

 What is a kernel?

 What is the difference between user mode and kernel mode?

 What is IPC? What are the different IPC mechanisms?

 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 is a Pipe and when is it used?

 What are the different kinds of operations that are possible on semaphore?

 What is a bootstrap program in OS?

 Explain demand paging.

 What do you mean by RTOS?

 What do you mean by process synchronization?

 Why is the operating system important?

 What is the difference between main memory and secondary memory?

 What do you mean by overlays in OS?

 Write top 10 examples of OS.

 What is multitasking?

 What is caching?

 What is spooling?

 What is the functionality of an Assembler?

 What are interrupts?

 What is preemptive multitasking?

 What is a zombie process?

 What are orphan processes?


 What is starvation and aging in OS?

 What is a dispatcher?

 Define the term dispatch latency.

 What are the goals of CPU scheduling?

 What is a critical section?

 Write the name of synchronization techniques.

 What is Peterson’s approach?

 Define the term Bounded waiting.

 What are the solutions to the critical section problem?

 What is a Banker’s algorithm?

 What is concurrency?

 Write a drawback of concurrency.

 What are the necessary conditions which can lead to a deadlock in a system?

 What are the issues related to concurrency?

 Why do we use precedence graphs?

 Explain the resource allocation graph.

 What is a deadlock?

 What is the goal and functionality of memory management?

 Write the difference between physical address and logical address.

 Explain address binding.

 Write different types of address binding.

 Write an advantage of dynamic allocation algorithms.


 Define Compaction.

 Write about the advantages and disadvantages of a hashed-page table.

 Write the difference between paging and segmentation.

 Write a definition of Associative Memory and Cache Memory.

 What is “Locality of reference”?

 Write down the advantages of virtual memory.

 How to calculate performance in virtual memory?

 Write down the basic concept of the file system.

 Write the names of different operations on a file.

 Define the term Bit-Vector.

 What is a File allocation table?

 What is rotational latency?

 What is seek time?

 What is Belady’s Anomaly?

 What happens if a non-recursive mutex is locked more than once?

 What are the advantages of a multiprocessor system?

 What are real-time systems?

 How to recover from a deadlock?

 What factors determine whether a detection algorithm must be utilized in a


deadlock avoidance system?

2. Process Management

 What is a process?
 What is a process and process table?

 What are the different states of a process?

 Explain the states of a process (e.g., new, ready, running, waiting, terminated).

 What is a Process Control Block (PCB)?

 What is context switching?

 What is the difference between a process and a thread?

 What is a Thread?

 What are the differences between process and thread?

 What are the benefits of multithreaded programming?

 What is multithreading?

 Explain the concept of process scheduling.

 What are the different types of schedulers (long-term, short-term, medium-


term)?

 What is the difference between preemptive and non-preemptive scheduling?

 Explain common scheduling algorithms (FCFS, SJF, Round Robin, Priority


Scheduling).

 What is FCFS?

 What is the RR scheduling algorithm?

 What is Reentrancy?

 What is a Scheduling Algorithm? Name different types of scheduling


algorithms.

 What is cascading termination?

3## 3. Memory Management


 What is memory management?

 Explain the concept of paging.

 What is segmentation?

 What is virtual memory?

 Explain the difference between internal and external fragmentation.

 What is a page fault?

 What is a page replacement algorithm? Explain FIFO, LRU, and Optimal


algorithms.

 What is thrashing?

 What is fragmentation?

 What is the basic function of paging?

 How does swapping result in better memory management?

 What is the best page size when designing an operating system?

4. File Systems

 What is a file system?

 Explain the difference between FAT, NTFS, and ext4 file systems.

 What is a directory structure?

 Explain the concept of inodes in Unix-based systems.

 What is RAID? Explain different RAID levels.

 What is a journaling file system? How does it improve reliability?

 What is the difference between hard links and symbolic links?

 What is file fragmentation, and how does it affect performance?


 What is a file descriptor? How is it used in file operations?

 What is the purpose of the open(), read(), write(), and close() system calls?

 What is a mount point in a file system?

 What is the difference between a block device and a character device?

 What is the purpose of the fsck utility in Unix-based systems?

 What is a distributed file system? Give examples.

 What is the role of the File Allocation Table (FAT) in the FAT file system?

 What is the difference between a file system and a database 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 are the strategies for handling deadlocks (prevention, avoidance,


detection, and recovery)?

 Explain the Banker's Algorithm for deadlock avoidance.

 What is a resource allocation graph? How is it used to detect deadlocks?

 What is the difference between deadlock prevention and deadlock avoidance?

 What is the Ostrich Algorithm in deadlock handling?

 What is livelock, and how is it different from deadlock?

 What is the difference between deadlock and starvation?

 How can timeouts be used to handle deadlocks?

 What is the role of the wait-die and wound-wait schemes in deadlock


prevention?
 What is a safe state in the context of deadlock avoidance?

 What is the difference between a single-instance and multi-instance resource


system in deadlock handling?

6. Inter-Process Communication (IPC)

 What is IPC?

 Explain different IPC mechanisms (pipes, message queues, shared memory,


sockets).

 What is a semaphore?

 Explain the difference between a mutex and a semaphore.

 What is a race condition?

 What are the advantages of semaphores?

 What are the drawbacks of semaphores?

 What is a named pipe (FIFO)? How is it different from an unnamed pipe?

 What is the difference between synchronous and asynchronous IPC?

 What is a message queue, and how does it work?

 What is shared memory, and how is it implemented?

 What is the difference between blocking and non-blocking IPC?

 What is a condition variable, and how is it used in IPC?

 What is the producer-consumer problem, and how can IPC mechanisms solve
it?

 What is the difference between direct and indirect communication in IPC?

 What is the role of signals in IPC?

 What is a socket, and how is it used for network communication?


7. Storage Management

 What is disk scheduling?

 Explain common disk scheduling algorithms (FCFS, SSTF, SCAN, C-SCAN,


LOOK, C-LOOK).

 What is the difference between sequential and random access?

 Explain the concept of disk partitioning.

 What is the purpose of the Master Boot Record (MBR)?

 What is the difference between primary and extended partitions?

 What is the role of the disk controller in storage management?

 What is the difference between logical and physical formatting of a disk?

 What is the purpose of bad block management in storage systems?

 What is the difference between RAID 0, RAID 1, RAID 5, and RAID 10?

 What is the purpose of caching in storage systems?

 What is the difference between hot-swappable and non-hot-swappable storage


devices?

 What is the role of the swap space in memory management?

 What is the difference between a solid-state drive (SSD) and a hard disk drive
(HDD)?

8. Security and Protection

 What is the difference between authentication and authorization?

 Explain the concept of access control lists (ACLs).

 What is a buffer overflow?

 What is a rootkit?
 Explain the principle of least privilege.

 What is the difference between symmetric and asymmetric encryption?

 What is a firewall, and how does it enhance system security?

 What is the role of a security kernel in an operating system?

 What is the difference between a virus, worm, and Trojan horse?

 What is the purpose of a sandbox in system security?

 What is the difference between discretionary access control (DAC) and


mandatory access control (MAC)?

 What is the role of a security token in authentication?

 What is the difference between intrusion detection and intrusion prevention


systems?

 What is the purpose of encryption in file systems?

 What is the difference between a vulnerability and an exploit?

9. Advanced Topics

 What is a real-time operating system (RTOS)?

 Explain the concept of virtualization.

 What is a hypervisor?

 What is containerization? How is it different from virtualization?

 Explain the concept of distributed operating systems.

 What are different types of Kernel?

 What do you mean by Semaphore in OS? Why is it used?

 What is Kernel and write its main functions?

 Write the difference between microkernel and monolithic kernel.


 What is SMP (Symmetric Multiprocessing)?

 What is a time-sharing system?

 What is the difference between Kernel and OS?

 What are various sections of the process?

 What is Cycle Stealing?

 What are a Trap and Trapdoor?

 Write the difference between program and process.

 Write the difference between a user-level thread and a kernel-level thread.

 Write down the advantages of multithreading.

 Difference between Multithreading and Multitasking.

10. Practical Scenarios

 How would you troubleshoot a system that is running slowly?

 What steps would you take to recover from a system crash?

 How would you handle a memory leak in a process?

 Explain how you would debug a deadlock situation.

11. OS-Specific Questions

 Explain the architecture of Linux.

 What is the Windows Registry?

 How does macOS handle memory management differently from Windows?

 What is the role of the init process in Unix-based systems?

 Write about monolithic kernel.


12. Coding and Implementation

 Write a program to demonstrate the producer-consumer problem.

 Implement a simple shell in C.

 Write a program to simulate the Round Robin scheduling algorithm.

 Implement a basic file system in Python.

Object-Oriented Programming (OOP) Interview Questions

Object-Oriented Programming (OOP) is a programming paradigm that organizes


software design around objects rather than functions and logic. It is based on the
concept of "objects," which can contain data in the form of fields (also known as
attributes or properties) and code in the form of procedures (also known as methods).
OOP aims to increase code reusability, scalability, and maintainability.

Key Features of OOP

 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.

 Abstraction : Hides complex implementation details and only exposes the


necessary functionalities. It helps simplify code and reduce complexity.

 Inheritance : Allows a class to inherit properties and behaviors from another


class, promoting code reuse and hierarchical relationships.

 Polymorphism : Enables a single function, method, or operator to take on


multiple forms. It allows different classes to be treated as instances of the same
class through a common interface.

Why is OOP Important?

 Code Reusability: Inheritance allows the reuse of existing code, reducing


redundancy.

 Maintainability: Encapsulation ensures better organization and easier


maintenance of the codebase.
 Scalability: OOP facilitates modular design, making it easier to add new
features.

 Data Security: Access specifiers (public, private, protected) help in securing


data.

Real-World Examples of OOP

 Banking System: Different types of accounts (savings, current) can inherit


common features from a base account class.

 E-commerce Applications: Products, users, and orders can be represented as


objects with their attributes and behaviors.

 Gaming: Characters in a game can be created using OOP principles, where


each character has its own attributes and actions.

1. Basic OOP Concepts

 What is the need for OOPs?

 What are some major Object Oriented Programming languages?

 What are some other programming paradigms other than OOPs?

 What is meant by Structured Programming?

 What are the main features of OOPs?

 What are some advantages of using OOPs?

 Why is OOPs so popular?

 What is meant by the term OOPs?

 What are the four main principles of OOP?

 Explain the difference between a class and an object.

 What is encapsulation? Provide an example.

 What is abstraction? How is it different from encapsulation?


 What is polymorphism? Explain with an example.

 What is inheritance? How does it promote code reusability?

 What are access specifiers in OOP?

 What do you understand by OOP?

 Name any seven widely used OOP languages.

 What is the purpose of using OOPs concepts?

 What are the four main features of OOPs?

 What are the advantages and disadvantages of OOP?

 What are the limitations of OOPs?

 What are the differences between object-oriented programming and structural


programming?

 What do you understand by pure object-oriented language? Why is Java not a


pure object-oriented programming language?

2. Classes and Objects

 What is a class?

 What is an object?

 How do you define a class in [Your Preferred Language]?

 How do you create an object from a class?

 What is the difference between a constructor and a method?

 What is a destructor? When is it called?

 Can a constructor be private? Why or why not?

 How much memory does a class occupy?

 Is it always necessary to create objects from class?


 What do you understand by class and object? Also, give an example.

 What are the differences between class and object?

 What are the key differences between class and structure?

3. Encapsulation

 What is encapsulation?

 How does encapsulation improve code maintainability?

 What are getters and setters?

 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?

 How do abstract classes differ from interfaces?

 Can we create an instance of an abstract class?

 What happens if a subclass does not implement all abstract methods of a parent
class?

 How is abstraction implemented in different programming languages?

 How is data abstraction accomplished?

 What is an abstract class?

 How is an abstract class different from an interface?

 What are the characteristics of an abstract class?

5. Inheritance

 What is meant by Inheritance?


 What is the difference between single and multiple inheritance?

 What are the various types of inheritance?

 What is a subclass?

 Define a superclass?

 What is an interface?

 How does method overriding work in inheritance?

 What is the role of the 'super' keyword in inheritance?

 Can constructors be inherited?

 How does the 'final' keyword affect inheritance?

 Are there any limitations of Inheritance?

 Explain Inheritance with an example?

 Is it possible for a class to inherit the constructor of its base class?

 What are the limitations of inheritance?

 What is the difference between Inheritance and Polymorphism?

6. Polymorphism

 What is Polymorphism?

 What is the difference between method overloading and method overriding?

 What is meant by static polymorphism?

 What is meant by dynamic polymorphism?

 Can we override a static method? Why or why not?

 What is dynamic method dispatch?

 What is operator overloading?


 How does C++ support Polymorphism?

 What is Compile time Polymorphism and how is it different from Runtime


Polymorphism?

 Explain overloading and overriding with examples.

 Give a real-world example of polymorphism.

7. Advanced OOP Concepts

 What are access specifiers and what is their significance?

 What is a static method? How is it different from an instance method?

 What is a singleton class? How do you implement it?

 What are design patterns in OOP?

 What is dependency injection?

 What is the difference between composition and aggregation?

 How do mixins work in OOP?

 What is composition?

 What is the difference between Composition and Inheritance?

 What is constructor chaining?

 What is Coupling in OOP, and why is it helpful?

 Name the operators that cannot be overloaded.

 What is the difference between new and override?

 What is Cohesion in OOP?

 What is the difference between a base class and a superclass?


8. Exception Handling in OOP

 What is an exception?

 What is meant by exception handling?

 How do you handle exceptions in OOP?

 What is the difference between checked and unchecked exceptions?

 Can a constructor throw an exception?

 What is the 'finally' block used for?

 What are the differences between error and exception?

9. OOP in Practice

 How does OOP compare to procedural programming?

 What are the advantages of using OOP in software development?

 Can you give an example of an OOP-based real-world application?

 What are some common pitfalls when using OOP?

 How does OOP support code scalability and maintainability?

 Can we run a Java application without implementing the OOPs concept?

 Identify which OOPs concept should be used in the following scenario: A


group of 5 friends, one boy never gives any contribution when the group goes
for the outing. Suddenly a beautiful girl joins the same group. The boy who
never contributes is now spending a lot of money for the group.

10. Miscellaneous OOP Questions

 What is the difference between shallow copy and deep copy?

 How does garbage collection work in OOP languages?

 What is meant by Garbage Collection in OOPs world?


 What is method chaining?

 What is the difference between mutable and immutable objects?

 What is reflection in OOP?

 Are class and structure the same? If not, what's the difference between a class
and a structure?

 What are the various types of constructors in C++?

 What is a copy constructor?

 What is a destructor?

 What are the manipulators in OOP, and how do they work?

 What are the rules for creating a constructor?

 What are the differences between the constructor and the method in Java?

 What are the types of variables in OOP?

 Is it possible to overload a constructor?

 Can we overload the main() method in Java? Also, give an example.

Dear Students

1. Explain HTTP and HTTPS protocol in the context of computer networks.

2. Differentiate between Multiprogramming vs Multitasking.

3. What do you understand about Object Oriented Programming? Explain the major features of
object oriented programming.

4. What are the advantages of Object Oriented Programming?

5. Differentiate between interface and abstract class in the context of Java.


6. Does Java allow a class to inherit from multiple classes? If not, how can a class achieve the
properties of more than one class (i.e., multiple inheritance)?

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?

11. What are the different types of SQL commands?

12. Differentiate between Delete and Truncate SQL commands.

14. Explain the Open Systems Interconnection (OSI) model in the context of computer networks.

15. Differentiate between WHERE clause and HAVING clause in SQL.

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.

17. What do you understand by subnetting in the context of computer networks?

18. What are the advantages and disadvantages of subnetting?

19. Differentiate between preemptive and non-preemptive scheduling algorithms.

20. Differentiate between SQL and NoSQL databases.

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.

You might also like