🚀 Day 3/30 – LeetCode Java Challenge Not every day is about “beating 100%.” Today was a good reminder of that. Solved a linked list problem that required filtering elements based on given values. The logic was straightforward, but the real challenge was handling pointers correctly without breaking the list. 📊 Result: ✔️ Accepted (582/582 test cases) ⚡ Runtime: 22 ms 💾 Memory: 178 MB 💡 What actually stood out today: - Linked lists punish sloppy thinking — one wrong pointer, everything breaks - Writing “working code” is easy; writing robust pointer logic is not - Performance wasn’t great today — and that’s fine, because correctness comes first Let’s be honest: This solution is not optimized. There’s room to improve both runtime and memory. That’s exactly the point of doing this daily — identify weaknesses and fix them. Day 3 done. No hype, just progress. Archana J E Bavani k Hari priya B Deepika Kannan Divya Suresh Bhavya B Harini B Devipriya R Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #LinkedList #Consistency #30DaysOfCode
Harilakshmi S’ Post
More Relevant Posts
-
🚀 **Day 5/30 – LeetCode Java Challenge** Today’s problem was a step up — not in complexity, but in **how carefully the logic had to be applied**. Worked on constructing a valid string based on given conditions. The tricky part wasn’t writing code — it was **handling overlaps and conflicts correctly** without breaking earlier decisions. 📊 **Result:** ✔️ Accepted (739/739 test cases) ⚡ Runtime: 11 ms (Beats 77.08%) 💾 Memory: Moderate efficiency 💡 **What actually mattered today:** * Greedy thinking can fail if you don’t track constraints properly * Managing “state” (like locked positions) is critical in construction problems * Edge cases are where most solutions break — not the main logic Let’s be honest: This isn’t an optimal solution yet. There’s still room to improve both performance and clarity. But the bigger win is understanding **why conflicts happen and how to control them**. Day 5 done. Less guesswork, more control over logic. Archana J E Bavani k Hari priya B Deepika Kannan Divya Suresh Devipriya R Bhavya B Harini B Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #ProblemSolving #Consistency #30DaysOfCode
To view or add a comment, sign in
-
-
Day 92 - LeetCode Journey Solved LeetCode 143: Reorder List in Java ✅ This problem looks tricky at first, but once you break it into steps, it becomes clean and elegant. The idea is simple: 1️⃣ Find the middle of the list (slow-fast pointers) 2️⃣ Reverse the second half 3️⃣ Merge both halves alternately That’s it. Three steps, one solid solution. Key takeaways: • Mastering slow & fast pointer technique • In-place reversal of linked list • Merging two lists efficiently • Breaking complex problems into smaller parts ✅ All test cases passed ⚡ O(n) time and O(1) space Problems like this build real confidence in linked lists 💯 #LeetCode #DSA #Java #LinkedList #ProblemSolving #CodingJourney #InterviewPrep #Consistency #100DaysOfCode
To view or add a comment, sign in
-
-
🚨 Can a Thread call start() twice in Java? Short answer — No. And we learned this the hard way in production. 😬 😓 The real story We had a payment retry system. When a payment failed, our code called thread.start() again on the same thread to retry. Seemed logical... until we saw IllegalThreadStateException crashing the entire service at midnight. 💀 🔍 Why does this happen? Once a thread finishes, it moves to a TERMINATED state. Java does not allow restarting a dead thread — ever. ❌ Wrong: t.start(); t.start(); → 💥 CRASH ✅ Right: Create a new Thread each time, or use ExecutorService 💡 How we fixed it Replaced raw threads with ExecutorService. Every retry = a new task submitted to the pool. No crashes. No headaches. 🧠 Remember: 🔁 Thread lifecycle → New → Runnable → Running → Terminated 🚫 Once terminated — cannot restart ✅ Always use a new Thread or ExecutorService One line of mistake. One midnight crash. One lesson for life. 🙂 Have you ever hit this bug? Drop a comment 👇 #Java #Multithreading #Threading #JavaDeveloper #BackendDevelopment #CodingTips #SoftwareEngineering
To view or add a comment, sign in
-
💻 Modern Java Tricks I Actually Use to Save Time After 4 years working with Java, I realized: being a “senior” isn’t just about design patterns or DSA. It’s about knowing which language features cut down boilerplate. Even in 2025, I see teams still writing Java 8-style code: 20+ line DTOs Nested null checks everywhere Blocking futures slowing things down Switch statements that bite you with fall-through bugs Java 17–21 gives us tools to fix all that without extra lines of code. Some of my go-to features: Records → goodbye huge data classes Sealed Classes → safer type hierarchies Pattern Matching → no more casting headaches Switch Expressions → no accidental fall-throughs Text Blocks → clean SQL/JSON/HTML in code var → less noise, same type safety Streams + Collectors → readable pipelines Optional properly → avoid NPEs CompletableFuture → async calls made simple Structured Concurrency → async the modern way These aren’t just features—I’ve used them in real projects to write faster, cleaner code. 👇 Curious: which Java version is your team on? Drop a comment—I’ll reply to everyone. 🔁 If you know a teammate who still writes Java 8 style, share this with them. #Java #Java21 #SpringBoot #CleanCode #BackendEngineering #SoftwareDevelopment
To view or add a comment, sign in
-
Generics in Java always felt simple… until wildcards came in. Recently spent some time understanding how ?, ? extends, and ? super actually work. It looks small, but it completely changes how you design flexible and type-safe code. So I made a short PPT to break it down in a way that’s easier to understand. No heavy theory, just trying to make the concept clear. This is one of those topics that feels confusing at first, but once it clicks, it actually makes a lot of sense. Still exploring Java deeper, one concept at a time… let’s see where it goes. #Java #Generics
To view or add a comment, sign in
-
📈 Does Java really use too much memory? It’s a common myth but modern Java tells a different story. With improvements like: ✔️ Low-latency garbage collectors (ZGC, Shenandoah) ✔️ Lightweight virtual threads (Project Loom) ✔️ Compact object headers (JEP 450) ✔️ Container-aware JVM & Class Data Sharing Java today is far more memory efficient, scalable and optimized than before. 💡 The real issue often isn’t Java it’s: • Unbounded caches • Poor object design • Memory leaks • Holding unnecessary references 👉 In short: Java isn’t memory hungry it’s memory aware. If your app is consuming too much RAM, start profiling your code before blaming the JVM. #Java #BackendDevelopment #Performance #JVM #SoftwareEngineering
To view or add a comment, sign in
-
-
Building LLM apps in Java is no longer experimental. It’s about doing it right. I put together a practical guide using LangChain4j, focusing on real concerns beyond demos: 👉 https://lnkd.in/eU_3mpS6 RAG quality, observability, and failure handling matter far more than prompt tricks.
To view or add a comment, sign in
-
🚀 **Day 4/30 – LeetCode Java Challenge** Today’s problem pushed me to think beyond basic comparisons and focus on **pattern-based validation**. Worked on a string problem where the key insight was separating characters based on **even and odd indices**, then comparing frequency distributions instead of direct string matching. 📊 **Result:** ✔️ Accepted (752/752 test cases) ⚡ Runtime: 5 ms (Beats 93.81%) 💾 Memory: Efficient (Beats 86.60%) 💡 **What actually mattered today:** * Brute force thinking won’t scale — pattern recognition does * Breaking a problem into smaller logical groups simplifies everything * Frequency arrays can outperform more complex data structures when used correctly Let’s be real: This wasn’t a hard problem, but the approach matters. If you miss the pattern, you overcomplicate it. If you see it early, the solution becomes clean and efficient. Day 4 done. Still building consistency, still sharpening fundamentals. Archana J E Bavani k Deepika Kannan Divya Suresh Hari priya B Devipriya R Harini B Bhavya B Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #ProblemSolving #Consistency #30DaysOfCode
To view or add a comment, sign in
-
-
Your Java Thread Model is Broken (Here's the Fix) Watch Full Video : https://lnkd.in/e_Usi8qA Website Link : https://systemdrd.com/ Full Course Link : https://lnkd.in/eM5jJyaQ OS threads cost 1MB each and cap you at ~2,000 connections. Java's virtual threads via Project Loom handle 1,000,000+ — with simpler code. Stop writing reactive chains. #JavaDeveloper #ProjectLoom #VirtualThreads #BackendEngineering #JavaTips #CodingShorts #SoftwareEngineering #Java2026
To view or add a comment, sign in
-
Solved Simple Array Sum using LinkedList in Java 8 💻📊 Today I worked on the Simple Array Sum problem and implemented it using LinkedList in Java 8. 💡 What I learned: How to convert a List into a LinkedList Traversing elements efficiently using loops Using Java 8 Streams for cleaner and shorter code ⚙️ Approach: Converted input list into a LinkedList Iterated through elements and calculated sum Also explored stream().mapToInt().sum() for optimized solution 📌 Key Takeaway: Even simple problems help strengthen core concepts like data structures and improve coding efficiency. ⚡ Time Complexity: O(n) ⚡ Space Complexity: O(n) 👨💻 Consistent practice is helping me improve my problem-solving skills step by step. #Java #Java8 #LinkedList #Coding #ProblemSolving
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development