Fullstack Java Developer

80+ Fullstack Java Developer Interview Questions and Answers

Updated 22 Nov 2024

Popular Companies

search-icon

Q1. If needed, will you work on the older technology stack?

Ans.

Yes, I am willing to work on older technology stacks if needed.

  • I believe in being adaptable and open to learning new technologies.

  • Working on older technology stacks can provide valuable experience and insights.

  • It is important to understand the context and requirements before making a decision.

  • Examples: Java Servlets, JSP, Struts, Hibernate, etc.

Q2. is it necessary for classes implementing an interface to implement interface methods?

Ans.

Yes, classes implementing an interface must implement interface methods.

  • Classes implementing an interface must provide concrete implementations for all methods declared in the interface.

  • Failure to implement all interface methods will result in a compilation error.

  • Interfaces are used to define a contract that implementing classes must adhere to.

Fullstack Java Developer Interview Questions and Answers for Freshers

illustration image

Q3. How can two components who are not parent-child can communicate with each other?

Ans.

Two components can communicate using a shared service or event bus.

  • Use a shared service to store and retrieve data that both components need.

  • Implement an event bus to allow components to subscribe and publish events.

  • Utilize a state management library like Redux to manage shared state between components.

Q4. What are different annotations in Spring Boot and what are their use cases?

Ans.

Spring Boot annotations are used to simplify the development process by providing metadata to the Spring framework.

  • 1. @RestController - Used to define RESTful web services.

  • 2. @RequestMapping - Maps HTTP requests to handler methods of MVC and REST controllers.

  • 3. @Autowired - Used for automatic dependency injection.

  • 4. @Component - Indicates that a class is a Spring component.

  • 5. @Service - Indicates that a class is a service component.

  • 6. @Repository - Indicates that a class is a...read more

Are these interview questions helpful?

Q5. What are various ways in which two microservices can interact with each other?

Ans.

Two microservices can interact through synchronous communication, asynchronous communication, event-driven architecture, and shared database.

  • Synchronous communication using REST APIs or gRPC

  • Asynchronous communication using message queues like RabbitMQ or Kafka

  • Event-driven architecture using publish-subscribe pattern with message brokers

  • Shared database for direct data exchange between microservices

Q6. Difference between where clause and having clause in SQL ?

Ans.

Where clause filters rows before grouping, having clause filters groups after grouping.

  • Where clause is used to filter rows based on a condition before grouping.

  • Having clause is used to filter groups based on a condition after grouping.

  • Where clause is used with SELECT, UPDATE, DELETE statements.

  • Having clause is used with SELECT statement and GROUP BY clause.

  • Where clause cannot contain aggregate functions.

  • Having clause can contain aggregate functions.

  • Example: SELECT * FROM tabl...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. FizzBuzz - if number is divisible by 3 print "fizz", if by 5 print "buzz", if by both "fizzbuzz"

Ans.

A simple program to print 'fizz' for multiples of 3, 'buzz' for multiples of 5, and 'fizzbuzz' for multiples of both.

  • Iterate through numbers from 1 to n.

  • Use modulo operator to check divisibility by 3 and 5.

  • Print 'fizz', 'buzz', or 'fizzbuzz' accordingly.

Q8. Write the code where you can share the information from receptionist to doctor

Ans.

Use a messaging system to share information from receptionist to doctor

  • Implement a messaging system using a message broker like RabbitMQ or Apache Kafka

  • Create a message queue for receptionist to send messages to the doctor

  • Doctor subscribes to the message queue to receive messages from receptionist

  • Messages can contain patient information, appointment details, etc.

Fullstack Java Developer Jobs

Senior Fullstack Java Developer 4-8 years
Srijan Material Plus
3.5
Gurgaon / Gurugram
Senior Fullstack Java Developer 4-8 years
Srijan Technologies Pvt. Ltd.
3.5
Gurgaon / Gurugram
Senior Fullstack Java Developer 5-8 years
Srijan- A Material Company
3.5
Gurgaon / Gurugram

Q9. Do you have bank statements with you?

Ans.

NO

  • No, I do not have bank statements with me.

  • Bank statements are confidential documents and should not be shared during an interview.

  • If required, I can provide proof of employment or salary through other means.

