Junior Java Developer
10+ Junior Java Developer Interview Questions and Answers for Freshers

Asked in Daiviksoft Technologies

Q. For a circular cake shared by 8 members, what is the minimum number of cuts required to divide the cake equally?
To cut a circular cake for 8 members equally, only 2 straight cuts are needed.
Make the first cut through the center, dividing the cake into 2 equal halves.
Make the second cut perpendicular to the first, creating 4 equal quarters.
Each quarter can then be further divided into 2 equal pieces, resulting in 8 equal slices.
This method minimizes the number of cuts while ensuring equal distribution.

Asked in ScoreMe Solutions

Q. Why we need Oops concepts? What is Constructor? Need of Constructor? StringBuilder? etc.
OOPs concepts are important for code reusability, maintainability, and scalability. Constructors are special methods used to initialize objects.
OOPs concepts help in creating modular, reusable, and maintainable code.
Inheritance, polymorphism, encapsulation, and abstraction are the four pillars of OOPs.
Constructors are special methods used to initialize objects with default or user-defined values.
StringBuilder is a class used to manipulate strings efficiently.
It is important t...read more

Asked in Sberbank Branch in India

Q. What are the aggregate functions in SQL?
Aggregate functions in SQL are used to perform calculations on a set of values and return a single value.
Common aggregate functions include COUNT, SUM, AVG, MIN, and MAX.
COUNT returns the number of rows that match a specified condition.
SUM calculates the sum of a column's values.
AVG calculates the average of a column's values.
MIN returns the minimum value in a column.
MAX returns the maximum value in a column.
Aggregate functions can be used with the GROUP BY clause to perform ...read more

Asked in Naresh i Technologies

Q. What is responsible for executing Java programs?
Java Virtual Machine (JVM) is responsible for executing Java programs.
JVM is a virtual machine that interprets compiled Java code.
It provides a runtime environment for Java programs to run.
JVM is platform-independent and provides memory management, security, and other features.
Java programs are compiled into bytecode, which is then executed by the JVM.
JVM is responsible for loading classes, verifying bytecode, and executing the program.

Asked in HEPL - A Cavinkare Group Company

Q. How many columns are there in Bootstrap?
There are 12 columns in Bootstrap grid system.
Bootstrap grid system is divided into 12 columns.
Columns can be combined to create different layouts.
Example:
will create a column that spans half of the row.

Asked in Naresh i Technologies

Q. Why was Servlet not removed from Java technology?
Servlets are still relevant for web development in Java
Servlets provide a lightweight and efficient way to handle HTTP requests and responses
They can be used for dynamic web content generation and server-side processing
Servlets are extensible and can be integrated with other Java technologies like JSP and JDBC
Alternative technologies like Spring MVC and RESTful APIs build on top of Servlets
Removing Servlets would break backward compatibility and disrupt existing Java web appl...read more
Junior Java Developer Jobs




Asked in HEPL - A Cavinkare Group Company

Q. Is Java an interpreted or compiled language?
Java is a compiled language that is first compiled into bytecode and then interpreted by the Java Virtual Machine (JVM).
Java is first compiled into bytecode by the Java compiler.
The bytecode is then interpreted by the Java Virtual Machine (JVM) at runtime.
This combination of compilation and interpretation makes Java a compiled language with some interpreted features.
Asked in Aventra Group

Q. What is the working mechanism of a hashmap?
A hashmap stores key-value pairs, using a hash function to compute an index for efficient data retrieval.
Uses a hash function to convert keys into hash codes.
Stores entries in an array, where each index corresponds to a hash code.
Handles collisions using techniques like chaining or open addressing.
Example: For key 'apple', hash function might return index 3, storing value at array[3].
Resizes the array when the load factor exceeds a threshold to maintain performance.
Share interview questions and help millions of jobseekers 🌟
Asked in Aventra Group

Q. What is the working mechanism of Java Streams?
Java Streams provide a functional approach to processing sequences of elements, enabling efficient data manipulation and transformation.
Streams are part of the java.util.stream package and allow for functional-style operations on collections.
They support operations like filter, map, and reduce, enabling concise and readable code.
Example: List<String> names = Arrays.asList('Alice', 'Bob', 'Charlie'); names.stream().filter(name -> name.startsWith('A')).forEach(System.out::print...read more

Asked in Deloitte

Q. What is jdk,jre , thread , collection
jdk is Java Development Kit, jre is Java Runtime Environment, thread is a unit of execution, collection is a group of objects.
JDK is a software development kit used to develop Java applications.
JRE is a runtime environment used to run Java applications.
Thread is a lightweight unit of execution within a process.
Collection is a group of objects that can be manipulated as a single unit.

Asked in TCS

Q. What is a constructor?
A constructor is a special method that is used to initialize objects in Java.
Constructors have the same name as the class they belong to.
They are called automatically when an object is created.
They can take parameters to initialize the object's state.
If a class does not have a constructor, a default constructor is provided.
Constructors can be overloaded to provide multiple ways to initialize an object.

Asked in Full Creative

Q. Write a program demonstrating inheritance.
Inheritance in Java allows a class to inherit properties and methods from another class, promoting code reusability.
Inheritance is a fundamental concept in OOP (Object-Oriented Programming).
It allows a subclass to inherit fields and methods from a superclass.
Example: class Animal { void eat() { } } class Dog extends Animal { void bark() { } }
Java supports single inheritance (one class can inherit from one superclass).
Use 'extends' keyword to establish inheritance.

Asked in Micropro Software Solutions

Q. Write a Spring Boot CRUD example.
Spring Boot CRUD example is a basic implementation of Create, Read, Update and Delete operations using Spring Boot framework.
Create a Spring Boot project with required dependencies
Define entity classes and their relationships
Create repository interfaces extending JpaRepository
Implement service classes with business logic
Create RESTful API endpoints using @RestController
Use HTTP methods to perform CRUD operations
Test the API using tools like Postman

Asked in Dhanush InfoTech

Q. How do you call REST APIs?
To call REST APIs, use HTTP methods like GET, POST, PUT, DELETE with the API endpoint URL.
Use a HTTP client library like Apache HttpClient or OkHttp
Pass any required parameters in the request body or as query parameters
Handle the response returned by the API
Add appropriate headers like Authorization or Content-Type if required

Asked in Bounteous x Accolite

Q. What are the steps to establish a JDBC connection?
JDBC Connection steps
Load the JDBC driver class
Establish a connection to the database using DriverManager.getConnection()
Create a statement object using the connection.createStatement() method
Execute the SQL query using statement.executeQuery() method
Process the ResultSet object returned by the query
Close the connection and statement objects using close() method

Asked in HEPL - A Cavinkare Group Company

Q. Write an SQL update query.
Update query to modify data in a database table
Use UPDATE statement followed by table name
Set the column(s) to be updated using SET keyword
Specify the new values for the column(s) to be updated
Add WHERE clause to specify the condition for updating specific rows
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Junior Java Developer Related Skills

Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary


Reviews
Interviews
Salaries
Users

