Interview Questions and Answers for 'Map' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   
 Q41. Which of the collections allows null as the key ?

a. HashTable
b. HashMap
c. TreeMap
d. LinkedHashMap
Core Java
Ans. HashMap

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   map  hashtable     Asked in 2 Companies      basic        frequent


 Q42. Effective Java 6 , TreeMap implements ...

a. Map Interface
b. SortedMap Interface
c. NavigableMap Interface
d. SortedNavigableMap Interface
Ans. SortedMap Interface

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   map


 Q43. Which of the following is a valid flow in Hadoop ?

a. Input -> Reducer -> Mapper -> Combiner -> -> Output
b. Input -> Mapper -> Reducer -> Combiner -> Output
c. Input -> Mapper -> Combiner -> Reducer -> Output
d. Input -> Reducer -> Combiner -> Mapper -> Output
Ans. Input -> Mapper -> Combiner -> Reducer -> Output

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   map reduce


 Q44. MapReduce was devised by ...

a. Apple
b. Google
c. Microsoft
d. Samsung
Ans. Google

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   map reduce


 Q45. Which of the following is not a phase of Reducer ?

a. Map
b. Reduce
c. Shuffle
d. Sort
Ans. Map

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   map reduce


 Q46. What is the input to the Reduce function ?

a. One Key and One Value
b. Multiple Keys and Multiple associated Values
c. Multiple Keys and One associated values with each
d. One key and associated values.
Ans. One key and associated values.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   bigdata   big data   map-reduce   map reduce   reduce function


 Q47. Which of the following is the implementation language for Map Reduce Framework ?

a. Big Data
b. Hadoop
c. Java
d. C++
Ans. Java

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hadoop   bigdata   big data   map-reduce   map reduce framework


Recently asked in Sophos
 Q48. Write a Method to get a map of words and their count by passing in the stringCore Java
Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=Method+to+get+a+map+of+words&category=code

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     map  collections     Asked in 2 Companies      intermediate


 Q49. What is unmodifiable set / unmodifiable map ? How can we create one ?
Ans. It is an unmodifiable / read only view of the underlying collection. We can use

Collections.unmodifiableSet(Set set)
Collections.unmodifiableMap(Map map)
Collections.unmodifiableCollection(Collection collection)

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     collections  set  unmodifiable set  map  unmodifiable map  unmodifiablemap  unmodifiableset  Collections.unmodifiableCollection  Collections.unmodifiableMap  Collections.unmodifiableSet


 Q50. What is IdentityHashMap ?Core Java
Ans. IdentityHashMap is a class that implements AbstractMap and provides a data structure with Elements having Key Value pair, just like HashMap. It is similar to HashMap except that it uses reference equality when comparing elements.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     IdentityHashMap  map  hashmap  collections


 Q51. What is the difference between filter and filter-mappings xml tag within deployment descriptor ?Java EE
Ans. filter tag speficies the filter name and respective class for handling filter action whereas filter mapping maps the filter to the url patterns ( specifying the url that needs to be intercepted )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     deployment descriptor  web.xml  filters  filter mapping


 Q52. Difference between concurrentHashMap and HashTable ?Core Java
Ans. HashTable locks the complete collection to provide synchronization whereas ConcurrentHashMap only locks segments to achieve synchronization and hence better efficient and faster.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     concurrentHashMap  HashTable  Map  Collections     Asked in 2 Companies


 Q53. isnt the use of HashTable and ConcurrentHashMap the same, i.e providing synchronized map collection ?Core Java
Ans. Yes, they both aim at providing synchronized access to the Map collection. The only difference is in their implementation. ConcurrentHashMap came after HashTable and hence technically more efficient as it doesn't lock the complete map while accessing it.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     HashTable  ConcurrentHashMap  map  Collections


 Q54. Difference between Mutex and Semaphore? Operating System
 This question was recently asked at 'Veritas'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Mutex vs Semaphore     Asked in 1 Companies


 Q55. What is the difference between CountingSemaphore and a CountDownLatch?Operating System
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     CountingSemaphore  CountDownLatch


 Q56. What is the difference between Java SE Map and Apache Commons MultiMap ? How can we implement functionality similar to multimap using Java SE map ?Core Java
Ans. We can have duplicate keys within MultiMap whereas we cannot have duplicate keys within Java Util Map.

We can have a Map with value as a "collection of values" instead of single value to have a similar function as Multimap.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Apache commons multimap  map vs multimap


 Q57. If a Map needs to be accessed simultaneously by multiple threads, which collection class should be used ? Core Java
Ans. ConcurrentHashMap

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     map  concurrenthashmap  multithreading


 Q58. Create a custom hashmap using synchronization.Core Java
 This question was recently asked at 'Deutsche Bank'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hashmap  coding     Asked in 1 Companies      advanced


 Q59. What is the difference between TreeSet and TreeMap ?Core Java
Ans. TreeSet contains only values as elements whereas TreeMap contains Key value pairs.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     reeMap  TreeSet  Collections  sorted collection     Asked in 1 Companies        rare


 Q60. How to sort objects based on one of the field ?Core Java
Ans. Using comparable and comparator and sorted collections like TreeSet or TreeMap.

or

use stream api from java 8 onwards which internally refers to comparable and comparator through lambda expressions

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sort  sorting  comprator  comparable  treeset  treemap  sorting collections     Asked in 1 Companies      Basic        frequent


 Q61. Isnt the use of HashTable and ConcurrentHashMap the same, i.e providing synchronized map collection ?Core Java
Ans. Both provide the thread safety but the actual difference come when talk about performance. CHM gives best performance when no of writer threads are less in number.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     synchronized collections  hashtable  ConcurrentHashMap     Asked in 1 Companies


 Q62. How many read and write operations are provided at the same time by ConcurrentHashMaps ?Core Java
Ans. ConcurrentHashMaps provide unlimited read operation fro multi threaded environment. For write operation only one thread can change value for particular segment of map.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ConcurrentHashMap     Asked in 1 Companies


 Q63. Explain different inheritance mapping strategies with JPA / Hibernate.Hibernate
Ans. table per hierarchy
table per concrete class
table per sub class

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate mapping  hibernate associations     Asked in 4 Companies


 Q64. Is HashMap Synchronized ?Core Java
Ans. No HashMap isn't synchronized. ConcurrentHashMap and Hashtable are synchronized.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hashmap  synchronization


 Q65. Is ConcurrentHashMap synchronized ?Core Java
Ans. Yes, ConcurrentHashMap is synchronized.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ConcurrentHashMap


 Q66. Difference between TreeMap and SortedMap ?Core Java
Ans. sortedMap is an interface ,while TreeMap is an implementation of sortMap.

We can not create an instance of sortedMap but we can create an instance of treeMap

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     treemap  sortedmap


 Q67. Difference between HashMap and Dictionary in Java ?Core Java
Ans. HashMap implements the Map interface while the Dictionary does not.

HashMap was introduced after HashTable and Dictionary.

Dictionary is currently obsolete in java.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hashmap  dictionary class


 Q68. Which of the following collections stores its elements in natural sorting order ?Core Java
a. HashMap
b. LinkedHashMap
c. TreeMap
d. EnumMap

Ans.c. TreeMap

 Q69. Semaphores are used to solve problem of ... Operating system
a. Race Condition
b. Process Synchronization
c. Mutual Exclusion
d. All of above

Ans.d. All of above

previous 30   

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: