Site icon NgDeveloper

Java Interview Questions [Company Wise – 2024]

These below questions are asked in the actual interviews which I have attended in the last few years.

Walmart Java / Spring Boot / Microservices Interview Questions:

  1. Write a program to print the duplicate from this string?
    “abcdffabcoliabc”
    Here, split by 3 characters then print the duplicates presence in the string. In this case it is “abcf” is expected.
  2. Write a spring boot service class which consumes the data from RabbitMQ/Kafka and save it in the mongo repository then push the message to other consumer through RabbitMQ/Kafka. (Asked to write the complete code snippet for the above given requirement)
  3. Write a Sql query to get more than one active order placed after 01/01/2021 (order, delivery and customer tables are given) -> group by havin count(*) > 1 is the main key here.
  4. How does the production alerting system works and what kind of architecture/tools can be used for the same?
  5. How do you monitor your production application effectively where the production issues can be identified before even the business/product users report the issues
  6. How do you effectively write the auditing system in both relational and no sql databases ? (asked to write the query and sprint data jpa stuffs if any)

Optum Java / Spring Boot / Microservices Interview Questions:

  1. Design a theatre booking system. (in round1)
    Asked to list the tables required
    Asked to write the list of API’s required
    Discussed different pros and cons with mysql and mongodb for this use case.
  2. Design a online examination system (in round 2) which supports all type of questions like multi choice, match the following, text box, single selection etc.
  3. Interface vs abstract class vs functional interface
  4. Object -> what should have happened if this is abstract class
  5. What design pattern you used with your project micoservices implementations and explain the same
  6. Can we able to create the constructor for abstract class, if so how to instantiate it, if we can’t instantiate why does it allowed to create the constrcutor ?
  7. Explain the abstract factory design pattern
  8. Explain the solid pricples
  9. Write a sql query get the last 2 months inactive users/not logged in users from the user_audit table where user_audit will have entry whenever user made the login.
  10. Design a url shortner system which supports 2 to 3 million urls and what would be least digits or characters required to provide the shortest url possible ?
  11. How do you remove the duplicates from 1 million files which contains all type of files including text, audio, video etc

Paypal Java / Spring Boot / Microservices Interview Questions:

  1. What is the design pattern microservices uses ?
    Microservices uses decomposition patterns and Saga design pattern is one among them. Which basically ensures the one database per service and ensure both the local and global transactions to maintain the ACID property.
  2. What is functional interface and write a simple functional interface
  3. What are the major two problems we face with microservices ?
    1. Transaction management
    2. Every service need to have a kind of other informations data details
  4. @Controller vs @RestController
  5. @ComponentScan and how to load all the spring enabled components to the containers without specificying the @ComponentScan ?
  6. Difference between @Controller, @RestController and @Service
    Few more were also discussed, but I forgot will update when I remember.

BNY Mellon Java Interview Questions:

  1. Java 8 predicates
  2. How hashset works internally
  3. How hashmap works internally
  4. Write a program to return the third lowest number from the array using only one for loop and without treeset.
  5. How can you tell to spring Boot to create the bean dependency after another bean.
  6. Write a java 8 program to return the Boolean, list employee for the age greater than 29 by iteratibg the list.
  7. What are the suppliers and consumers you are using?
  8. (Optional.get() is one supplier) ? explain
  9. How hikari will be skipped if we use c3p0 for connection polling?
  10. How do you write only the unique values in the list of employees in the arraylist (not set)
  11. Nashorn JavaScript engine
  12. @type annotation in Java
  13. Mockito how do you mock dao get values and the values which returns void responses.

Cognizant Java Interview Questions:

  1. Different ways to create object in Java
  2. How many servlet request can be created for million requests
  3. Map, set and list collection in detail
  4. Tell all you know about synchronized all ways.
  5. Servlet lifecycle
  6. Left join
  7. What is closable interface
  8. Is there way to avoid finalize in latest java versions
  9. Final, finally, finalize
  10. How try with resources works
  11. Features you used in jdk 7?
  12. Spring scopes
  13. Default scope of spring
  14. What are all the design patterns you used?
  15. What is factory method design pattern?
  16. What are the annotations you know in spring ?
  17. How the correct request is handled by your rest web services or rest controller?
  18. Java is pass by value or pass by reference?
  19. Explain how Java is pass by value?
  20. Pass some string to some method and do some modification to the passed string and return the modified string. What happens at the background?
  21. Can we have only try and finally ?
  22. How do you connect java spring and hibernate together?
  23. What are all the spring module you know?
  24. Different ways of session management?
  25. What is transaction management?
  26. What are all the different propagations of transaction management?
  27. Annotation for package scan in spring?
  28. What is spring boot?
  29. Why do we need spring boot?
  30. Composition and aggregation
  31. When the hibernate gets it’s active connection?
  32. What is process and thread
  33. Did you use anywhere multithreading? Please explain it in detail.
  34. Where can we use LinkedList?
  35. How many session will be/can be there in hibernate ?
  36. Servlet behaviour in multithreading env?
  37. What design Patten hibernate session factory uses?
  38. What are the different caching available in spring
  39. Hibernate load() and get()
  40. Sum(int, long) and sum(long,int) overloading sum(10,10) which method will be called
  41. ‎what is overriding and overloading write and explain
  42. ‎write a query to return the duplicates
  43. stringring str1=”ABC”; String str2=”ABC”; String str3 = new String(“ABC”); == And equals
  44. Hashmap key should be case sensitive but should be considered as same key, means should be overided (how to override put key and get value methods)
  45. Spring boot will have web.xml?
  46. How do you parse xml file ?
  47. Interface Vs abstract class
  48. List to set how many ways
  49. One interface two different classes how to override in the only classes (@qualifier)
  50. Try catch inside catch block possible?
  51. Singleton classes
  52. Can singelton class have static or public methods variables
  53. Spring boot usages
  54. One to many and many to one mapping example
  55. Hashmap different questions /scenarios and hashing principle
  56. How to get session in hibernate
  57. Session factory vs persistence context
  58. Abstract parent class with display method and child class extend has display method
  59. How do you call display method in both parent and child classes?
  60. Spring scopes
  61. What is prototype scope?
  62. Maven provided?
  63. Ant vs maven, why we need maven?
  64. Do you know GitHub ?
  65. Transaction management in spring?
  66. What are the different levels of transaction management or used in your project?
  67. How do you analyse a production issues?
  68. How do you improve performance issues in Java?
  69. Interface vs abstract class
  70. ‎write a Singleton class object and avoid it to be created through new class as well.
  71. ‎Users | Books | Authors -> Write the Hibernate mappings and Write all the endpoints possible
  72. If I have a 10 same java books, how will you exactly track which one is in liberary and users?
  73. ‎write a Singleton class to keep the user logged in/session only once, so that the same user tries to login from different system, they should not be allowed to login again and should be logged in directly or message stating already logged in from another computer.
  74. ‎design patterns you used more or you know well

Infosys Java Interview Questions:

  1. Serialization /deserialization write the sample snippet
  2. ‎single vs mutual ssl difference
  3. Difference between http and https
  4. ‎how https is sending the data securily?
  5. ‎what is zool/eureka/hystrix in spring boot
  6. ‎why we need spring boot
  7. ‎what utility/tool you used to develop microservices?
  8. how the data goes as json from backend to frontend….
  9. ‎How are you doing security with your application
  10. How the jwt is implemented and avoided the cors (cross origin sharing resources)?

Synechron Java Interview Questions:

  1. Solid principles in java
  2. ‎Exception hierarchy
  3. ‎hibernate states
  4. ‎bean lifecycle
  5. ‎can we start the same thread two times
  6. ‎concurrent modificatiin exception example or scenario
  7. ‎when to use invoke method in java spring
  8. ‎what is right outer join
  9. ‎what is namespace or native queries in hibernate
  10. ‎runtime vs checked exception
  11. ‎when to use arraylist and linkedlist scenario
  12. ‎hibernate example for transient to persistent state
  13. ‎what is abstration and who can use that?
  14. ‎singleton vs prototype
  15. ‎what happens if we use prototype inside singleton
  16. many to many mapping full details
  17. Two threads thread1 and thread2 hiw to make sure that always thread1 runs before thread2.
  18. ‎can we overide static method and explanation
  19. ‎when to use runnable and callable
  20. ‎how to call our own func or proc from hibernate

Capgemini Java Interview Questions:

  1. How would you approach a design for scratch or new application developments
  2. What are all your approaches for tuning up the application for better performance
  3. What do you know about joins
  4. What is cordinal value
  5. What is ruleengines and workflows?
  6. Oops concepts
  7. Inheritance example in your project.
  8. How did you use thread in your application
  9. How good you are in Oracle and joins
  10. How good you are in jsp
  11. How do you manage a session?
  12. ‎How the Spring security implemented in your project?
  13. ‎entries for session in web.xml and time in minutes or milliseconds….?
  14. ‎Spring aop.

Hexaware Java Interview Questions:

  1. Why are using RabbitMQ instead of Apache Kafka/AWS sqs
  2. What is the use of AWS lambda?
  3. How are you using S3 along with your spring boot Microservices ?
  4. Explain me Jenkins ci/cd pipeline along docker Microservices

Fidelity Java Interview Questions:

  1. @qualifier – Explain
  2. Bean Id=a class=A scope=prototype, Bean id=b class=A scope=Singleton, What will happen here ?
  3. What is your understanding about ioc ?
  4. Two independent services and the third service is dependenting on the first service output, how do you architect this in Spring?
  5. What is immutable and steps to create immutable class
  6. @directive vs @component difference in angular?
  7. Abstract class vs interface live scenarios to pick.
  8. Interceptor in spring (difference with filter)

Wells Fargo Java Interview Questions:

  1. Hibernate inheritance
  2. Merge vs saveorupdate
  3. Spring mvc
  4. Build tool
  5. How will you call a wait method
  6. How two threads communicates between each other
  7. How do you create a arraylist read-only?
  8. Load vs get in hibernate
  9. Maven scopes

Renault Nissan Java Interview Questions:

  1. What is serialization
  2. What is inheritance
  3. What is super keyword
  4. How inheritance and super keyword differs
  5. What is ldap
  6. How will you implement spring security

Wipro Java Interview Questions:

  1. String is immutable
  2. what is ‎intern?
  3. hashmap functionality
  4. ‎try, catch finally different scenario
  5. ‎try with resources concept
  6. ‎repeated character count of string
  7. ‎covariant
  8. ‎association & composition
  9. Fail fast & Fail safe
  10. ‎concurrent hashmap
  11. ‎collections.synchronized(hashmap)
  12. ‎Content projection in angular
  13. ‎spring boot specific annotations
  14. ‎volatile
  15. ‎facts about string
  16. ‎standards for creating immutable classes
  17. How core Java jdbc Prepare statement works
  18. What is the specific advantage of treeset
  19. How namedquery works and benefits of the same.
  20. Write and show me singleton class in multithreaded way.
  21. What is try with resources?
  22. How do you load Java classes dynamically.
  23. Service discovery
  24. How do you test Microservices independently and combined way?
  25. How to use jetty or any other server in spring boot (other than Tomcat)?
  26. Eureka
  27. What is executor service
  28. Treeset vs hashset
  29. What’s new in Java 8
  30. what is view resolver
  31. How do you set context path and server port
  32. How do you access java.util.properties in rest controller.
  33. How do you access application.properties values in rest controller
  34. @consumes use
  35. How do you deploy a Java Microservices in docker
  36. What needs to be done minimum to make spring boot to work with hibernate?
  37. How did you use spring security in your Microservices?
  38. Spring security takes care only authentication/Authorization/both?
  39. What are all the configurations we need to do to use application.yml instead of application.properties
  40. What is inner class and write and show me the simple inner class.

RBS Java Interview Questions:

  1. In a shared instanced will singleton works wrongly or create any issues for the requests to different instances each time.
  2. What is the difference between hashmap vs concurrent hash map.
  3. Difference between iterator vs for each
  4. Steps to improve the performance of the system
  5. How serializable works and how one class serialized in one machine can be deserialized in another Machine.
  6. How do you do paginations without jpa/spring boot.
  7. What is the use of @JsonIgnorrCase and @Transient Annotations.
  8. How can I convert my http spring boot application to https one
  9. Difference between JKs and pkcs files

IBM Java Interview Questions:

  1. Different types of autowiring
  2. How do you load application context yourself
  3. What is the jar which speinyboot is using to generate JSON outputs
  4. What is the use of @qualifier when autowiring can be done by name and type
  5. What are the different scopes in spring
  6. What is @join
  7. What are the types of @join and other one of the aspects
  8. String vs string buffer
  9. How do you create your own immutable class
  10. Create iterator for custom classes (student.iterator) to access all its fields
  11. How to restrict to access or modify your classes through reflection
  12. Immutable objects avoid cloning also
  13. How do you create singleton class what are all the design patterns you have used
  14. Prototype vs singleton vs request scopes
  15. How do you initialise or load application.context file ?
  16. What is factory design pattern
  17. How concurrent hashmap works internally?
  18. How hashmap and concurrent hashmap differs with its implementations?
  19. What is static keywords and tell me with the exact use case of the same?
  20. How transactions are handled with rabbitmq or between two different queues?
  21. Explain me the memory systems of java
  22. How do you perform unit testing (mockito)

Java Development and Best Practices

Spring Framework and SpringBoot

Hibernate and Database Management

Application Security and Design Patterns

DevOps, Containers, and Microservices

Programming Concepts and Methodologies

Exit mobile version