Q10. What's the name of your collage?

Ans.

I attended XYZ College.

  • Attended XYZ College for my undergraduate degree.

  • Studied computer science and gained a strong foundation in Java programming.

  • Participated in various coding competitions and hackathons organized by the college.

  • Collaborated with fellow students on group projects to develop fullstack Java applications.

Q11. The reason for making a switch?

Ans.

Switch statements are used to execute different code blocks based on different conditions.

  • Switch statements are useful when there are multiple conditions to be checked.

  • They can be used as an alternative to multiple if-else statements.

  • The switch expression must evaluate to a primitive data type or a string.

  • Each case statement must end with a break statement to prevent fall-through.

  • Default case is optional and executes when none of the cases match.

Q12. Write a psudeo sort code logic to sort an array of string of names?

Ans.

Use a sorting algorithm to sort an array of strings representing names.

  • Use a sorting algorithm like bubble sort, selection sort, or merge sort to sort the array of strings.

  • Compare each pair of strings and swap them if they are in the wrong order.

  • Repeat this process until the array is sorted.

  • Example: ['John', 'Alice', 'Bob'] -> ['Alice', 'Bob', 'John']

Q13. What is diffrence between Arraylist and vector ?

Ans.

ArrayList is not synchronized while Vector is synchronized.

  • ArrayList is faster than Vector as it is not synchronized.

  • Vector is thread-safe while ArrayList is not.

  • Vector is a legacy class while ArrayList is not.

  • Vector can grow by a specified amount while ArrayList grows by 50% of its size.

  • Example: ArrayList list = new ArrayList<>(); Vector vector = new Vector<>();

  • Example: list.add(1); vector.add(1);

  • Example: list.get(0); vector.get(0);

Q14. Is java a pure object oriented programming Language ?

Ans.

Java is not a pure object-oriented programming language as it supports primitive data types and static methods.

  • Java supports primitive data types like int, double, boolean, etc. which are not objects.

  • Static methods in Java belong to the class itself and do not require an instance to be called.

  • Java also has features like enums, which are not purely object-oriented.

Q15. How to connect to a database in Spring Boot?

Ans.

To connect to a database in Spring Boot, you need to configure the database properties in the application.properties file and use Spring Data JPA.

  • Configure the database properties in the application.properties file, including the URL, username, and password.

  • Add the necessary dependencies in the pom.xml file for Spring Data JPA and the database driver.

  • Create a repository interface that extends JpaRepository to interact with the database.

  • Use annotations like @Entity, @Table, @I...read more

Q16. What is difference between spring and string buffer?

Ans.

Spring is a framework used for building Java applications, while StringBuffer is a class used for manipulating strings efficiently.

  • Spring is a framework that provides comprehensive infrastructure support for developing Java applications, while StringBuffer is a class in Java that allows for efficient manipulation of strings.

  • Spring provides features like dependency injection, aspect-oriented programming, and more, while StringBuffer is used for concatenating, appending, insert...read more

Q17. How micro services communicate each others

Ans.

Microservices communicate through lightweight protocols like HTTP, messaging queues, and RPC.

  • Microservices can communicate over HTTP using RESTful APIs.

  • Message queues like RabbitMQ or Kafka can be used for asynchronous communication between microservices.

  • Remote Procedure Calls (RPC) can be used for synchronous communication between microservices.

  • Service discovery mechanisms like Eureka or Consul help microservices locate each other.

  • API gateways can be used to manage and secur...read more

Q18. Which languages are used in web development?

Ans.

Languages commonly used in web development include HTML, CSS, and JavaScript.

  • HTML is used for creating the structure of web pages

  • CSS is used for styling the web pages

  • JavaScript is used for adding interactivity to web pages

Q19. what is cookie ? why use to create web application

Ans.

A cookie is a small piece of data stored on the user's computer by the web browser, used to track user activity and personalize user experience.

  • Cookies are used to store user preferences, login information, and shopping cart items.

  • They help websites remember users and their preferences, making the browsing experience more personalized.

  • Cookies can also be used for tracking user behavior, such as analyzing website traffic and targeting advertisements.

  • Cookies can be session-base...read more

Q20. What are the legacy classes in java?

