0% found this document useful (0 votes)
2 views8 pages

Java Basics Interview Questions for Freshers

The document contains a comprehensive list of basic questions and answers related to Java, computer networks, operating systems, Python, and machine learning, aimed at freshers preparing for interviews. It covers fundamental concepts such as data types, object-oriented programming, network types, OSI model, and data preprocessing techniques. Each section provides clear explanations and examples to help candidates understand key topics in these fields.

Uploaded by

Rhythm Rana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

Java Basics Interview Questions for Freshers

The document contains a comprehensive list of basic questions and answers related to Java, computer networks, operating systems, Python, and machine learning, aimed at freshers preparing for interviews. It covers fundamental concepts such as data types, object-oriented programming, network types, OSI model, and data preprocessing techniques. Each section provides clear explanations and examples to help candidates understand key topics in these fields.

Uploaded by

Rhythm Rana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Java Basic Questions for Freshers

1) What is the difference between java and c++?


2) Why there is the no use of the pointers in java?
 Java is platform independent. So if we use pointers the address of the variable varies in
different machines. Thus, using pointers becomes invalid and provides different result in
different machine.
3) Why c++ is fully created about the pointers why java not?
 Pointers use static memory location, but java is following dynamic memory location. And for
security purpose and java is a fully object-oriented language
4) How java works?
 Source code ----compiler--- byte code ----interprator----- machine code
5) What is primitive and non-primitive datatypes in java?
6) How to create a object of a class in java?
7) Explain public static void main ( String [] args )?
 Public is the access modifier which means this can be accessible from anywhere, static is a
keyword which used for the memory management and void show that method don’t return
anything and main is where the program will start. String[] args is an array that stores
command-line arguments, allowing users to input data when they run the program.
8) Tell the different types of the operation in java?
9) What is a string and what are the methods that string has in java?
10) What is a class and what is the objects?
 In Java, a class is a blueprint for creating objects. It defines the characteristics and behaviours
that objects of that class will have. An object, is an instance of a class. It is a real-world entity
that embodies the characteristics and behaviours defined by the class.
11) Explain jvm, jdk, jre?
 The JVM is a part of the Java Runtime Environment (JRE) and is responsible for executing Java
bytecode.
 The JRE provides the necessary libraries, Java Virtual Machine (JVM), and other components
to run Java applications.
 The JDK is a full-featured software development kit for Java developers. It includes everything
the JRE, plus tools and utilities for developing Java applications.
12) What are access modifiers?
13) What is the final, finalize, finally keywords do?
The 'final' keyword is used to create constants or non-modifiable elements, 'finally' is used in
exception handling to execute code regardless of an exception being thrown, and 'finalize' is a special
method called by the garbage collector before an object is reclaimed.
14) What is a constructor and their types in java?
 In Java, a constructor is a special method that is automatically called when an object of a
class is created. It is used to initialize the newly created object. Constructors have the same
name as the class.
 Default constructor: A constructor with no parameters. If no constructor is defined in a class,
the Java compiler provides a default constructor that initializes instance variables to their
default values.
 Parameterised constructor: A constructor that takes parameters to initialize the object's
attributes with specific values. This allows for more flexible object creation.
 Copy constructure: In Java, a copy constructor is a special type of constructor that creates an
object using another object of the same Java class. It returns a duplicate copy of an existing
object of the class.
15) What are the different types of variables in Java?
 There are three types of variables in Java: local variable. instance variable. static variable.
16) What is the use of the super and this keyword in java?
 The primary purpose of the "this" keyword is to refer to the current object, while the "super"
keyword allows access to the members of the parent class
17) What is abstraction how we can achieve abstraction in java with a code example?
18) What is the encapsulation in java how it can be achieve in java with a code example?

class Student {
// Private fields
private String name;
private int age;

// Getter for name


public String getName() {
return name;
}

// Setter for name


public void setName(String name) {
[Link] = name;
}

// Getter for age


public int getAge() {
return age;
}

// Setter for age


public void setAge(int age) {
if (age > 0) { // Simple validation
[Link] = age;
} else {
[Link]("Age should be positive.");
}
}
}

public class Main {


public static void main(String[] args) {
// Create a Student object
Student student = new Student();

// Set values using setters


[Link]("Alice");
[Link](20);

// Access values using getters


[Link]("Student Name: " + [Link]());
[Link]("Student Age: " + [Link]());
}
}

19) What is the polymorphism in java write the code of the polymorphism?
20) What is run time polymorphism and compile time polymorphism?
21) What is dynamic memory dispatch?
22) What is inheritance in java write a code for it?
23) What are the different types of inheritance present in java?
24) Why java does not support the multiple inheritance and what is diamond problem?
25) How we can achieve the inheritance in java?
26) What is the shadowing problem in java?
27) What is the concept of the wrapper class in java?
28) What are threads in java how to implement?
29) What is exception handling?

