Java Garbage Collection

Objects dynamically created using new operator are deallocated automatically. The technique that accomplishes this is called garbage collection. It works like this: when no references to an object exist, that object is assumed to be no longer needed, and the memory occupied by the object can be reclaimed.

Continue reading


Top 10 Core Java 8+ Interview Questions – Part I

Lately, I have been thinking why shouldn't I complie set of questions that I generally include in interviews for mid-senior level Java Developers. Though I am a big fan of algorithm questions in interviews for developer, I believe including these questions either in screening or half of time in second round interview would give chance to hear about candidate's understanding on core concepts of Java 8+. I like these these questions since they include core concepts in Java that developers use in day to day jobs. 

Continue reading


Custom HashSet Implementation in Java

A hash set is a data structure offers constant time performance for the basic operations (addremovecontains and size), assuming the hash function disperses the elements properly among the buckets. There are a number of ways of implementing this data structure. This post is about the simple implementation of hashmap in Java using an array of a linked list.

Continue reading


Java HashMap Implementation in a nutshell

A hash map (or hash table) is a data structure that maps keys to values for highly efficient lookup. There are a number of ways of implementing this data structure. This post is about the simple implementation of hashmap in Java using an array of a linked list.

Continue reading