Ans.

Legacy classes in Java are the classes that have been replaced by newer versions but are still supported for backward compatibility.

  • Legacy classes are part of the Java API and are still supported for backward compatibility.

  • They have been replaced by newer versions but are still used in older applications.

  • Examples of legacy classes include Vector, Hashtable, and Enumeration.

  • Legacy classes are not recommended for use in new applications and should be replaced with newer alterna...read more

Q21. write code for REST API using spring boot, include all annotation

Ans.

Code for REST API using Spring Boot with annotations

  • Use @RestController annotation to define the class as a REST controller

  • Use @RequestMapping annotation to map HTTP requests to handler methods

  • Use @GetMapping, @PostMapping, @PutMapping, @DeleteMapping annotations for specific HTTP methods

  • Use @PathVariable annotation to extract values from the URI

  • Use @RequestBody annotation to bind HTTP request body to a method parameter

Q22. Create a table questions in mysql

Ans.

Creating a table named 'questions' in MySQL.

  • Use the CREATE TABLE statement to create the table.

  • Specify the table name, column names, and their data types.

  • Set primary key, foreign key, and other constraints if required.

  • Add any additional properties like auto-increment, default values, etc.

  • Execute the SQL statement to create the table.

Q23. Write a palindrome program in java

Ans.

A palindrome program in Java checks if a given string is the same when read forwards and backwards.

  • Convert the string to lowercase to ignore case sensitivity.

  • Use two pointers, one starting from the beginning and the other from the end of the string.

  • Compare the characters at the two pointers, moving them towards the center until they meet or cross each other.

  • If at any point the characters are not equal, the string is not a palindrome.

  • If the pointers meet or cross each other, t...read more

Q24. What is autoboxing and auto-unboxing ?

Ans.

Autoboxing is the automatic conversion of primitive data types to their corresponding object wrapper classes.

  • Autoboxing allows primitive data types to be used as objects.

  • Auto-unboxing is the reverse process of autoboxing.

  • Autoboxing and auto-unboxing are performed automatically by the compiler.

  • Example: int i = 10; Integer j = i; // autoboxing

  • Example: Integer j = 10; int i = j; // auto-unboxing

Q25. 2.Program writing using class function and with some condition

Ans.

Write a program using class function and condition

  • Create a class with relevant functions

  • Use conditional statements to execute specific code

  • Example: class Calculator with add() function and if-else statement to check input

  • Example: class Student with calculateGrade() function and switch statement to assign grade

Q26. different of product based company &amp; service based company?

Ans.

Product based companies create and sell physical or digital products, while service based companies provide services to clients.

  • Product based companies focus on developing and selling products to customers.

  • Service based companies offer services to clients, such as consulting, IT support, or marketing.

  • Product based companies typically have a tangible product to sell, like Apple selling iPhones.

  • Service based companies rely on the expertise and skills of their employees to deliv...read more

Q27. Interface, java and spring, spring boot version. Difference between annotations.

Ans.

Interface, java and spring, spring boot version. Difference between annotations.

  • Interfaces in Java are used to define a contract for classes to implement.

  • Spring is a popular Java framework for building enterprise applications.

  • Spring Boot is a tool that simplifies the process of creating stand-alone, production-grade Spring-based applications.

  • Annotations in Java are used to provide metadata about the code, such as configuration details or behavior.

  • In Spring, annotations are us...read more

Q28. simple DSA problem: "introduction" find duplicate characters

Ans.

Find duplicate characters in a given array of strings

  • Iterate through each string in the array

  • For each string, iterate through each character and store the count in a hashmap

  • If the count of any character is greater than 1, it is a duplicate

Q29. What is front end and back end developer

Ans.

Front end developers work on the user interface and user experience of a website or application, while back end developers work on the server-side functionality and database management.

  • Front end developers use HTML, CSS, and JavaScript to create the visual and interactive elements of a website or application.

  • Back end developers use programming languages like Java, Python, and PHP to create the server-side logic and database management.

  • Fullstack developers have knowledge of bo...read more

Q30. Design a systems for large millions of users

Ans.

