Hazelcast is an open-source, in-memory data grid based on Java. It is a real-time stream processing platform, by using this you can build applications that take action on data immediately.
Hazelcast MCQs
Hazelcast MCQs: This section contains multiple-choice questions and answers on the various topics of Hazelcast. Practice these MCQs to test and enhance your skills on Hazelcast.
List of Hazelcast Multiple-choice Questions and Answers
1. What is Hazelcast?
- A ORM tool
- A centralized computing platform
- An in-memory data grid
- All of the above
Answer: C) An in-memory data grid
Explanation:
Hazelcast is an in-memory data grid.
2. Is Hazelcast open-source?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, Hazelcast is open-source.
3. Which of the following is true about Hazelcast?
- Hazelcast is a centralized cache.
- Hazelcast is a distributed cache.
- Both
- None
Answer: B) Hazelcast is a distributed cache.
Explanation:
Statement B is correct, Hazelcast is a distributed cache.
4. Hazelcast can be only run in a single node?
- True
- False
Answer: B) False
Explanation:
Hazelcast can be operated in isolation (as a single node) or in cluster mode (as numerous nodes).
5. Which of the following configuration does Hazelcast supports?
- Programmatic Configuration
- XML-based Configuration
- Both
- None
Answer: C) Both
Explanation:
Hazelcast offers both programmatic and XML-based configurations.
6. Hazelcast by default uses JDK-based logging because ____?
- To improve caching
- To improve security
- To avoid dependencies
- All of the above
Answer: C) To avoid dependencies
Explanation:
To eliminate dependencies, Hazelcast employs JDK-based logging by default.
7. In Hazelcast, which of the following data types is a distributed data structure that may hold many values for a single key?
- RingBuffer
- ReplicatedMap
- List
- MultiMap
Answer: D) MultiMap
Explanation:
In Hazelcast, Multimap data types are a distributed data structure that may hold many values for a single key.
8. In terms of partitioning methods, Hazelcast has how many different sorts of distributed objects?
- 2
- 3
- 4
- 5
Answer: A) 2
Explanation:
In terms of partitioning strategies, Hazelcast has two sorts of distributed objects:
- Partitioned Data structure
- Non-partitioned Data structure
9. What are partitioned data structures?
- Partitioned data structures are data structures in which each partition holds a portion of the instance.
- Partitioned data structures are those in which a single partition stores the whole instance.
Answer: A) Partitioned data structures are data structures in which each partition holds a portion of the instance.
Explanation:
Partitioned data structures are data structures in which each partition holds a portion of the instance.
10. Map, Multimap, and Cache come under which type of data structures?
- Partitioned Data structures
- Non-partitioned Data structures
Answer: A) Partitioned Data structures
Explanation:
The following are the partitioned Hazelcast data structures:
- Map
- MultiMap
- Cache (Hazelcast JCache implementation)
- Event Journal
11. What are non-partitioned data structures?
- Non-Partitioned data structures are data structures in which each partition holds a portion of the instance.
- Non-Partitioned data structures are those in which a single partition stores the whole instance.
Answer: B) Non-Partitioned data structures are those in which a single partition stores the whole instance.
Explanation:
Non-partitioned data structures are those in which a single partition stores the whole instance.
12. Queue, set, list comes under which type of data structures?
- Partitioned Data structures
- Non-partitioned Data structures
Answer: B) Non-partitioned Data structures
Explanation:
The following are the Non-partitioned Hazelcast data structures:
- Queue
- Set
- List
- Ringbuffer
- FencedLock
- ISemaphore
- IAtomicLong
- IAtomicReference
- FlakeIdGenerator
- ICountdownLatch
- Cardinality Estimator
- PN Counter
13. You can use which of the following method to destroy a Hazelcast distributed object?
- End
- Finish
- Delete
- Destroy
Answer: D) Destroy
Explanation:
You can use the destroy method to destroy a Hazelcast distributed object.
14. To obtain the map, which method is employed?
- Get
- getMap
- obtainMap
- obtain
Answer: B) getMap
Explanation:
To obtain the map, use the getMap function.
15. By default, distributed maps have how many backups?
- One
- Two
- Many
- Zero
Answer: A) One
Explanation:
By default, distributed maps have one backup.
16. How many types of backups are supported by Hazelcast?
- 4
- 5
- 3
- 2
Answer: D) 2
Explanation:
The two types of backups are: sync and async and both synchronous and asynchronous backups are supported by Hazelcast.
17. By default, backup operations are ____.
- Synchronous
- Asynchronous
Answer: A) Synchronous
Explanation:
By default, backup operations are synchronous.
18. Which of the following backup do not block operations?
- Synchronous
- Asynchronous
Answer: B) Asynchronous
Explanation:
Sync backup operations have a blocking penalty, which may result in latency concerns, whereas Asynchronous backup operations do not.
19. Do backups increase memory usage?
- Yes
- No
Answer: A) Yes
Explanation:
Backups increase memory use since they are also retained in memory.
20. A map can have which of the following backup?
- Sync
- Async
- Both
- None
Answer: C) Both
Explanation:
At the same time, a map can have both sync and async backups.
21. Does the Hazelcast map has any restrictions on size?
- Yes
- No
Answer: B) No
Explanation:
By default, Hazelcast maps have no size constraints and can grow indefinitely big.
22. ____ restricts the maximum lifespan of an entry saved inside the map?
- Expiration
- Eviction
Answer: A) Expiration
Explanation:
Expiration restricts the maximum lifespan of an entry saved inside the map.
23. The maximum size of the map is limited by ____.
- Expiration
- Eviction
Answer: B) Eviction
Explanation:
The maximum size of the map is limited by eviction.
24. You can eliminate all map entries that match your condition, with the help of which of the following method?
- Erase_all ()
- Delete_all ()
- Delete ()
- RemoveAll()
Answer: D) RemoveAll()
Explanation:
You can eliminate all map entries that match your condition, with the help of the removeAll() method.
25. Which of the following method will get you the statistics of maps in your Hazelcast?
- getLocalMapStats()
- getMapStats()
- getLocalMapStatstics()
Answer: A) getLocalMapStats()
Explanation:
the getLocalMapStats() method will get you the statistics of maps in your Hazelcast.
26. You can add an item to one cluster member and delete it from another by using the ____.
- RingBuffer
- ReplicatedMap
- Queue
- MultiMap
Answer: C) Queue
Explanation:
You can add an item to one cluster member and delete it from another by using the Hazelcast distributed queue.
27. A ____ queue is one that has a finite capacity.
- Restricted
- Bounded
- Priority
Answer: B) Bounded
Explanation:
A bounded queue is one that has a finite capacity.
28. Hazelcast saves queue entries in ____ form by default?
- Serialised
- De serialised
Answer: A) Serialised
Explanation:
Hazelcast saves queue entries in serialised form by default.
29. To add items to the Hazelcast list, which of the following methods is used?
- Insert
- Put
- Add
Answer: C) Add
Explanation:
To add items to the Hazelcast list, add methods is used.
30. Hazelcast List is a ____ data structure?
- Non-partitioned
- Partitioned
Answer: A) Non-partitioned
Explanation:
The Hazelcast List is a non-partitioned data structure in which each value and backup is represented by its unique partition.
31. Are duplicate elements permitted in Hazelcast Set?
- Yes
- No
Answer: B) No
Explanation:
No, Duplicate elements are not permitted in Hazelcast Set.
32. A ____ queue is a standard blocking queue that uses a comparator to arrange entries.
- Restricted
- Bounded
- Priority
Answer: C) Priority
Explanation:
A priority queue is a standard blocking queue that uses a comparator to arrange entries.
33. The ____ of the Hazelcast RingBuffer data structure is where things are inserted.
- Tail
- Head
Answer: A) Tail
Explanation:
The tail of the Hazelcast RingBuffer data structure is where things are inserted.
34. The ____ of the Hazelcast RingBuffer data structure is where objects are overwritten or expired.
- Tail
- Head
Answer: B) Head
Explanation:
The head of the Hazelcast RingBuffer data structure is where objects are overwritten or expired.
35. You can insert an item in RingBuffer using which of the following method?
- Insert
- Put
- Enter
- Add
Answer: D) Add
Explanation:
You can insert an item in RingBuffer using the add method.
36. A RingBuffer is configured with a capacity of ____ items by default.
- 50,000
- 10,000
- 1,00,000
- 5000
Answer: B) 10,000
Explanation:
A RingBuffer is configured with a capacity of 10000 items by default.
37. By default, Hazelcast RingBuffer has a single ____ backup.
- Synchronous
- Asynchronous
Answer: A) Synchronous
Explanation:
By default, Hazelcast RingBuffer has a single synchronous backup.
38. Does Hazelcast support GROUPBY SQL command?
- Yes
- No
Answer: B) No
Explanation:
No, Hazelcast does not support the GROUPBY SQL command.
39. Does Hazelcast support set operations like union, intersect, and minus?
- Yes
- No
Answer: B) No
Explanation:
No, Hazelcast does not support set operations like union, intersect, and minus.
40. Does Hazelcast support Logical predicates?
- Yes
- No
Answer: A) Yes
Explanation:
Logical predicates (such as and, or, not, Is) are supported by Hazelcast SQL.
41. Does Hazelcast support JMX monitoring?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, Hazelcast supports JMX monitoring.
42. Does Hazelcast client are responsible to store data or have ownership to store data?
- Yes
- No
Answer: B) No
Explanation:
Hazelcast clients are only used to access data held by the cluster’s Hazelcast members. They are not in charge of storing data and do not claim ownership of it.
43. The default load balancing mechanism of Hazelcast clients is set to ____.
- IP hash
- Weighted Round robin
- Round Robin
Answer: C) Round Robin
Explanation:
The default load balancing mechanism is set to round-robin.
44. How many types of Transactions are supported by Hazelcast?
- 2
- 3
- 4
- 5
Answer: A) 2
Explanation:
Hazelcast support two types of transactions: One_phase and Two_phase.
45. The default transaction in Hazelcast is set to ____.
- One_phase
- Two_phase.
Answer: B) Two_phase.
Explanation:
The default transaction in Hazelcast is set to Two_phase.
46. If you want better performance which of the following transaction type you should use?
- One_phase
- Two_phase
Answer: A) One_phase
Explanation:
It is advised that you use ONE PHASE as the transaction type if you desire greater performance, and TWO PHASE if system dependability is more essential than performance.
47. In which of the following transaction type the commit log is recorded locally, but it is transferred to another cluster member?
- One_phase
- Two_phase
Answer: B) Two_phase
Explanation:
In the two_phase transaction type the commit log is recorded locally, but it is transferred to another cluster member.
48. Hazelcast Jcache provides how many methods for cache configuration?
- 5
- 4
- 3
- 2
Answer: D) 2
Explanation:
Hazelcast JCache provides two different methods for cache configuration:
- declaratively: using hazelcast.xml/yaml or hazelcast-client.xml/yaml
- programmatically: the typical Hazelcast way, using the Config API
49. Hazelcast provides how many types of providers?
- 5
- 4
- 3
- 2
Answer: D) 2
Explanation:
Hazelcast has two types of providers: Client providers and member providers.
50. Which of the following provisions is used by cluster members in Hazelcast?
- Client provider
- member provider
Answer: B) member provider
Explanation:
Client Provider (for Hazelcast clients) and Member Provider (used by cluster members).
51. Hazelcast JCache provide which of the following eviction policy?
- LRU
- LFU
- Both
Answer: C) Both
Explanation:
Hazelcast JCache has two well-known eviction policies: LRU and LFU.
52. Which of the following is the default eviction policy?
- LRU
- LFU
- Both
Answer: A) LRU
Explanation:
The default eviction policy is LRU.
53. Hazelcast support how many types of allocation strategies?
- 5
- 4
- 3
- 2
Answer: D) 2
Explanation:
Hazelcast supports two allocation strategies:
- Round-robin allocation strategy
- NUMA-aware allocation strategy
54. Which of the following is the default allocation strategy?
- Round-robin allocation strategy
- NUMA-aware allocation strategy
Answer: A) Round-robin allocation strategy
Explanation:
The round-robin allocation strategy is the default allocation strategy in Hazelcast.
55. “____” implies that the cluster will be started even if not all members are present or accessible.
- Partial start
- Force start
- Full start
Answer: B) Force start
Explanation:
“Force start” implies that the cluster will be started even if not all members are present or accessible.
56. A ____ is a Hazelcast client that connects to a Hazelcast cluster using a known set of cluster members’ addresses.
- Unisocket client
- Clear client
- Smart client
Answer: C) Smart client
Explanation:
A smart client is a Hazelcast client that connects to a Hazelcast cluster using a known set of cluster members’ addresses.
57. A Hazelcast client that connects to a single member of a Hazelcast cluster is known as a ____ client.
- Unisocket client
- Clear client
- Smart client
Answer: A) Unisocket client
Explanation:
A Hazelcast client that connects to a single member of a Hazelcast cluster is known as a unisocket client.
58. Partial start means that the cluster starts with an incomplete member set.
- True
- False
Answer: A) True
Explanation:
True, Partial start means that the cluster starts with an incomplete member set.
59. Which of the following is the default serialization in Hazelcast?
- Java Serialization
- Hazelcast Portable Serialization
- Hazelcast JSON Serialization
- Custom Serializers
Answer: A) Java Serialization
Explanation:
Java Serialization is the default serialization in Hazelcast.
60. What is OSGI?
- Object service gateway initiated
- Open service gateway initiative
- Object source gateway initialized
Answer: B) Open service gateway initiative
Explanation:
OSGI stands for open-service gateway initiative.