SOLID PRINCIPLE PART - 8 WHAT IS LSP OR MEANING OF ‘L’? L — Liskov Substitution Principle 👇 👉 Child class should behave like parent ❌ Example: Bird → Fly() Ostrich → cannot fly ❌ 👉 Breaks system ✔ Fix: Separate flying behavior 👉 Correct inheritance = stable system 🔔 Follow me for more: TechClarityWithVijay 👤 Vijay Narayan Mishra https://lnkd.in/gaWaDqZj #dotnet #softwareengineering #backenddeveloper #cleanarchitecture #coding #developers #systemdesign #TechClarityWithVijay
Liskov Substitution Principle in Software Engineering
More Relevant Posts
-
Furthest point from origin Thought process: We’re given a string with 'L', 'R', and '_'. 'L' → move left 'R' → move right '_' → can be either left or right 🤔 So the key idea is: the final distance mainly depends on how we use '_'. To maximize distance, we should move all '_' in the direction that already has more moves (left or right). This way, the gap increases as much as possible. So, the ans becomes: abs(lCnt - rCnt) + underscore_cnt #programming #problemSolving #coding #developers #softwareengineering #DSA #algorithms
To view or add a comment, sign in
-
-
Understanding the path to the solution. I recently solved LeetCode 62: Unique Paths. While the problem seems simple at first glance, it’s a perfect example of how Dynamic Programming can optimize a solution from exponential time to linear time. The core idea: The number of ways to reach any cell is simply the sum of ways to reach the cell above it and the cell to its left. Seeing that "Accepted" screen with a 0ms runtime is always a great feeling! #SoftwareEngineering #DynamicProgramming #Coding #LeetCodeDaily
To view or add a comment, sign in
-
-
Day-38 Remove Outer Parentheses (Stack) Solved a neat stack problem today! 💡 Idea: Track the depth of parentheses and skip the outermost layer of each valid group. ⚡ Time: O(n) 🎯 Key Learning: 👉 Focus on depth rather than structure — simplifies the problem a lot. #DSA #LeetCode #Stack #Coding #ProblemSolving
To view or add a comment, sign in
-
-
DAY->26 🚀 LeetCode 1002 — Find Common Characters | Frequency Optimization 🔥 Solved this problem using a frequency array approach and achieved 100% runtime (0 ms) ⚡ 🔍 The goal is to find characters that appear in all strings, including duplicates. 💡 Approach: Use a frequency array of size 26 Initialize with a large value (INT_MAX) For each word: Count character frequency Update global frequency using minimum values 🧠 Key Insight: We take the minimum frequency because a character must exist in every string. ⚡ Complexity: Time → O(n × k) Space → O(1) This problem helped me understand how frequency comparison can efficiently find common elements 🚀 #DSA #LeetCode #Cpp #Coding #ProblemSolving #Arrays #LearningJourney
To view or add a comment, sign in
-
-
🧠 One small mistake can break your entire logic. Today I learned this while solving a grid problem 👇 💻 LeetCode #1559 — Detect Cycles in 2D Grid At first glance, it looks like a simple DFS problem… But there’s a catch ⚠️ 🔍 Common mistake developers make: 👉 “If I visit an already visited cell → cycle exists” Sounds correct… but it’s NOT ❌ 🚀 My Approach (DFS + Parent Tracking): Traverse the grid using DFS Move in 4 directions (up, down, left, right) Only move to cells with the same character 👉 While moving, I track the parent cell 💡 Key Logic: If I reach a cell that is: Already visited AND not the parent 👉 Then a cycle exists ✅ ⚙️ Why parent check is important? Because going back to the previous cell is normal 👉 It should NOT be treated as a cycle 🧠 Takeaway: In DSA, logic rarely fails… 👉 Edge cases do 🔥 The difference between wrong and correct solution is often just one condition Have you ever fixed your solution by changing just 1 line? 😄 #LeetCode #DSA #Algorithms #Programming #Debugging #ProblemSolving #Developers #CodingJourney
To view or add a comment, sign in
-
-
Binary tree right side view Approach: - Keep a level variable - If level == result.size(), add current node (first node of that level) - Traverse right first, then left Time: O(n) Space: O(h) (worst: O(n), best: O(log n)) #Algorithms #DSA #LeetCode #coding #Programming
To view or add a comment, sign in
-
-
Everything is Fine My debugging process is basically a 4-Stage emotional journey: 😊I know exactly what’s wrong. 😑Wait, why did that fix make it worse? 😓I have no idea how this code ever worked in the first place. 🥴🤒😅It’s working now and I’m afraid to touch anything. I don’t 'write code' anymore. I just negotiate with the compiler until it stops screaming at me. 🖥️🔥 Drop a 'Ship it' in the comments if your codebase is currently held together by thoughts, prayers, and Stack Overflow. #TechLife #SoftwareEngineering #Debugging #CodeLife"
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