Day 16 - DSA Practice and Multithreading Revision

Solved 2 Leetcode problems and revised Java multithreading basics
Author

Shashank Hosahalli Shivamurthy

Published

July 4, 2025

Day 16 - DSA Practice and Multithreading Revision

Started the day with Leetcode practice, two problems for today. I have just been trying to focus on the fundamentals for now and trying to get distracted a lot.


31. Next Permutation

The intuition didn’t feel straightforward initially.
I had an idea of what was needed but didn’t know how to go about solving it.

Then I realized the main thing was to find the longest prefix match or rather, the breakpoint index where the order breaks. This was really not intuitive at all. But I got the point of it eventually.

Once that clicked, the rest of the problem fell into place.
Made a lot more sense after understanding that.


75. Sort Colors

This one was more straightforward. Solved it blind.

But again, the most optimal solution used constant space
which I didn’t get immediately.

Learnt about the Dutch National Flag Algorithm, so this basically uses 3 pointers:

  • low, mid, and high
  • The array is divided into:
    • 0 to low - 1
    • low to mid - 1
    • mid to high (to be sorted)
    • high + 1 to n - 1

We start with low = 0, mid = 0, and high = n - 1, and sort the segment.

Made a whole lot of sense.


After the DSA problems, I spent some time revising Multithreading and Concurrency in Java.

Nothing completely new, just revisiting the basics I had gone through last week.

Planning to dive deeper this weekend and maybe even implement a realistic project to get a feel for:

  • How multithreading is actually used
  • What the difference is with and without it

I also want to just quickly revise all the Spring Boot terms and just be ready for interviews. I think I also need to start preparing for behavioral rounds. I feel confident but I don’t want get too cocky. Just want to prepare and be ready when the time comes.

Because there is a that we need to answer these questions and can’t just blabber bullshit.

Slow but steady but mainly just. showing up and learning every day.