OPEN TEXT
JAVA
What is multithreading and exception handling in java .
What is JDK , JRE , JVM .
What is try , catch , throws , finally .
How garbage collection work in java.
Difference between python and java .
What is Comparator.
Explanation of each word in “ public static void main String[]args”
What is “[Link].*” .
OOPS
Four Pillars and explanation of it with code .
Practical application of oops and its 4 pillars .
What is access Modifiers .
What is Overloading and Overriding with example .
What is static and final keyword.
Difference between class and Object.
What is constructor and types of it.
What is super and this keyword.
DBMS
Different types of DBMS
What is RDBMS.
What is Normalisation.
What is primary and foreign key.
What is Joins in sql and explain all types of joins .
What is queries.
What are Acid Properties .
COMPUTER NETWORKING
OSI models and its layers
Difference between OSI and TCP model.
What is IP address and VPN .
Difference between TCP and UDP.
What is subnetting .
What is DNS .
Difference between HTTP and HTTPs.
What is router , hub , switch .
What is firewall and socket.
Operating System
Difference between thread and Process.
What is os ?
What is kernel and System call.
What is Deadlock .
What is Paging and Thrashing and Demand Paging .
1. What is multithreading and exception handling in java ?
- A thread in Java is the smallest unit of execution within a process and Multithreading is a process of executing
multiple threads simultaneously to achieve parallelism and better CPU utilization.
Exception handling in Java is a mechanism to handle runtime errors, ensuring normal program execution . It
can be handeled by try , catch , finally , throws , throw.
2. What is JDK , JRE , JVM ?
- JDK(java development kit) is a complete development environment contains JRE and Compiler(javac).
JRE(java Runtime Environment) provide environment to run Java program, includes JVM and runtime libararies.
JVM(java Virtual machine) Converts Java bytecode into machine code for execution.
3. What is try , catch , throws , finally .
4. How garbage collection work in java?
- Garbage Collection (GC) in Java automatically removes unused objects from memory to free up space .JVM
Garbage Collector (GC) identifies and removes these objects.
5. Difference between python and java .
Python is an interpreted language and slower whereas java compiled to byte code and both has garbage
collector.
6. What is Comparator ?
A Comparator in Java is an interface used to define custom sorting logic for objects. is used to compare two
objects of the same class, usually for sorting purposes.
7. Explanation of each word in “ public static void main String[]args”
Public means the method is accessible from anywhere in the program or even from other programs (i.e., it is
not restricted). This allows the JVM to access the main method to start the program.
Static indicates that the method belongs to the class itself rather than to instances of the class. This allows main
method to be called without creating an object of the class. The JVM calls it directly when the program starts.
Void is a return type and we can writ.e int also but jvm will not recognize it and will not start the program.
main is the name of the method.
String[] args is type of array of Strings .
8. What is “[Link].*”
“[Link].*” is used to import classes and interfaces from the [Link] package, which is part of the
Java Standard Library.
1. Four Pillars of oops and explanation of it with code .
Encapsulation is the concept of bundling data (variables) and methods that operate on the data into a single unit (class). It
also restricts direct access to some of an object's components and can prevent unintended modifications .
Abstraction involves hiding the implementation details and exposing only the relevant features to the user. This helps in
reducing complexity. It can be achieved through abstract classes or interfaces.
Inheritance allows one class (subclass or child class) to inherit the properties and behaviors (methods) of another class
(superclass or parent class). This promotes reusability and extensibility.
Polymorphism allows a single action or method to behave in different ways based on the object calling it. It can be achieved
through method overriding (runtime polymorphism) or method overloading (compile-time polymorphism).
Method overriding Method Overolading
2. Practical application of oops and its 4 pillars .
• Let's consider a Banking System that utilizes all four pillars of Object-Oriented Programming (OOP):
Encapsulation: Hiding account details and providing controlled access via getter and setter methods.
Abstraction: Exposing only essential operations like deposit and withdrawal without revealing internal complexities.
Inheritance: Creating specialized bank accounts (Savings, Current) from a generic Account class.
Polymorphism: Allowing different behaviors for the calculateInterest() method in different account types.
3. What is access Modifiers .
Access Modifiers in Java control the visibility and accessibility of classes, methods, and variables. They help in data hiding,
encapsulation, and security.
PUBLIC - Accessible from anywhere in the program and Used when the method/class should be available to all.
PRIVATE - Accessible only within the same class and Used to hide sensitive data (Encapsulation).
PROTECTED - Accessible within the same package and subclasses (even in different packages) AND USED FOR INHERITENCE.
DEFAULT - Accessible only within the same package.
4. What is Overloading and Overriding
Method overloading(compile time)- Same method name, different parameters (different number, type, or sequence of
parameters) , Happens within the same class , Return type can be the same or different , The compiler determines which
method to call at compile-time (Static Binding).
Method Overriding (runtime ) - same method name, same parameters, different implementation , Happens in different
classes (between a parent and child class), Return type must be the same or a subclass of the parent method's return type
5. What is static and final keyword.
static keyword is used for class-level variables and methods that belong to the class rather than to any specific instance.
static is Shared among all objects of the class.
final keyword in Java is used to restrict modifications to variables, methods, and classes. It ensures that once something is
declared as final , it cannot be changed, overridden, or inherited, depending on how it is used.
6. Difference between class and Object.
A class is a blueprint or template for creating objects and it Does not occupy memory until an object is created .
A object is an instance of a class and It occupies memory and can perform actions defined in the class.
7. What is constructor and types of it.
A special method that is called automatically when an object is created. It Has the same name as the class and no return
type.
- Default Constructor (No Parameters) - Created automatically if no constructor is defined
- Parameterized Constructor - Accepts arguments to initialize values during object creation.
- Copy Constructor - Creates a new object by copying values from another object.
8. What is super and this keyword.
this keyword(Refers to the Current Class) refers to the current object And Can call another constructor in the same class.
super keyword (Refers to the Parent Class) -Used to access parent class variables and methods
1. Different types of DBMS .
Hierarchical DBMS - Data is organized like a tree (parent-child relationship).
Network DBMS - Similar to hierarchical DBMS, but a child can have multiple parents (many-to-many relationships).
Relational DBMS (RDBMS) - Stores data in tables (rows & columns) with relationships.
Object-Oriented DBMS - Stores data as objects
2. What is RDBMS ?
Stores data in tables (rows & columns) with relationships , Uses SQL (Structured Query Language) to manage data.
Examples: MySQL, PostgreSQL, Oracle, Microsoft SQL Server
3. What is Normalisation ?
Normalization is a process in database design used to organize data efficiently by removing redundancy and avoiding data
anomalies. It divides a database into smaller, related tables while maintaining relationships between them.
First Normal Form (1NF): Eliminate repeating groups, ensuring each column contains atomic values.
Second Normal Form (2NF): Ensure the table is in 1NF and remove partial dependencies (i.e., non-prime attributes depend
on the entire primary key).
Third Normal Form (3NF): Ensure the table is in 2NF and remove transitive dependencies (i.e., non-prime attributes
depend on other non-prime attributes).
Boyce-Codd Normal Form (BCNF): A stricter version of 3NF, ensuring every determinant is a candidate key.
Fourth Normal Form (4NF): Eliminate multi-valued dependencies.
Fifth Normal Form (5NF): Ensure the table is decomposed to eliminate redundancy while maintaining lossless joins.
4. What is primary and foreign key.
A primary key is a unique identifier for each record in a database table. It ensures that no two rows in the table have the
same value for the primary key column(s).
A foreign key is a column or set of columns in a table that establishes a link between data in two tables. It refers to the
primary key in another table.
5. What is Joins in sql and explain all types of joins .
Joins in SQL are used to combine rows from two or more tables based on a related column between them. Joins help in
retrieving data that is distributed across multiple tables, and they are crucial in relational database systems
INNER JOIN
• Returns records that have matching values in both tables.
• If there is no match, the row is not included in the result.
Ex - SELECT * FROM Table1
INNER JOIN Table2 ON [Link] = [Link];
LEFT OUTER JOIN
Returns all records from the left table (Table1), and the matched records from the right table (Table2).
Ex - SELECT * FROM Table1
LEFT JOIN Table2 ON [Link] = [Link];
RIGHT OUTER JOIN
Returns all records from the right table (Table2), and the matched records from the left table (Table1).
Ex - SELECT * FROM Table1
RIGHT JOIN Table2 ON [Link] = [Link];
FULL JOIN
Returns all records when there is a match in either the left or right table
Ex - SELECT * FROM Table1
FULL JOIN Table2 ON [Link] = [Link];
CROSS JOIN:
This means it will combine every row from the first table with every row from the second table.
Ex- SELECT * FROM Table1
CROSS JOIN Table2;
SELF JOIN
A self join is a join where a table is joined with itself
Ex- SELECT A.*, B.*
FROM Table A
INNER JOIN Table B ON [Link] = B.parent_id;
6. What is queries?
A query in SQL (Structured Query Language) is a request for information or an action to be performed on a database. It
allows users to interact with the database, retrieve, modify, and manage data.
6. What are Acid Properties?
ACID properties are a set of properties that ensure reliable processing of database transactions. The acronym ACID stands
for: Atomicity , Consistency , Isolation , Durability .
1. OSI models and its layers
The OSI (Open Systems Interconnection) model is a conceptual framework used to understand and standardize the
communication process in computer networks. It divides network communication into seven layers, each performing specific
functions.
Physical Layer , Data Link Layer , Network Layer , Transport Layer , Session Layer , Presentation Layer , Application Layer
2. Difference between OSI and TCP model.
OSI Model: A theoretical model for understanding and designing network protocols, and it is more focused on defining
network interactions in a general, abstract way and it has 7 layers .
TCP/IP Model: A practical, real-world model that was specifically developed for the internet. It defines how the internet
protocol suite (TCP/IP) works and is used for actual network communication. And it has 4 layers
3. What is IP address and VPN .
An IP address (Internet Protocol Address) is a unique numerical identifier assigned to every device connected to a
computer network .
A VPN (Virtual Private Network) is a service that creates a secure, encrypted connection over a less secure network, such
as the internet. It allows users to send and receive data across shared or public networks as if their devices were directly
connected to a private network.
4. Difference between TCP and UDP.
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are both transport layer protocols used for
communication over IP networks, but they differ in terms of reliability, speed, and how they handle data transmission.
TCP: Connection-oriented protocol. A connection is established between the sender and receiver before data transmission
begins. This ensures that both parties are ready to exchange data.
UDP: Connectionless protocol. There is no need to establish a connection between sender and receiver before data is sent.
Each packet is sent independently.
5. What is subnetting .
Subnetting is the process of dividing a larger network (referred to as a network block) into smaller, more manageable sub-
networks or subnets. This is done by borrowing bits from the host portion of an IP address to create additional network bits,
thus increasing the number of available networks while reducing the number of hosts in each network
6. What is DNS ?
DNS (Domain Name System) is a hierarchical and decentralized naming system used to translate human-readable domain
names (like [Link]) into machine-readable IP addresses (like [Link]) .
7. Difference between HTTP and HTTPs.
Http is faster .
8. What is router , hub , switch .
A router is a networking device that forwards data packets between different networks, such as from a local network to the
internet. It determines the best path for sending data across networks.
A hub is a basic networking device used to connect multiple devices in a network, usually within a single LAN. It broadcasts
incoming data packets to all devices connected to it.
A switch is a more advanced networking device than a hub, used to connect multiple devices within a LAN. It operates by
forwarding data only to the specific device (or devices) that need it, based on the device's MAC address.
9. What is firewall and socket.
A firewall is a security system designed to monitor and control incoming and outgoing network traffic based on
predetermined security rules. It acts as a barrier between a trusted internal network and untrusted external networks, like the
internet, to prevent unauthorized access and attacks.
A socket is a software endpoint that allows communication between two systems over a network. It is the interface through
which applications can send and receive data over a network, typically using the TCP/IP protocol.
1. Difference between thread and Process
A process is an independent, self-contained unit of execution that has its own memory space and resources.
A thread is the smallest unit of execution within a process. A process can contain multiple threads, which share the same
memory space and resources.
2. What is operating System ?
An Operating System (OS) is system software that manages computer hardware, software resources, and provides various
services for computer programs. It acts as an intermediary between the user and the computer hardware, allowing users and
applications to interact with the hardware in a simplified and abstracted way.
3. What is kernel and System call ?
The kernel is the core component of an operating system that manages system resources, including the CPU, memory, and
hardware devices. It acts as a bridge between the hardware and the software applications running on the system.
A system call is an interface between user-level applications and the kernel. When a program needs to perform an operation
that requires higher privileges (e.g., accessing hardware or managing resources), it makes a system call to request the kernel
to perform the operation on its behalf.
4. What is deadlock ?
A deadlock is a situation where a group of processes are unable to proceed because each is waiting for resources held by
another process in the group. Essentially, it's a state where processes are stuck in a circular wait, and none of them can make
progress.
Condition for Deadlock - Mutual Exclusion , Hold & Wait , No Preemption , Circular Wait
5. What is Paging and Thrashing and Demand Paging ?
Paging is a memory management scheme that eliminates the need for contiguous allocation of physical memory. It divides
the physical memory into fixed-size blocks called frames, and the logical memory (process memory) into blocks of the same
size, called pages.
Thrashing occurs when the operating system spends the majority of its time swapping data between RAM and disk (virtual
memory), instead of executing processes. This happens when a system doesn't have enough physical memory (RAM) to
handle the active processes, leading to excessive paging (also called page faults).
Demand Paging is a type of paging where pages are loaded into memory only when they are needed (on demand), rather
than loading the entire process into memory at once. It is an efficient way to use memory in systems with limited RAM.