Java developer writing about system design, scalability, AKS, AI, real-world code mistakes.

Joined January 2026
40 Photos and videos
Pinned Tweet
Hello, I share real scenarios I deal with as a backend engineer. Mostly around: • Java • System Design • AKS / Cloud • Production edge cases Lately I post question-based scenarios, the kind interviewers ask and the kind that actually break in production. If you enjoy solving these, consider following. New questions every day.
1
9
907
AI is changing things so fast that sometimes it genuinely feels unreal. There was a time when making notes was an actual task. Watching a 2-hour YouTube tutorial meant sitting with a notebook for 4 hours. Pause the video. Write everything down. Rewind because you missed a point. Take screenshots. Highlight important timestamps. Now I just paste the YouTube link into NotebookLM and within a minute it gives me proper notes, summaries, key points, FAQs, even a podcast-style discussion from the same content. What’s crazy is not just the tool itself. It’s how normal all this is starting to feel.Things that genuinely took hours of effort now happen in minutes. Feels like AI is quietly changing the way humans learn, work, study, research… everything. #AI #notebookllm #notes
2
48
Raw types in Java skip type safety-> Bugs show up at runtime. #Java #Programming #Coding #JavaTips #BestPractices #Developers #SoftwareEngineering
5
110
Arrays in Java: the most basic DS, but still powerful public int sum(int[] nums) { int total = 0; for (int num : nums) { total = num; } return total; } Why beginners should care: Arrays teach you the core habit. Traverse data, process each element Everything builds on this: • Prefix sums • Sliding window • Dynamic programming Real insight: If you can’t solve problems with arrays, you won’t solve them with complex DS either. Start simple. Go deep. #Java #DataStructures #DSA #Beginners #Coding
1
2
84
Ever wondered what actually happens when you sort a Map in Java? (Like map.entrySet().stream().sorted(...)) Here’s what’s actually going on behind the scenes. 1) Java first pulls all the entries into a list/array 2) Then it scans to find small chunks that are already sorted 3) If a chunk isn’t sorted, it fixes it using Insertion Sort 4) Then it merges these chunks step by step 5) Until everything becomes one fully sorted result That whole process is powered by TimSort (for objects like Map.Entry). For primitives (int[], double[]), Java switches to a different approach (Dual-Pivot QuickSort). #Java #Algorithms #Programming #SoftwareEngineering
3
3
107
Small bonus detail. TimSort doesn’t just randomly pick chunk sizes. 1) It uses something called a “minRun” usually between 32–64 elements. 2) If a chunk is smaller than that, it extends it and then fixes it using Insertion Sort. Why this matters: • Keeps chunks big enough for efficient merging • Avoids too many tiny pieces which would slow things down Also during merging, TimSort uses a trick called “galloping mode”. If one chunk starts winning repeatedly while merging, it speeds things up by skipping comparisons. So internally it’s constantly adapting based on the data. That’s why TimSort isn’t just a mix of algorithms. It’s data-aware while running.
3
73
Nidhi Tiwari retweeted
Struggling with Time Complexity of nested loops? Here’s a quick mental model. 1) Inner independent of outer? -> YES -> Multiply for (int i = 0; i < n; i ) { for (int j = 0; j < n; j ) { } } Time complexity: O(n × n) = O(n²) 2) Inner depends on outer? ->YES ->Summation for (int i = 1; i <= n; i ) { for (int j = 1; j <= i; j ) { } } Time complexity: Summation-> eg: O(1 2 ... n) 3) Extra checks: Outer shrinks (i = i/2)? a) Inner uses i: for (int i = n; i > 0; i = i / 2) { for (int j = 0; j < i; j ) { } } Time complexity: O(n) b) Inner uses n: for (int i = n; i > 0; i = i / 2) { for (int j = 0; j < n; j ) { } } Time complexity: O(n log n) Follow for more such daily content. #Java #TechTwitter #DSA #SoftwareEngineering
1
2
220
This will run the first forEach and print 1 2 3. But on the second forEach, it will crash at runtime. That’s because a Java Stream can be used only once after it’s consumed, it’s closed. So trying to use it again gives an error like stream has already been operated upon or closed.
What happens here? Will this work twice? Or crash? what will be the output? #Java #TechTwitter
3
120
This will not compile. In a switch, you can’t have the same case value twice. Here, case 1 is written two times, which confuses the compiler because it won’t know which one to pick. So Java throws a compile-time error saying it’s a duplicate case.
What happens here? Compile or error? Follow for more such content daily. #Java #TechTwitter
4
98
What happens here? Compile or error? Follow for more such content daily. #Java #TechTwitter
3
257
What happens here? Will this work twice? Or crash? what will be the output? #Java #TechTwitter
2
3
286
Nidhi Tiwari retweeted
Many developers think these are the same: Arrays.asList("A","B","C") List.of("A","B","C") I added a small code example in the image. What will the output be? Will it work or throw an exception? Drop your answer below. Follow for more daily Java concepts. #Java #TechTwitter
2
1
6
346
Assume this implementation is used by ~100 concurrent threads. Would you consider it safe for production use? If not, what specific issues would you expect to see? #Java #Concurrency #SystemDesign
1
3
164
Nidhi Tiwari retweeted
Java 26 just dropped and it’s LOADED! HTTP/3, Faster JVM, Primitive Patterns & finally… Applets are DEAD. 1. Primitive Types in Patterns No more boxing/unboxing headaches use primitives directly in switch switch (age) { case int i when i < 18 -> "Minor"; case int i when i < 60 -> "Adult"; default -> "Senior"; } 2. HTTP/3 Support Native HTTP/3 support ,no external libraries needed. HttpClient client = HttpClient.newBuilder() .version(HttpClient.Version.HTTP_3) .build(); 3. Lazy Constants Initialize only when needed, better performance. static final lazy String CONFIG = loadConfig(); 4. Structured Concurrency Cleaner, safer parallel execution try (var scope = new StructuredTaskScope.ShutdownOnFailure()) { var user = scope.fork(() -> fetchUser(id)); var order = scope.fork(() -> fetchOrder(id)); scope.join().throwIfFailed(); return new Response(user.get(), order.get()); } 5. Goodbye Applets This won’t even compile now: class MyApplet extends Applet {} RIP: 1995 → 2026 Follow for more such daily Java content. #Java26 #JDK26 #JavaDeveloper #Programming #Tech
1
1
11
397
Nidhi Tiwari retweeted
Java just made it official: Applets are DEAD in Java 26 Remember college days? Writing your first <applet> tag, drawing circles, rectangles, and smiley faces using Graphics, making that bouncing ball animation (that never bounced smoothly), building a basic calculator UI, changing background colors on button click. It felt like magic back then, “Java can run inside a browser?!” And then, Waiting forever for it to load, clicking “Allow / Run” on scary security popups, debugging why nothing is showing on screen. Good times. But slowly, Browsers dropped support, Security issues piled up, Better technologies took over. And now in Java 26, Applets are gone for good. Not just a removal, it’s pure nostalgia. From: College applet programs to Desktop apps to Spring Boot & microservices Java evolved. And so did we. If you ever made a bouncing ball or drew a smiley using Applet, you’re not old, you’re OG Java dev! #Java #Java26 #Nostalgia #TechTwitter
1
3
188
What will this code print? (Check the image 👇) A. Animal sound Dog runs B. Dog barks Dog runs C. Dog barks D. Compilation Error Drop your answer below. Follow for more daily Java concepts. #Java #TechTwitter #Coding
3
278
The correct answer is D) All of the above. Java Records were introduced to make data classes simpler and safer. 1) Immutability by design: Record fields are final by default, so objects can’t be changed after creation. 2) Better JVM support: Records are a native Java feature, so the JVM understands them directly (unlike Lombok which works through annotation processing). 3) Pattern matching support: Records work nicely with newer Java features like pattern matching and deconstruction. Records are a built-in, concise, immutable way to model data, while Lombok is just a library that generates boilerplate code.
Java already had POJOs Lombok. So why did Java introduce Records? What advantage do Records give that Lombok doesn't? A) Immutability by design B) Better JVM performance C) Pattern matching support D) All of the above Follow for more such daily content. #Java #TechTwitter
3
223