Computer Network
1) What are the different types of networks? Explain briefly.
2) Example: LAN, WAN, MAN, PAN
3) What is the difference between a switch and a router?
A switch connects multiple devices to create a network, a router connects multiple switches, and their
respective networks, to form an even larger network.
4) What is an IP address, and how is it classified?
An IP address uniquely identifies devices on a network.
IPv4 uses a 32-bit format, while IPv6 uses a 128-bit format.
IPv4 addresses are classified into five classes: A, B, C (used for networks), D (multicasting), and E
(reserved).
IP addresses can be private (used within networks) or public (used on the internet).
5) What is the difference between IPv4 and IPv6?
6) Explain the OSI model and its layers.
Physical layer: It is used to provide the connection between the devices such as NIC, Cables, Switches.
Alse used to deliver the bits.
Data link layer.: It is responsible for local delivery of frames between nodes on the same level of the
network. Also correct the error that occur in the physical layer.
Network layer: The network layer is responsible for receiving frames from the data link layer, and
delivering them to their intended destinations among based on the addresses contained inside the
frame.
Transport layer: manages network traffic between hosts and end systems to ensure complete data
transfers. Transport-layer protocols such as TCP, UDP.
Session layer: The session layer is responsible for creating communication channels between devices,
called sessions.
Presentation layer: The presentation layer of the OSI model is responsible for translating, encrypting,
and compressing data within the model.
Application layer: Function: This layer provides services directly to end users and their applications. It
handles user interfaces, data formatting, and application-related network services like file transfers,
email, and web browsing.
7) What is the function of the transport layer in the OSI model?
8) What is the TCP/IP model? How is it different from the OSI model?
9) What are the differences between TCP and UDP?
10) What is DNS and how does it work?
11) What is a MAC address?
A MAC address (media access control address) is a 12-digit hexadecimal number assigned to each
device connected to the network. It is a physical address of a device whereas the Ip address is the
logical Address.
12) What are the common networking protocols?
13) What is a subnet mask?
14) What is a firewall, and why is it used?
15) Explain the concept of network topology. What are its types?
16) What is DHCP, and how does it work?
17) What are the differences between hub, switch, and router?

18) What is a VPN, and how does it work?


19) What is bandwidth, and why is it important in networking?
OPERATING SYSTEM
What is kernel in os?

What is the lifecycle of a thread?

What are the different types of operating system

What is virtual memory?

What is paging and segmentation?

What is process synchronization?

What are the CPU scheduling algorithms? Fcfs, sdj, ps, round r, shortest remaining time.

What is a deadlock?

Condition to occur the dead lock?

Methods to handle dead locks?

What are the page replacement algorithm? Fifo, opr optimal page algo, lru least recent used.

What is RAID?

What are the disk scheduling algorithms? fcfs, look, scan, c look, c scan.

PYTHON BASIC QUESTION FOR INTERVIEW


What is difference between python and java?

What is the use of pass operation in python?

Why we f in printing the strings? Check ans


What are the different types of ds in python?

What is a list and what are the main operations of list?

What is the use of enumerate?

What is tuple operations on tuple?

What is a set and operations on sets?

What are the mathematical operation in python?

What are dictnory and operation on dict?

What is dict comphrehension?

What is the use of * args and **kwargs? (is used when we have to give n number of parameters in a function, n
number of key values pair just like dictonary)

What is lambda function? (add = lambda a,b : a+b)

What is the use of map function?

What is filter function?

What is exception in python?

MACHINE LEARNING QUESTIONS ON DATA PREPROCESSING


What is data preprocessing?

What is the steps present in data preprocessing?

What is the data cleaning steps involving in data cleaning explain in details?

What is line wise deletion and pair wise deletion?

 In data analysis, "line wise deletion" (also called "listwise deletion" or "complete case
analysis") means removing an entire row of data if it contains even one missing value, while
"pairwise deletion" removes only the data points with missing values when calculating
statistics between specific pairs of variables

What are the different types of imputation methods in data cleaning?

What are the methods to detect the outliers?

What is feature scaling explain why we need feature scaling?

What are the types of feature scaling in ml?

What is the formula used to calculate the standardization and normalization?

When we use the standardization and normalization also tell the types of normalization?

What is encoding and why we need the feature encoding?

What are the types of the categorical encoding?

What is the difference in one hot encoding and label encoding?

What is column transformation why we use column transformation?


What is binning?

Give the basic how to view a dataset give a code of pandas?

What is two types of EDA list how to analyse the different type of data using seaborn and matplotlib?

Explain the missing values removal in details?

What is supervised, unsupervised, semi supervised, refencornment learning?

Explain the supervised ml in details?

Explain the unsupervised ml in details?

Types of errors are present in ml?

What is bias and variance and its trade off?

Ways to reduce the high bias and variance?

What is underfitting and overfitting?

What are the different methods of cross validation in ml?

What are the performance matrix in classification and regression?

What are the different ways to handle the unbalance data in ml?

You might also like