Day15 #100 days of leetcode One of the most asked string problems in interviews — and a great way to sharpen your problem-solving skills. 🔍 Problem Given a string, find the longest substring that reads the same forward and backward. 💡 Approach Used: Expand Around Center Instead of checking every substring (which is expensive), we treat each character as a center and expand outward. #DataStructures #Algorithms #Java #CodingInterview #LeetCode #ProblemSolving #TechCareers
Longest Palindromic Substring in Java
More Relevant Posts
-
Practicing Real Interview Thinking Solved a palindrome problem today — without using reverse. At first, I thought checking first and last character is enough. But I realized the correct approach is to compare characters from both ends step by step. This changed my thinking: Interview problems are not about complexity, but about correct logic. Small problems → Big learning. #Java #ProblemSolving #InterviewPrep #LearningInPublic
To view or add a comment, sign in
-
🚀 Day 4 – Daily DSA Challenge A quick check on your fundamentals can make a big difference in interviews. Here’s a simple output-based question to test your understanding of arrays and indexing. 💡 What will be the output? Share your answer in the comments and let’s discuss 👇 #DSA #Coding #Java #DataStructures #Algorithms #InterviewPreparation #SoftwareEngineering #Learning #TechCareers
To view or add a comment, sign in
-
-
🚀 A small #learning from my recent interview In one of my recent interviews, I was asked to write a program to create a deadlock and then explain how to fix it. Honestly, I’ve read about deadlocks before, but writing it during an interview made me think more practically. 𝐓𝐰𝐨 𝐭𝐡𝐫𝐞𝐚𝐝𝐬, 𝐭𝐰𝐨 𝐫𝐞𝐬𝐨𝐮𝐫𝐜𝐞𝐬: Thread 1 locks one resource and waits for the other Thread 2 does the opposite And that’s it… both threads are 𝐬𝐭𝐮𝐜𝐤 𝐟𝐨𝐫𝐞𝐯𝐞𝐫 What I liked about this question is — it’s simple, but it checks how well we understand real-world thread behavior. The discussion didn’t stop at just creating the deadlock. The interviewer was more interested in how I would avoid it. 𝐒𝐨𝐦𝐞 𝐤𝐞𝐲 𝐭𝐚𝐤𝐞𝐚𝐰𝐚𝐲𝐬 𝐟𝐨𝐫 𝐦𝐞: --> Always follow a consistent order while acquiring locks --> Be careful with nested synchronization --> Think about alternatives like tryLock or timeouts It was a good reminder that multithreading is not just about writing code, but about writing safe and predictable code. #Java #Multithreading #Concurrency #JavaDeveloper #BackendDevelopment #SoftwareEngineering #InterviewExperience #TechInterview #CodingInterview #Learning
To view or add a comment, sign in
-
-
Code is easy, but concepts are the real filter. Just watched a solid interview simulation by Sheryians Coding School, and it was a massive reality check. In the age of AI prompts, the real winners are those who actually understand what’s happening "under the hood." The 3-Step Reality Check: 1️⃣ JS Basics: It’s not just let/const; it’s the Temporal Dead Zone. 2️⃣ The Core: If you don’t get Execution Context or Closures, you don’t know JS. 3️⃣ The Final Boss: Mastering the Event Loop separates the seniors from the juniors. The lesson? It’s not just about the answer - it’s about your technical depth and how you structure your thoughts. Watch the full simulation here: https://lnkd.in/gNE974K6 Credit: https://lnkd.in/gbZ4CBWS by Sarthak Sharma Credit: Sheryians Coding School & #JavaScript #Frontend #InterviewPrep #WebDev #IndiaTech
Real Frontend Interview Simulation: Where Most Developers Fail
https://www.youtube.com/
To view or add a comment, sign in
-
Most people overcomplicate this problem. At first glance, it feels like we need extra space or another array… But the trick is simple: Since the array is sorted, duplicates are always next to each other. Once you notice that, you can solve it in-place using a Two Pointer approach — no extra space needed. Small observation → big optimization. If you’re preparing for coding interviews, this pattern shows up more often than you think. Have you used this approach before? #DSA #TwoPointers #Java #CodingInterview #ProblemSolving #LeetCode #SoftwareEngineering
To view or add a comment, sign in
-
-
Today's Daily DSA Challenge focuses on a fundamental algorithm: Binary Search. What is the time complexity of Binary Search? Feel free to share your answers in the comments. Consistency is essential for mastering DSA and succeeding in top tech interviews. #dsa #coding #java #linkdin #code #job #interview #codecraft #c #dsachallange
To view or add a comment, sign in
-
-
Most devs fail sliding window problems in interviews. Not because they don't know the algorithm. Because they can't explain why it works. Here's the mental model that changes everything: Brute force checks every substring from scratch → O(n³) Sliding window reuses what you already know → O(n) The key insight: when you hit a duplicate character, you don't restart. You just shrink from the left until the duplicate is gone. Two pointers. One set. Linear time. while s[right] in char_set: char_set.remove(s[left]) left += 1 That single loop is the entire trick. Each character is visited at most twice — once added, once removed. That's why it's O(n) despite the nested while. I've seen candidates code this correctly and still get rejected. Because when the interviewer asked "why is this linear?" they froze. Complexity analysis isn't a bonus point. It's the interview. Can you explain O(n) vs O(n²) to a 5-year-old? #TechInterviews #Python #Algorithms #SoftwareEngineering #CodingInterview
To view or add a comment, sign in
-
-
🚀 Day63 🚀 DSA Spotlight | Longest Prefix = Suffix (KMP Magic) Struggling with string problems in interviews? Here's a powerful pattern you should know 👇 👉 Problem: Given a string, find the length of the longest proper prefix which is also a suffix (excluding the entire string). 💡 Example: Input: "abab" Output: 2 Explanation: "ab" is both prefix & suffix 🧠 Optimal Approach (Using LPS from KMP Algorithm): Instead of brute force, we use the LPS (Longest Prefix Suffix) array to solve it in linear time. ✔️ Build an LPS array ✔️ Each index stores prefix = suffix length ✔️ Final answer = last value of LPS array ⚡ Complexity: Time: O(n) Space: O(n) 🎯 Why You Should Care: This pattern appears in: ✔️ Pattern Matching (KMP) ✔️ Repeated substring problems ✔️ Competitive coding & interviews 🔥 Mastering such patterns is what separates average coders from strong problem solvers. #DSA #Java #CodingInterview #KMP #ProblemSolving #AkashCodes
To view or add a comment, sign in
-
I solved 400+ LeetCode problems. Here’s the truth no one tells you 👇 It’s not about how many problems you solve. It’s about how many patterns you master. What actually worked for me: → Sliding Window for substring problems→ Two Pointers for array optimization→ DP for breaking complex problems→ Graphs for real interview-level questions Biggest mistake I made? Solving randomly without revision. What I changed: ✔ Focused on patterns✔ Revisited problems multiple times✔ Understood “why” instead of memorizing If you're preparing for coding interviews: Don’t chase numbers. Chase understanding. #LeetCode #DSA #CodingInterview #SDE
To view or add a comment, sign in
-
-
Hey #dev, still afraid of #codechallenge? Hmmm... maybe this will help you in #job #interviews, especially if it’s in #Rust. I saw a post by Ashish Pratap Singh on LinkedIn about top #leetcode problems you should study, and, since I had already written implementations in Rust for almost all of these types of problems, I decided to create this page with explanations and source code. I had to add two or three more, but it turned out really great for you, who are studying for job interviews. Coming next: #Golang, #python, and #typescript versions. Here my repo: https://lnkd.in/df8-z4pz Follow me for more content like this one.
To view or add a comment, sign in
-
More from this author
Explore related topics
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