Design a scalable system for millions of users

  • Use microservices architecture to break down the system into smaller, independent services

  • Implement load balancing to distribute traffic evenly across servers

  • Utilize caching mechanisms to reduce database load and improve performance

  • Use horizontal scaling by adding more servers to handle increased traffic

  • Implement monitoring and alerting systems to track system performance and detect issues proactively

Q31. Factory vs abstract factory design patterns

Ans.

Factory pattern creates objects without exposing the instantiation logic, while Abstract Factory pattern provides an interface for creating families of related objects.

  • Factory pattern is a creational design pattern that provides a way to create objects without specifying the exact class of object that will be created.

  • Abstract Factory pattern is a creational design pattern that provides an interface for creating families of related or dependent objects without specifying their...read more

Q32. What are indexes in sql this the ne, t wn

Ans.

Indexes in SQL are data structures that improve the speed of data retrieval operations on a database table.

  • Indexes are created on columns in a database table to quickly retrieve data based on the values in those columns.

  • They help in reducing the time taken to fetch data by acting as a roadmap to the data.

  • Examples of indexes include primary keys, unique keys, and non-unique indexes.

Q33. What is function in javascript

Ans.

A function in JavaScript is a block of code that can be defined and called to perform a specific task.

  • Functions can be declared using the 'function' keyword followed by a name and a set of parentheses for parameters.

  • Functions can also be defined as arrow functions using the '=>' syntax.

  • Functions can be called by using their name followed by parentheses containing any required arguments.

Q34. What is inheritance in Java

Ans.

