Sign in

Tech Content Creator on DS, Algo, Java, SQL, Linux, Git, etc | Get Unlimited Access to my articles - https://vikramguptavit.medium.com/membership

Get prepared for multi-threading interview questions.

Deadlock on a single lock

Understanding multithreading in any language is a bit tough as it involves many other concepts like thread-stack, heap, locking, synchronization, etc. Earlier I have tried and attempted to simplify the multithreading concepts with multiple articles.

If you haven't gone through those articles, here is one article to start with.

Multi-Threaded Application:

Now…


Know your next interview question.

HashMap with Singly Linked List

I have seen a lot of interviewers asking for the internal working mechanism of the hashmap. If you know the complete internal working of one of the map implementations, it becomes easier for you to understand the other classes of the map interface.

So thru this article, we’ll see how…


Java synchronization guide for your next interview…

Photo by Max Duzij on Unsplash

Through this article we are going to discuss atomic variables in java, why and where are they used, and how synchronized, volatile and atomic are different. Okay, okay don’t get confused, I’ve already covered synchronization and volatile in detail.

But before going ahead, you should know Race Condition, Critical Section…


Don’t misuse synchronized and volatile in your application.

Cache Coherence

I have seen many developers a bit confused when it comes to multi-threading. This is primarily because a lot of things happen in the background and many concepts are related to it. You should know Race Condition, Critical section, and Context Switching between threads. …


A complete guide for understanding TreeMap and its internal working.

The red black tree that is internally used for TreeMap

Learning Java is fun when you understand the internal working mechanism of the classes that you use to write your applications. One of the core classes that I have already covered is HashMap. …


Add remote repository, change remote repository and delete the branch.

Git command flow

I have been using Git since the early days of my professional career. I still find myself searching for some git commands that I use to forget. If you are having a similar experience to me then this article is for you. I keep this and similar articles on Git…


Know your next java interview question.

Most Frequently asked java multithreading interview questions.

Photo by Nico Nazaire on Unsplash

Multithreading is one of the core concepts in any programming language. Understanding concurrency and threading take some time and prepare yourself in a way to clear your multithreading interviews. …


A behavioral design pattern for Flexible Notification-Registration Interaction.

Observer design pattern architecture

In this article, we will see what is the intent of the Observer design pattern, what problems it solves, and its applicability.

Before we move to the technicality of this topic, let me give one of the most basic use cases of this design pattern. We mostly tend to subscribe…


A better way to handle synchronization than synchronized keyword.

Producer and Consumer image/author

We have already learned how to synchronize a shared resource using a synchronized keyword. Now in this article, we’ll see a better way to synchronize shared resource using ReentrantLock.

For synchronization using the synchronized keyword, you may refer to this article: Synchronization in Java: All You Need to Know

Problems With Synchronized Keyword:

  • A…


Clear deadlock concept with an example.

This article is all about Deadlock, we’ll see a deadlock program and will find an approach to overcome the deadlock condition.

What Is a Deadlock?

Deadlock occurs when multiple threads need the same locks but obtain these locks in a different order. A Java multithreaded program may suffer from the deadlock condition because the…

Vikram Gupta

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store