Java Software Engineer Interview Questions

3,072 java software engineer interview questions shared by candidates

1. I have a java program in which there are a lot of HashMap/HashTable being used for mapping key-value pairs. Now I want to profile or rather count how many times the get() and put() methods have been called in my program. 2. Given a stream of integers and asked to store N uniques numbers performing insert, search, retrieve in O(1) complexity. If the maximum space reached remove the old data and insert the new data. Perform the above using a data structure. 3. Given a number N. write a program to find the number of prime numbers in the range of 1 to N.
avatar

Java Software Engineer Test

Interviewed at Coupang

3.2
Aug 26, 2016

1. I have a java program in which there are a lot of HashMap/HashTable being used for mapping key-value pairs. Now I want to profile or rather count how many times the get() and put() methods have been called in my program. 2. Given a stream of integers and asked to store N uniques numbers performing insert, search, retrieve in O(1) complexity. If the maximum space reached remove the old data and insert the new data. Perform the above using a data structure. 3. Given a number N. write a program to find the number of prime numbers in the range of 1 to N.

1. so let's say for a use case you need to pick up a list implementation and you have to pick between arraylist and link list which one you will pick and why 2. if we have to insert at the head or the tail then i would accept that okay that link list will be faster because you just have to switch the pointers but if you want to insert let’s say in the middle how many operations you would need in link list versus in array list for in the middle 3. in array list we have to shift the elements so you think the shifting of the elements will happen one by one like one element at it 4. can you explain to me how hashmaps work 5. and the worst case what will be the complexity 6. let’s say we have to use employee class object as a key in the map what we have to take care of 7. are the fields in the employee class mutable or should they be immutable 8. is the hashmap thread safe 9. what alternatives do we have we can use synchronized map we can use concurrent collections in which we have a concurrent hashmap as well 10. so synchronized map versus concurrent hashmap what was the difference 11. in a concurrent hashmap at a given point at the same time let’s say how many threads can do a put operation 12. what is the volatile keyword .
avatar

Java Software Engineer

Interviewed at 360T Trading Networks

3.4
Dec 30, 2025

1. so let's say for a use case you need to pick up a list implementation and you have to pick between arraylist and link list which one you will pick and why 2. if we have to insert at the head or the tail then i would accept that okay that link list will be faster because you just have to switch the pointers but if you want to insert let’s say in the middle how many operations you would need in link list versus in array list for in the middle 3. in array list we have to shift the elements so you think the shifting of the elements will happen one by one like one element at it 4. can you explain to me how hashmaps work 5. and the worst case what will be the complexity 6. let’s say we have to use employee class object as a key in the map what we have to take care of 7. are the fields in the employee class mutable or should they be immutable 8. is the hashmap thread safe 9. what alternatives do we have we can use synchronized map we can use concurrent collections in which we have a concurrent hashmap as well 10. so synchronized map versus concurrent hashmap what was the difference 11. in a concurrent hashmap at a given point at the same time let’s say how many threads can do a put operation 12. what is the volatile keyword .

Viewing 2321 - 2330 interview questions

Glassdoor has 3,072 interview questions and reports from Java software engineer interviews. Prepare for your interview. Get hired. Love your job.