Open close design principle – SOLID & real time examples
What is Open close software design principle? Benjamin disraeli said ‘Change is inevitable, Change is constant’. Change is constant in […]
What is Open close software design principle? Benjamin disraeli said ‘Change is inevitable, Change is constant’. Change is constant in […]
Create a user defined exception in java. Create a custom exception, by extending unchecked exceptions. We will create CustomArithmeticException by extending
Given a message, We would like to encrypt & decrypt plain/cipher text using AES CBC algorithm in java. We will
Given a java application, We would like to read the property file defined in HOCON (Human-Optimized Config Object Notation.) or
What we will have in this post ? We will create a maven project and add apache shade plug-in. Create runnable
Logical Question/ Puzzle: Five pirates & 100 gold coins in a ship Five pirates say P1 to P5 (youngest to
1. Problem Statement or Puzzle: Farmer standing on the bank of river and want to cross the river. Boat has
25 horses, 5 tracks & 3 fastest horses puzzle Given 25 horses and a racing track. 5 horses can run simultaneously
Four person crossing collapsing bridge & torch puzzle: Four persons wants to cross a bridge at night. There is one
Question: box of defective balls puzzle or logical interview question You are given 10 boxes containing balls. The 9 boxes
Ants on equilateral triangle puzzle: Three ants are sitting on the corners of equilateral triangle. Ants can pick any direction
Lady, shopKeeper & 1000$ fake note puzzle Shopkeeper A is selling the goods at no profit no loss (zero profit).
GoldBar work payment logical interview question or puzzle: Given a gold bar that will be used to make a payment to a worker for seven days.
Elements in TreeSet are ordered using natural order or Comparator/Comparable interface. In case of user defined objects or POJO, POJO needs
What is TreeSet? TreeSet is a NavigableSet implementation based on a TreeMap. Elements in TreeSet are ordered using natural order
1. What is TreeSet colletion in java ? Elements in TreeSet are ordered using natural order or Comparator provided. e.g.
Hashtable and linked list implementation of the Set interface, with predictable iteration order. LinkedHashSet maintains the Insertion order of elements
LinkedHashSet is Hashtable & linked list implementation of the Set interface, with predictable iteration order. LinkedHashSet maintains the Insertion order
Iterate or loop through the LinkedHashSet collection of string objects using iterator & foreach java 8 lambda streams (example)
LinkedHashSet is Hashtable & linked list implementation of the Set interface, with predictable iteration order. LinkedHashSet maintains the Insertion order
Hashtable and linked list implementation of the Set interface, with predictable iteration order. LinkedHashSet maintains the Insertion order of elements
HashSet class implements the Set interface, backed by a hash table. HashSet contains the unique elements. HashSet does not contains
Given a HashSet containing String objects in java. HashSet will be containing Sport’s name. Convert HashSet <String> to ArrayList<String> in
HashSet class implements the Set interface, backed by a hash table. HashSet contains the unique elements. HashSet does not contains
What is HashSet in java? HashSet class implements the Set interface, backed by a hash table. HashSet contains the unique
1. What is HashSet collection in java? HashSet class implements the Set interface, backed by a hash table. HashSet contains
Given an EnumMap containing key value pairs in java. EnumMap is specialized Map implementation, to use enum as key(s). Enum
1. What is TreeMap collection in java? Given a TreeMap collection containing key value pairs. TreeeMap is Red-Black tree based
LRU is one of the most popular caching algorithm. The items, which are least recently used are removed from the
LinkedHashMap have following attributes: LinkedHashMap is Hashtable and LinkedList based implementation of Map interface. By default LinkedHashMap maintains the insertion order (i.e.