Interview Questions
- Ashish Vashisht
- 3 days ago
- 16 min read
1.Write a program in java 8 to convert the upper case charcaters in String to low case and viceversa
2.Write a program in java 8 to group list of employees on the basis of salary
3.Write a program to return output 0 if its given 1 and return 1 if inout is 0 without using if,else, no ternamry, no switch, and no other inputs
4.sql question - you have employee table and 5 duplicate rows of the same employee, you need to delete 4 row and keep 1 row
types of ioc container
Spring Ioc container life cycle management
Ioc benefits for the developer
bean scope types and purpose
1. What is your approach to upload large file into DB
2. How you will communicate 2 differnt systems
3. How post method call from one system to another system
4. Do you know spring batch
5. How will you access entities using security
6. what are the changes you need to do to migrate java8 to Java 17
7. What is difference between GET and PUT method
8. How will you store the multiple documents
9.If I given a requirement for 3 application, having more than 20 fields
how will you design the application, what are the technology stack you will use,
how will you provide estimate ?
10.How to upload a file into the DB if it has huge data, what are your approaches?
11. Asked about my project, how will store multiple loan documents ?
12. How will you perform scheduling tasks in your project ?
13. Is your project is intranet or internet application ?
14. How your project is maintain security in your application ?
15. How much comfortable writing angular code ?
Tell me about yourself
Explain your recent project (technically)
Spring Security - JWT and OAuth
Have you used Spring profiles
Difference between map and flatMap
How HashMap and ConcurrentHashMap work internally. Have you used ConcurrentHashMap?
@Transactional
Rules to implement REST API
CRUD operation
Design patterns you have used
Caching mechanism
Java 8 features
Functional interface and built-in methods
Optional and built-in methods (scenario-based)
Spring bean life cycle
Dependency injection - ways to implement DI
Spring Data JPA table creation
Scenario-based example of primary key, foreign key, composite key
Question related to indexing (scenario-based)
How select * works internally
Disadvantage of indexing
JUnit and integration testing
How to write a good test case
How to maintain code quality
Different types of HTTP methods
@Ignore and @Disable
Have you worked in messaging platforms? if yes explain
How CI/CD works
1. Tell about your recent project
2. http methods and it's use
3. http status code
4. difference between primary key and foreign key
5. difference between queue and topics
6. What is normalization
7. How you design a rest api to get data from Employee table
8. What is unit testing and integration testing
9. How you write a good test case
10. What is TDD
11. What agile process you follow
12. What CI/CD process you follow
13. Some of JAVA 8 features
14. What is difference between supplier and consumer
15. What is Optional.of and Optional.ofNullable
16. Assign a String with optional.empty() what value will string get will return
17. Assign Optional String with optional.empty() what value get will return
18. Recursion function in Lambda
19. Default methods in functional interface
20. What happens when override default methods
21. How you will get the employee with second largest salary of specific department using stream (in case multiple employees have same salary)
22. Do you know Kafka
23. What microservice design patterns you used
24. What is CQRS pattern
25. How you communicate between multiple micro services
26. Composite key
27. Types of Joins and explain
1.telling about yourself
2. your role in recent project
3.http status code and meaning
4.how you handled ci/cd pipe line in your project
5.how you measure performance of your API
6.what you do if API handles large data
7.kafka partions ,what is purpose of it
8. what is role of replica in kafka
9.have you working on AOP in spring
10.how to invoke lock in method level
11. what you will do if the trigger fails
12. how to improve your query performance for long running query
13. what is the impact of index in your query
14.how spring JPA handing join of two tables
15.query planner
Brief on the project worked on, technologies used and the role.
what and why microservices
how you deploy this microservices
Kafka/ActiveMQ how to read message and store in DB
How to upload a file into the DB
How to upload a file into the DB if it has huge data as json/csv, full flow and approach related question
Requirement is to read data from some place when it will be available, your approach.
Scenario when to use HashMap and concurrent HashMap.
What is serializable and when to use that.
Expecting Hadoop, Big Data, Spark, Kafka and others
Financial Domain Experience
Since I have not worked above, He asked below questions
Java 8 Features questions about Lamba Expression, Functional Interface, why these features added
Remove duplicates in a list without using Collection or Streams
SQL various types of joins
Self join and when it is used
How do you do testing the code
difference between @mock and @spy
How to convert list to map
Multithreading types
Why static and default methods in Interface
What all features of Spring Boot used in your application
Spring boot - How to identify a slow spring boot app? What needs to be done to ensure that the app can improve performance.
Whats the function of @SpringBootApplication.
Difference between Mysql and MSSQlServer
How do microservices communicate with each other
Explain how Eureka Server works in detail and how microservices registers and communicates using Eureka.
How does fault tolerance happen using hystrix
Multithreading executor services all the types
What's a priority queue and a blocking queue
Have you worked with Spark or Hadoop and Angular
Coding question - Implement a basic queue.
What is the functionality ForkJoinPool
How to split a requirement into multiple microservices? whats the deciding factor?
Java 8 ConceptsSpring Aop concepts and annotation@qualifier annotation in springbean scope and bean lifcyclearraylist methods and linkedlist with functionalityview in sqldocker file and docker commandsmaven scopes and what is the default scopewhat is reflections api how can it be used dependency injection what is thread and thread lifecycleproxy in spring boot ** How to handle JVM out of memory situation
java datbase sql query optimization steps
Thread concept and methods
what is docker file and provide stepswhat is pagination and methods inside it
Done with Pod 13 interview (Kocherla Venkata Sai Lakshmi)
Tell me about your self and about current project
what messaging queue you are using, for me it's ActiveMq
what is the load and how you are handling the load
what testing framework you have used.
how you are monitoring and handling Memory issue in your project
handling deployment in production if any memory issue happens
how much rate yourself in java
how you are using ThreadPool and synchronization in your project
Eurekaserver -> Related questions like which databse used to store info of ms
Circuit bracker
Maven dependencies related - how to resolve dependecies conflict in maven and about maven dependencies manager
Production - how to debug prod env which tools you have used
How you are deploying your application
Blue green ddeployment
jenkins
Openshift how its work - how you used in your project
Have you work angular and hadoop
Code questions - to find missiing no between 1 to 100
1)Explain about yourself
2)write a code to demonstrate workings of HashMap
3)scenario based coding sample need to share what will be the output
//first method type was void the he changed it to String
String method()
try{
// an array of Integers
iteration to print the elements
return "success";
} catch (Exception e) {
return "Exception";
} finally {
return "finally";
}
// main method below
String h = method();
Syso(h);
4)another scenario based sample code
List a = new ArrayList<String>();
a.add("A");
a.add("B");
method(a);
// further changes later on
// List b = new ArrayList<String>();
//method(b);
// a.addAll(b);
Syso(list.size());
List method(List arraylist){
arraylist.add("C");
}
5)Another scenario based sample code demonstrating exception chaining how the hierarchy works
6)Using java 8 write a code to notify a customer if creation date is 3 days before from the current date
7)Any experience in MongoDB
8)Explain about Kafka? Do you have hands on experience using the same?
what is the feature in java 8
what is functional interface
optional class
how many null key and value put in hashmap with Scinerio
what is idempodent
checked exception and unchecked exception
dependency injection
different http method
spring security
Tranasaction
spring data JPA table creation
foreign key in database
trigger in data base
index in data base
Junit
how to define mock and inject mock
docker and kubernetes
ci/cd pipeline
List of {1,2,3,4,5}, return 3,4 as a list without using sorting, comparison and filter but need to use stream.
Which collection is fast invcase of removal of an element, arraylist or linked list?
Provide custom implementation of ArrayList and LinkedList
What if my pointer is at last element, which one will provide faster result?
What is FixedThreadPool?
How it will differentiate I/O, System operation and Other operations?
What is Deadlock? If you don't have access to application but to the server only, what is the way to identify deadlock? What are the keys to identify deadlock thread in thread dump?
What is Virtual Threading?
How Spring Boot identify all the auto configurations?(internal working of spring boot for auto configurations and annotations)
What is method overloading?
What is method overriding? What are the rules of method overiding?
What is use of final keyword? Why we need it?Can we override final method?
Can member variable changed of final class?Can we change username/password of User final class?Scenario based
What is Qualifier?
What is difference between Controller and RestController?
What is functional interface? Example of java functional interface?example where we use funational interface?
What is historic algorithm?
What are the ways to handle exception in Spring Boot?
How to handle custom exception without using Controller Advice and Exception handler, return proper http status code and handle custom exception.
What is Lock interface?
default connection pool springboot
Difference Between List and LinkedList Implementation
Own implementation of list and linked list.
HashMap implementation and own implementation of HashMap
Cached Threadpool and given scenario which threadpool should be choosen
Lock interface
functional interface , example
what is deadlock and how to find if the application is in deadlock (application is not yours and you can just see the application is running in Linux machine)
HeapDump , How to create Heapdump
Method overloading
Method overriding , if exception in parent class declaration how it will handled in the child class
Record
default connection pool springboot
Transactional
Springbootapplication
RestController and Controller
Qualifier
Isolation level
what is serializable isolation
when transational wont work
failfast and fail safe iterator
propagation
grouping 0s and numbers separately and return single list using streams without using filter and sorting. virtual thread , exception handling with springboot.
What is your current project?
What are your roles and responsility?
What module/component u have taken care?
What is HashMap?
What is internal working of HashMap?
What is the efficiency of HashMap?
In case of bulk of data, how hashMap provides efficiency?
In case, where no of records having same bucket, what needs to be done for efficiency?
Which Map will be preferable in case of data consistancy?
What is difference between HashMap, TreeMap and ConcurrentHashMap?
Explain the scenarios for each of above
What is Immutable class? Why we need immutable class?How we can achieve immutable class?
What are the main points to be taken care when move from monolythic to microservice architecture?
What are main pointers of microservices?
What is memory leakage?
How we can identify there is a memory lekage in application?
What solutions need to provided for memory leakage?
What is synchronous communication and asynchronous communication?How we can achieve it?
What are the drawbacks of synchronous?What are the drawbacks of asynchronous comm?
What is kubernate?
How we can scale the microservices using kubernate?
1.Implement stack using array or linkedlist concept.
2.find missing number.
3.difference between Spring and SpringBoot
4.What Consumer in Java-8
5.Java-8 features
6.Explain about your project Architecture?
7.Write Controller class
8.write sql query to find employee which is not allocated to project(EmployeeTProjectT) using join.
9.explain join.
10.hashset internal implementation.
11.sql/NoSQL difference.
12.which is better(sql/NoSQL) and why
13.@RestController
14.@SpringBootApplication
15.diffrence between JDBC and JPA
16.ThreadPool?
17.set and list difference.
18.explain CI/CD pipeline
19.which is better(JDBC and JPA) and why we are using.
20.what is Docker and Kubernetes.
Program: reverse the link list without using recursive
method overloading and method overriding
JDBC isolation level
Safe point
difference between Arraylist and linkList which one is better
Exception handling
types of Threadpool
Spring vs springBoot
Spring annotation
@SpringBootApplication work
Stream filter, collect method
Record class
Java 1.8 feature
Why we need funcation interface
How HashMap Working on internally
explain collision in hashmap
What is the parent Annotation in Spring Boot
Why @Entity requied
How we are manually configure the databse in spring boot
how to avoid the duplicate values in the list using 1.8 java
how to map pojo to key and values
what is the use no sql
Have you used version control
how you doing the deployment and which languge you did the code
Java-State the Java 8 features-How to convert Date value to String value-How to get the unique values/remove duplicates from the list, using java 8 stream. How you do in normal java.-How to convert Map value to List value-How many server are in spring boot, which you are using - I told tomcat , they asked y not chosen jetty server.-If I am upgrading the version (spring boot), what pre-requisites to consider.-Write a logic for Armstrong number using streams.-Have you used SVN or which ?-Do you have experience on Message queue, if yes explain
React-Explain what all concepts u worked on react.-What's the difference b/w react js and angular js -> why you choosed react js for your application.-Then started with each -what is class and functional components-What is useState() -> if i declare useState(0) for a variable, can I change the value.-Hooks in react, useEffect() -> can you tell any scenario used using useEffect in ur application/code.-How to access the value from one component to other , explain with code-How you communicating b/w FE and BE.-what is JSX , which server you used to run the react app.-Asked about node modules and npm.-Which IDE used for react -> told VSC -> Asked why chosen VSC only, do you know any other.
-As I mentioned in the resume for tools -> asked on bitbucket,mobaxterm,VSC
Database-How to get number of records from the table -> explained on group functions in deep
Working of Java garbage collection
Working on HashMap,LinkedHashmap and TreeMap
configurations made for creating restful web-services in Spring Boot-working of @EnableAutoConfiguration
Difference between @Controller and @RestController
Parallel processing in streams with example
Kafka working-retention policy
How memory leakage can be avoided during DB transactions
Features specifically used in Java 17 when migrating with spring boot 3.3
monolithic and microservices architecturewhat is the probelm in the microservices architecturehow two microservice communicate each othercircuit design pattern
There are emp and dept table is there find out how many rows fetched from left join,Right join,full join,Cross join emp table :5 rowsdept table :8 rowscommon between table: 2 rows
create a has map with String is key and value is integer as key value.find the even value from has map and store the result in has map
Java :
• java code to find the longest string in a list using streams
• swap two variables without the third variable
• difference between String,StringBuffer and StringBuilder
• need for over-riding hashcode and equals method
• how keys are getting created in an hashmap
• which collections are preferable for Async operations
• how to work with Async operations efficiently(ExecutorService ,threadPool,@Async)
• explain join() in threads
Spring Boot:
• @RestController
• how controller class defined in springBoot explain all annotations
• exceptionHandling
• how healthcheck done for an application
• performance optimizations done to increase the performance in project
Design Patterns:
• explain saga pattern
• explain working of api-gateway if used
Microservices:
• Ways of Synchronous and Asynchronous communications between microservices.
CICD
• what is continuous deployment?whether the older artifact will be deleted immediately or after successful deployment of new one
Spring JPA Spring Aop and annotationsand how it works in real time
Different design patterns with how it is used in projectMaven dependenciesType of dependency injections arraylist vs linkedlist which one is better
How you handled transaction load in DBSQL transactionsJVM worksMaven dependencies and tools Types of DI and how it works which one is betterDesign pattern in java and how it usedScopes in BeansMicroservices architectureHashmap and problem scenerioThread states and life cycledifference between Blocked, waiting and timed waiting stateshow to execute multiple threads ?Attribute of thread pool
Rest templateWhy transaction not working
What is Thread Pool configurationsList of Object methodsHow to compare object and how it works
What are the scenarios in which Transaction wont work ?How to avoid multiple writes at the same time in DB from clients.
@Transactional in Spring BootScenario where we have multiple threading systems in which we have multiple data formats in which we get the data, while build REST API'swhich design pattern you choose to implement
Which build tool are you using ? Maven or Gradle ?What are the scopes of Maven
Experience with Kafka, Docker,Redis and KubernateDifferent types of acknowledgement in Kafka Producer Acknowledgements OptionsHow Kafka works for messaging
List of Object methods
How to compare object
What are the scenarios in which Transaction wont work ?
Scopes in Beans
Spring AOPThread states and life cycledifference between Blocked, waiting and timed waiting states
how to execute multiple threads ?
Solution of concurrency problem
How to avoid multiple writes at the same time in DB from clients.
Use of @Qualifier annotation
Type of dependency injections
Attribute of thread pool
Scenario where we have multiple trading systems in which we have multiple data formats in which we get the data, while build REST API'swhich design pattern you choose to implement
Which build tool are you using ? Maven or Gradle ?What are the scopes of Maven
What is ThreadPool configurations and what are the different types and their purpose ?
Explain difference between ArrayList vs LinkedList and scenarios where to use which one
Experience with Kafka, Docker and Kubernate
Command to find container in docker
Structure of docker file
1. Thread Life Cycle
2. Thread Implementation
3. Thread Pooling configuration
4. Bean Scopes
5. If multiple client update single table related to database Locking Mechanism
6. Docker and Kafka
7. AOP - Advise
8. Dependency Injection types
9. Proxy in Spring/Spring Boot
10. @Transactional in Spring Boot
11. @Transactional, If IO exception occurs, how will you handle, will it rollback or not
12. @Qualifier annotation in spring
13. Connect Rest API - URL and RestTemplate
14. NOSQL DB
15, JPA interface, how it works
Java:
What is JVM, JRE and JDK, explain each of it.
What are basic of oops, explain each?
What is abstraction? Explain how it works.
how JVM knows which child class's method needs to be executed when you are overriding that method of parent class
What are maker interface, and why they are used? for ex, what do Serializable do to your class or how it affects your class.
Coding problem on inheritance and abstraction of class.
PreparedStatement vs CallableStatement.
Spring:
List the annotations you have worked with in spring.
Explain internal working of @Autowired, which design patterns were used in working of @Autowired.
SQL:
Can we use stored procedure with select query?, if no/yes why?
Can we use stored functions with select query?
1. Introduction - Introduce yourself. 2. Design Patterns
- List the type of Design pattern and explain which design pattern you have used in your previous project.
- list of design pattern used in Spring boot
- Explain the Saga design pattern. 3. Java & Spring Boot
- how micro service communicate each others
- How you working with Controller
- Difference between Aggregation and Association
- global exception handling
- What is the Circuit Breaker design pattern?
- what we have used to check health of spring boot applications
- when to use String and when to use StringBuffer.
- write java program to find duplicate elements from list
- find list of string using which ends with X
- find duplicate Strings from list using stream.
- write factorial program with recursion function.
- difference between Throw and Throws
- what fail fast and fail safe
- how to execute multiple thread
- how to secure API , what type of authentication you are manage in your project.
1. Introduction - Introduce yourself. 2. Design Patterns - What is the Singleton pattern? - Singleton pattern falls under which type of design pattern? - What is the difference between Creational design patterns and other design patterns? 3. Java & Spring Boot - Write a Java Stream API program to group elements of `String` type by their length . - code in java to extract the last digit from numbers - Have you worked on multithreading? What is `Future` in Java? - What are Spring Boot annotations? - What is Spring Actuator, and how is it used?
4. Microservices - Explain the Saga design pattern. - What is the Circuit Breaker design pattern? - How do microservices communicate with each other? - How can you implement asynchronous communication in microservices? 5. Software Development Principles - Explain the SOLID principles in software design
-Arraylist & linkedlist questions1)way to delete object from any collection.2) Scenario based questions for duplicates & preserving the order-use & working of treeset collection-use of executor service
Spring: -different bean scope with detault one-maven scope & details with default one-AOP questions1) @before use with example2) @after use with example3)If @Aspect fails then how can we handle?- How can we handle exception globally in spring-If I have same type of bean and I want one bean to take up first what annotation I can use-what is the difference between Autowired and resource difference- Conditional annotation
Docker & Kubernates:- How to mount local disk to container- Working of Kubernates
DataBase:-Suppose in a table two user trying to perform update at the same time. I want 1st user complete update and then 2nd user perform operation on latest data. how can we achieve this?
what is diffrence between C and Java language?
What is @Transactinal annotaion?What is @Qualifier annotaion?What is @autowiredWhat is kafka broker?Thread states and life cycledifference between Blocked, waiting and timed waiting state?how to execute multiple threads ?diffrence between linkedlist and arraylist?Spring Dependency injection?ThreadPool?AOP?
Factory Design Pattern?Bean Scope?
JVM?Pagination and Sorting?
Internal working of concurrent hashmap.
sort 1M records - find top 100. Java how?
Array list vs linked list? Which one is better?
How to differentitate between Person and Student Data class?
SQL:
How to avoid multiple writes at the same time in DB from clients.
@Transactional in sql
SpringBoot:
Which annotations use DI?
@autowired vs @inject diff?
How to add more methods in @Configuration class?
How to create docker file? + Kubernetes
What are the scopes of Maven
Java:
int array duplicate remove array in order java?
sort array small to large?
Array list vs linked list?
how to safely delete items in linked list?
SQL:
Retrieve largest to small data from sql?
How will write unit test cases for database?
SpringBoot:
Spring Dependency injection?
@autowired vs @resource diff?
How will global exception handler will work?
How to create docker file?
What are the scopes of Maven
Explain difference btween ArrayList vs LinkedList and scenerios where to use which one
ExecutorService
ThreadPool
AOP
Bean Scope
Maven
How to create docker file
Explain Kubernetes
Pagination and Sorting
Dataase optimisation
What are primitive data types ?difference between int and Integer
Scope of Transactionwhen to use the transactionWhat are the scenarios in which Transaction wont work ?
Scopes in Beans
Dynamic proxy and what are the limitations
Spring AOPThread states and life cycledifference between Blocked, waiting and timed waiting states
how to execute multiple threads ?
Second: Keira
Scenario where we have multiple trading systems in which we have multiple data formats in which we get the data, while build REST API'swhich design pattern you choose to implement
Which build tool are you using ? Maven or Gradle ?What are the scopes of Maven
What is JVM
Scenario when Out of Memory Error occurs how do you handle that situation and what is your approach ?
Scenario when there is a huge csv file which is more than your JVM memory, I have to find the largest number in that file.
What is ThreadPool configurations and what are the different types and their purpose ?
Explain difference btween ArrayList vs LinkedList and scenerios where to use which one
We are done. Thank you for joining. Have a good day.
留言