Inheritance in Java allows a class to inherit attributes and methods from another class.

  • Inheritance is a key feature of object-oriented programming in Java.

  • It promotes code reusability by allowing a new class to use the properties and methods of an existing class.

  • The class that is inherited from is called the superclass or parent class, while the class that inherits is called the subclass or child class.

  • Example: class Dog extends Animal { // Dog inherits from Animal }

Q35. Find the second largest element from array

Ans.

Find the second largest element from array of strings

  • Sort the array in descending order

  • Access the element at index 1 to get the second largest element

Q36. React Features and how to deploy

Ans.

React is a JavaScript library for building user interfaces. Deployment can be done using various methods.

  • React features include virtual DOM, component-based architecture, JSX syntax, and state management.

  • Deployment can be done using tools like Heroku, Netlify, AWS, or manually by building and serving static files.

  • Continuous integration and deployment (CI/CD) pipelines can be set up to automate the deployment process.

  • Server-side rendering can be used for better SEO and perform...read more

Q37. how many ways of Exception handling

Ans.

There are two ways of Exception handling in Java - using try-catch blocks and using throws keyword.

  • 1. Using try-catch blocks to catch and handle exceptions

  • 2. Using throws keyword to declare exceptions to be thrown to the calling method

Q38. What is api gateway in microservices

Ans.

API gateway in microservices acts as a single entry point for all client requests, providing routing, authentication, and other functionalities.

  • API gateway handles all client requests and routes them to the appropriate microservice

  • It can perform authentication, rate limiting, load balancing, and caching

  • Helps in decoupling clients from individual microservices, simplifying the overall architecture

Q39. What is interface in java ?

Ans.

An interface in Java is a collection of abstract methods and constants that can be implemented by a class.

  • Interfaces are used to achieve abstraction and provide a way to implement multiple inheritance in Java.

  • All methods in an interface are abstract by default and cannot have a body.

  • A class can implement multiple interfaces but can only extend one class.

  • Interfaces can also have default and static methods with a body.

  • Example: interface Shape { void draw(); }

  • Example: class Circ...read more

Q40. What is joins in SQL ?

Ans.

Joins in SQL are used to combine data from two or more tables based on a related column.

  • Joins are used to retrieve data from multiple tables in a single query.

  • There are different types of joins such as inner join, left join, right join, and full outer join.

  • Inner join returns only the matching rows from both tables, left join returns all rows from the left table and matching rows from the right table, right join returns all rows from the right table and matching rows from the ...read more

Q41. What flex in css?

Ans.

Flex in CSS is a layout module that allows elements to adjust their sizes dynamically to fill available space.

  • Flexbox is used to create flexible layouts where items can grow or shrink to fill the available space.

  • It provides a more efficient way to layout, align, and distribute space among items in a container.

  • Flex properties like flex-grow, flex-shrink, and flex-basis control how items behave within a flex container.

  • Example: Using 'display: flex;' on a container and 'flex: 1;...read more

Q42. What is javascript ?

Ans.

JavaScript is a high-level, interpreted programming language that is used to make web pages interactive and dynamic.

  • JavaScript is commonly used for client-side web development.

  • It can be used to create interactive features like animations, form validation, and dynamic content.

  • JavaScript can also be used on the server-side with platforms like Node.js.

  • It is a versatile language that is supported by all major web browsers.

  • JavaScript is often used in conjunction with HTML and CSS ...read more

Frequently asked in, ,

Q43. What is sql this is the major qn??!

Ans.

SQL is a programming language used for managing and manipulating relational databases.

  • SQL stands for Structured Query Language.

  • It is used to communicate with databases to retrieve, insert, update, and delete data.

  • Common SQL commands include SELECT, INSERT, UPDATE, DELETE, JOIN, and CREATE.

  • Example: SELECT * FROM employees WHERE department = 'IT';

Q44. Explain oops concept in java

Ans.

OOPs concept in Java is a programming paradigm that focuses on objects and their interactions.

  • OOPs stands for Object-Oriented Programming.

  • It involves the use of classes, objects, inheritance, polymorphism, and encapsulation.

  • Classes are blueprints for creating objects, and objects are instances of classes.

  • Inheritance allows classes to inherit properties and behaviors from other classes.

  • Polymorphism allows objects of different classes to be treated as objects of a common superc...read more

Q45. What is collection framework?

Ans.

Collection framework is a set of classes and interfaces that provide a way to store and manipulate groups of objects.

  • It provides interfaces like List, Set, Queue, etc. for storing collections of objects.

  • It also provides classes like ArrayList, HashSet, PriorityQueue, etc. that implement these interfaces.

  • It allows easy manipulation of collections using methods like add, remove, contains, etc.

  • It provides algorithms like sorting and searching that can be used on collections.

  • Exam...read more

Q46. What is encapsulation ?

Ans.

Encapsulation is the process of hiding implementation details and providing access to only necessary information.

  • Encapsulation is achieved through access modifiers such as public, private, and protected.

  • It helps in achieving data abstraction and information hiding.

  • Encapsulation provides better control over the data and prevents unauthorized access.

  • Example: A class with private variables and public methods to access them.

  • Example: Java Bean classes that have private variables a...read more

Frequently asked in, ,

Q47. What is sychronization ?

Ans.

Synchronization is the process of coordinating multiple threads to ensure safe and consistent access to shared resources.

  • Synchronization is used to prevent race conditions and ensure thread safety.

  • It can be achieved using synchronized blocks or methods.

  • Synchronization can cause performance issues if not used properly.

  • Example: Synchronizing access to a shared counter variable in a multi-threaded application.

Q48. How Kafka delete messages

Ans.

Kafka deletes messages based on retention policies and compaction

  • Kafka deletes messages based on retention policies set at topic level

  • Messages can also be deleted through log compaction process

  • Retention policies can be based on time or size of messages

Q49. Design a schema for some database

Ans.

Design a schema for a social media platform

  • Create tables for users, posts, comments, and likes

  • Include foreign keys to link tables together

  • Add columns for user information such as name, email, and password

  • Include timestamps for when posts and comments were created

  • Consider adding a table for hashtags to allow for easy searching

Q50. Explain JVM in ur own language.

Ans.

JVM is an abstract machine that executes Java bytecode.

  • JVM stands for Java Virtual Machine.

  • It is responsible for interpreting and executing Java bytecode.

  • JVM provides platform independence to Java programs.

  • It has its own memory management system and garbage collector.

  • JVM can be implemented on different operating systems.

  • Examples of JVM languages include Java, Kotlin, and Scala.

1
2
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10k Interviews
3.8
 • 5.4k Interviews
3.7
 • 5.2k Interviews
3.8
 • 4.6k Interviews
3.6
 • 2.3k Interviews
4.1
 • 2.3k Interviews
4.0
 • 324 Interviews
4.0
 • 132 Interviews
4.2
 • 107 Interviews
View all

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

Fullstack Java Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter