Java Interview questions

    1. Which one is efficient in terms of retrieval between TreeMap and HashMap
    2. What is an atomic operation and synchronized in Java?
    3. We have ReST Service and multiple clients accessing it. How do you handle the count of calls to ReST Service from these clients including concurrent calls
    4. We have Hive Tables - Emp Table and Dept Table and a join query to get employee name and department name on join condition empId == deptId. Can you explain internal execution of this hive query?
    5. Explain the mechanism of Mapper Output related to Reducers Input.
    6. What is the default partitioner used in Spark?
    7. How to handle data skew and cleansing operations?
    8. Do you know about Spark Execution Memory Model?
    9. Since you have 15+ yrs of exp, what type of role are you looking at (Non-Technical) 
    1. Explain purpose of Spring Profiles
    2. How do you find the middle node in a singly linked list without using any built-in functionality?
    3. When we try to place key-value pair with an already existing key into a hashmap, what happens? Explain the internal working of HashMap.
    4. HashMap already has an entry for (key1,10). If we try to place again with different value say (key1,20). What would be a value returned for map? get(key1) and why?
    5. How do you store passwords in Java? Which is preferred - String or CharacterArray?
    6. What is JPA/Hibernate?
    7. Write SQL Query to find the maximum salary for a department given dept_id and salary fields in department table
    8. What is the purpose of ZooKeeper in Kafka Cluster?
    9. How is load balancing achieved in Kafka while publishing messages to Kafka Brokers?
    10. In method overloading with xyz(Object o) and  xyz(String s), if we call XYZ(null), which the method gets called by the compiler and explain
    11. Explain what happens when you execute the Springboot Application 

    Can Kafka be used without ZooKeeper?

  1. I have 10 GB file and how do process in java?
  2. I have 10 files and want to run process these files in multithreading. how can you write code find the count of records processed at any given time?
  3. what are the different connection pooling properties? consider in the situation how can you or application handle that record needs to updated to the database but not getting connection due to network failure.
  4. i have two tables employee with empid, deptid, and department table with deptid, dept name and there are null values for deptid in the employee table. how you can write a query to retrieve all employee records with department name along with null dept id's
  5. how will you read and write 5GB big data files from one file location to another location with less memory 512mb  in java?
  6. what are an atomic integer and its usage?
  7. How could we share the value between the multiple threads?
  8. what is the use of post construct method in spring
  9. Query to display emp id, dept id, and dept name if dept name is empty should display default  department name from two tables employee and department 
  10. What is cursor in pl SQL
  11. Any working knowledge of Hadoop and big data.
  12. Explain the current project functionality and architecture 
  13. how to make run threads in sequence  
  14. what use are Atomic Variables in thread
  15. what is the use of @autowired in spring what  internally happens
  16. you have n number of threads how to run in sequence printing by each thread tell pseudo code
  17. spring design patterns and explain
  18. what are scopes in spring
  19. what is the singleton bean
  20. how to inject prototype bean into a singleton bean
  21. Explain the spring application context
  22. java 8 features and what is the use of Default method
  23. what is the difference between the SQL and NoSQL databases
  24. which scenario you use MongoDB and relational databases
  25. what is docker has written any docker images
  26. how fetch the data between the table write a query using joins with  table records are given
  27. what use of NVLwhere it uses
  28. how to find out if your facing issue product environment
  29. angular and which version you used in developing applications and application flow
  30. Find the middle of the LinkedList in the collection using a double linked node method.
  31. What is the need to override the hashcode method in HashMap
  32. Spring - life cycle of Bean
  33. Multi-threading program - need to print the 1 to 100 based on the inputs like no of thread 
  34. e.g - if no of a thread is 2 then, print the values like 123 from thread 1 and 456 from thread2.
  35. SQL - find the second max salary of every dept in an employee table 
  36. e.g employee table - empid, empname, deptid, salary 
  37. Hibernate  eager loading and lazy loading difference
  38. Multithreading synchronization method and normal method difference 
  39. Spring batch  chunk () method use
  40. Spring batch partition () method use
  41. Multithreading four threads each thread is printing sequence numbers 1,2,3,4  and again same threads will continue the same, explain the step by step process.
  42. Get and load method difference in hibernate 
  43. What are the design patterns available in Microservice that are utilized in this project?  (Based on skillset added in specific profile)
  44. What are the important features of JavaSE 8?
  45.  Explain Java Lambda Expressions and advantages?
  46.  Java Stream API and map, reduce concepts in stream methods (Scenario-based)? (In an ArrayList of 10 elements, we need to add like (1*1 +2*2....10*10) and need to execute the output greater than 64?).
  47.  How the Multi-threading is handled using executors?
  48.  What are the design patterns that are used in Spring Framework?
  49.  What are the high-level architecture and internal structure of Spring?  (Not like, from the dispatcher to view mode).
  50.  Explain IOC and its concepts used in Spring with advantages?
  51.  Explain Spring AOP?  (Scenario-based)?
  52.   How to write the query for getting the results which are greater than 30% marks, For Ex? (We want to retrieve specific information from a table excluding other irrelevant data)
  53.  How to list all rows in a table whose column values match a specified pattern? (Search capabilities of a SQL query.)   
  54.  Does the wild card search is case sensitive in SQL?  (Extends from the Question 11, Similar)
  55. What is the ConcurrentHashMap in what it is different from Synchronized HashMap and HashMap
  56. What is HashSet and when we use it?
  57. When to use the ArrayList and LinkedList
  58. What is the significance of equals and hashcode...what if either of these methods is not overloaded
  59. What is Deadlock? Give an example or scenario. How to avoid the deadlocks
  60. If want to build the screen to fetch the data from DB, how many days you require
  61. What are the different classes we require to write for developing the screen
  62. What is the AOP and how to configure using an example
  63. What are Microservices and where you have used
  64. What are the design patterns used in Microservices
  65. How to configure OneToMany and ManyToOne mapping in hibernate
  66. What is eager and lazy in hibernate
  67. How to write the Joins, asked with an example scenario
  68. What is JDBCTemplate and what is the internal design pattern implementation used here
  69. What is the template method design pattern
  70. What is a strategy design pattern
  71. What is rowMapper and what is the internal design pattern used here
  72. What are the used Java 8 features?
  73. What is Lambda expression and how to define with an example
  74. Does Lambda requires the functional interface or without functional interface also Lambda can be used?
  75. What is the stream...How to use and what are the benefits...how to retrieve only odd a number from 1-100 using streams
  76. What is the life cycle of thread and methods involved in it
  77. How to print odd and even numbers sequentially using 2 threads
  78. What are the design patterns you know?
  79. What is the singleton design pattern?
  80. How will you write a design patten to maintain only two objects?
  81. What will you do to create a new object on every hit in Spring?
  82. Have you worked in Thread concepts?
  83. Brief about the last project?
  84. why are you going for Docker and open shift?
  85. Difference b/w stateful and stateless service?
  86. Explain all OOPs concepts with real-time example?
  87. What is Second level cache & first level cache?
  88. What is IOC?
  89. What is Linked HashSet and when to use?
  90. What is the purpose of the framework? 
  91. What is the time complexity of HashMap for searching? What are the algorithm and data structure used for this?
  92. If two same data tables each having 3 rows...when performed an inner join, how many records it will fetch for you
  93. If two same data tables each having 3 rows...when performed cross join, how many records it will fetch for you
  94. Are you aware of Spring batch
  95. Are you aware of PL/SQL
  96. Explain how to print odd and even numbers sequentially using 2 threads
  97. Internal working of Hashmap and it's time complexities.
  98. Singleton design pattern and how to make it synchronized
  99. Print odd-even with two threads.
  100. How to create an immutable class.
  101. Query to select all the records of employees and only the matching records of the department.
  102. Query to select the max salary for every department.


                Comments

                Popular posts from this blog

                Robotic Process Automation

                WorkFusion

                7 Rules of Success A.P.J Abdul Kalam