Skip to main content

Posts

Java & Spring Interview Questions: What Really Happens Under the Hood

  Java & Spring Interview Questions: What Really Happens Under the Hood There is a phase in every developer's career where you can use something without actually understanding what is happening underneath. You know how to use ConcurrentHashMap . You know what @Transactional does. You know that Spring injects dependencies. You know @SpringBootApplication starts your application. And then the interviewer asks: "Okay, but what actually happens internally?" Suddenly, knowing the syntax isn't enough. That is exactly what this blog is about. I'm going to break down some of the Java and Spring concepts that are frequently asked in interviews, but more importantly, I'll try to understand why they work the way they do . Let's start with one of my favourites. 1. ConcurrentHashMap in Java 8: What Actually Happens? Let's first establish the problem. A normal HashMap is not thread-safe. Imagine two threads doing this at the same time: map.put("A",...
Recent posts

Think You Know Java? These 5 Questions Say Otherwise

  Hello everyone! Hope you’re sipping your coffee just right—because I’ve brewed something equally strong for your brain. Welcome to a blog that dives into 5 deceptively tricky Java interview questions —the kind that test not just what you know, but how well you understand Java under the hood. If you, like me, share a love-hate relationship with this language, this blog might just hit home. So, let's get started... Question 1: What will be the output of the following code? Why? class Parent { static void staticMethod() { System.out.println("Static method in Parent"); } private void privateMethod() { System.out.println("Private method in Parent"); } void show() { staticMethod(); privateMethod(); } } class Child extends Parent { static void staticMethod() { System.out.println("Static method in Child"); } private void privateMethod() { System.out.println("Pr...

Some Useful and Simple Cmd commands everybody must know

  What gives you a feeling of power? -- Using your computer through a command shell! Throughout my journey as a Tech-Enthusiast, it has been a thing to know and work on the cmd shell on my windows device. Here I'm going to share some crazy, simple, and useful commands which you must know as a Techie and here we go... Know your saved Wi-Fi password using Netsh   If you have ever found stuck in a situation where you are unable to extract a password already saved on your device? Well here is your savior the netsh command, here is how can you use it: Start your command prompt by typing cmd in the search. Type "netsh wlan show profile" (This command will give you the list of all the profiles associated). Now you need to type "netsh wlan show profile "profile_name" key =clear ". And now the key content displays the password of your selected wlan profile. Run this command on your friends' devices and let them look at you with that awestruck gaze!   Change...

"Aggregation of Marginal Gains" strategy that blew my mind

 Did you miss me? Wait; you don't even know me? Craaapp! Hello Dotson this is me Saurabh Aggarwal and I'm back here (once again) to have a little chitchat with you and share something valuable to add to your life. Before you start judging me that yeh kya naya batayega  let me tell you that the idea I'm sharing with you, is not new and you might already know  about it but here's my perspective to add which is quite novel (quite..) So the thing is I was currently reading a book (ofcourse not my syllabus book) and this book  stated a "magical strategy" which could help anyone become the best version of oneself. To be honest i have heard a lot about the thing like becoming the best version of oneself and blah blah. So, at first  neurons of my brain decided not to pay much attention to this specific section  but what suddenly caught my eyes were the stats of the Olympics that a team of British cyclists which could only grab a single gold medal b...

Why is it important to have "WHY"?

Hey Mitra, did you smile today? If not then, let me give you a reason to: You are the chosen one to live this beautiful life, once and for all! Ahh, hope that worked, Let's start our talk. Why?  An illustration  If I go on telling you that "Why" is such a magnificent word which can turn the "impossible" into "I'm possible". Would you believe me? Maybe not, so let me illustrate to you a scenario to keep my point in a  clear manner.  Imagine yourself sitting on your couch, watching Taarak Mehta Ka Ooltah Chashmah and you suddenly start to crave for your favourite samosa as the Zomato ad pops us in the break. You just think of going to  Ratan's Samosa Shop which is just 100m away from your home.  But it's raining heavily outside. Would you step outside and get some samosas or continue watching TV (cursing Zomato )? When asked to a group of students, 97% of them agreed to stay at home while the remaining were hardcore samosa lovers. Now imagine...

An Ironic Task

 Hey Mitra! How did your day go? Mine was quite shocking. Why? Let's start our talk... An Ironic Task While me and my sister were trying to write a script, suddenly the idea of writing it in Hindi struck our minds and why not, after all, it's our mother tongue, right?  My sister started to speak while I jotted it down. She spoke efficiently; I interrupted and told her that the language she was speaking in, wasn't Hindi but Hinglish actually, as she still used some words from English. So now the task was to speak in Hindi entirely for 5 min and astonishingly she couldn't complete 2 min. The table turned down to me and I failed at this task terribly as well. How many minutes can you speak entirely in Hindi as a native speaker? Languages Family Tree I had been shaken by what had just happened, the language to which we proudly proclaimed to be our mother language was slipping from our tongues! We had forgotten the meaning of certain words as well. Hindi, without which it wa...

Are we happy enough?

 Hey Mitra! how's everything? What was that hilarious thing that made you laugh absurdly today? Who was the person who filled your day with all the love in the world just by a small act of kindness? Let me reverse the question how many lives did you fill with positivity or humbleness today ? If the answer is none, then this blog may have something to add  to your life. Let me share with you an interesting event that just took place. Two children were playing a game which they called "How many". Rules were simple, one had to ask the questions by adding "how many" like, " how many planets are there in our solar system ?" Another had to answer. The game was quite interesting  and suddenly a question appeared "how many muscles does it take to smile?" The child seeking the answer smiled curiously and tried to locate all the muscles involved in smiling right then at the moment and his friend helped him too in a manner like," ohh look, there...