@nourabousoha@WarrenInTheBuff@davidcottondev Yea, idea & thought seems to be shifting that way - Matt Garman sees a shift in software development as AI automates coding, telling staff to enhance product-management skills to stay competitive. https://t.co/rx7UZfRWSw
Excited to share advancement within my role at Amazon!
These past 2 years have been a rewarding journey filled with opportunities for professional development and growth. Up and ready for new challenges and take on greater responsibilities moving forward.
#LevelUp
One should not effect the corruption of the uncorrupted as of water by poison;
For it may well happen that a cure may not be found for one corrupted.
(Avoiding any politics in corporate ~ shité work culture)
Parag joins Uber after studying CSE from LPU.
Parag is a good at CP.
Uber is growing at an uber pace.
Ankita is an IIT graduate and a Senior Engineer at Uber.
Ankita assigns Parag his first task.
Requirement
Uber app shows fuel efficiency to drivers.
Parag thinks “Oh! this is simple, I just have to calculate the distance travelled by fuel delta”
Parag slaps the keyboard and writes down an abstract base class Vehicle which has these methods
1/ insertDistanceReading
2/ calculateFuelEfficiency
3/..
Parag raised a PR and left for the day.
Next day,
Ankita calls Parag and softly said
“Parag! before coding one should think in terms of business as well.”
Parag panicked “Did I do something wrong?”
Ankita smiles and says “Nah! nothing major.
As of today we have cars that run on petrol thus has fuel efficiency.
Tomorrow we might add electric vehicles with no fuels
Or wind propelled cars or a something else. Who knows!”
Parag asks “So what do I do wrong?”
Ankita then talks about Liskov Substitution Principle which says
In object-oriented design, classes should be replaceable with their subclasses without affecting the correctness of the program
So if tomorrow EV launches,
the Vehicle class will have to add
calculateBatteryEfficiency,
but battery efficiency is unrelated to petrol cars.
This breaks the contract for all other classes.
Solution?
Using LSP,
The base class Vehicle should only have insertDistanceReading method
and other methods calculateEfficiency should be
implemented by EV Class or Petrol Class.
So, in future if there is another vehicle type with a new efficiency calculation method the base class will not change.
Ankita then went on to explain that how this new improved class allows:
1/ Testability
2/ Agility
3/ Scalability
of the code and reduces delivery timelines.
Parag learns L from SOLID principles.
-------------
Things to note:
1/ LSP works along with SRP and OCP ( Follow prev posts)
2/ Small changes affects business in the long run.
3/ Writing code is not software engineering
4/ The example can be further improvised
5/ Ankita and Parag are fictional character.
I hope this story helps you in your next LLD Interview.
-------------
I am Sagar, a Staff Software Engineer trying to make building software and life easy.
⚡️Follow me for more such content.
@saumya1singh Logo at the age of 7/8 maybe, Qbasic at 10, HTML at 12, C at 14. In between there was I think some animation using flash, there was some other tool to create calculator & other programs (Missing it's name).. Somehow, it was a good incremental journey..✌🏻
@3Zade_SSG +1 for open source libraries/tools but no alternative for internal services/tools to company other than reading their documentation 🥲 Literal pain going through 15+ documentation 😢
@aneetta_joby_ & we'd be investors for your liability & we get nothing. So, everyone should get it for using. 0-0)" For an hour if we see, everyone would get their chances in ~5years. :)