dasari4kntr Posted Thursday at 08:13 PM Report Share Posted Thursday at 08:13 PM రెండు interviews..లో ఇద్దరిని అడిగితే …ఇద్దరూ నీళ్ళు నమిలారు… Quote Link to comment Share on other sites More sharing options...
NaniVuncle Posted Thursday at 08:14 PM Report Share Posted Thursday at 08:14 PM Just now, dasari4kntr said: రెండు interviews..లో ఇద్దరిని అడిగితే …ఇద్దరూ నీళ్ళు నమిలారు… PM requirement here Quote Link to comment Share on other sites More sharing options...
EggpuffReddy Posted Thursday at 08:17 PM Report Share Posted Thursday at 08:17 PM 3 minutes ago, dasari4kntr said: రెండు interviews..లో ఇద్దరిని అడిగితే …ఇద్దరూ నీళ్ళు నమిలారు… this is the chatGPT answer, ila chebte oknaa, next follow up questions em vuntaayi Great! Let's go over the SOLID principles, which are 5 key design principles in object-oriented programming (OOP) to make software more maintainable, flexible, and scalable. The acronym SOLID stands for: ✅ S — Single Responsibility Principle (SRP) "A class should have only one reason to change." Each class or module should focus on one task or responsibility. Benefits: Easier to maintain, test, and understand. Example: csharp CopyEdit // ❌ Bad: Mixing responsibilities class Report { void GenerateReport() { ... } void SaveToFile() { ... } // Saving is not report generation } // ✅ Good: Separate responsibilities class Report { void GenerateReport() { ... } } class FileSaver { void SaveToFile(Report report) { ... } } ✅ O — Open/Closed Principle (OCP) "Software entities should be open for extension, but closed for modification." You should be able to extend a class's behavior without modifying its source code. Benefits: Easy to add new features without breaking existing code. Example: csharp CopyEdit // Base class abstract class Shape { public abstract double GetArea(); } // Extension via inheritance class Circle : Shape { public override double GetArea() { ... } } class Rectangle : Shape { public override double GetArea() { ... } } ✅ L — Liskov Substitution Principle (LSP) "Derived classes must be substitutable for their base classes." A subclass should be able to replace its parent class without breaking functionality. Benefits: Ensures consistent behavior when using base types. Example: csharp CopyEdit class Bird { public virtual void Fly() { ... } } class Sparrow : Bird { public override void Fly() { ... } } // ✅ Violating this would be making a Penguin class extend Bird and try to Fly, which it can't. ✅ I — Interface Segregation Principle (ISP) "Clients should not be forced to depend on interfaces they do not use." Many small, specific interfaces are better than a large, general-purpose one. Benefits: Avoids forcing classes to implement unnecessary methods. Example: csharp CopyEdit // ❌ Bad: One big interface interface IMachine { void Print(); void Scan(); void Fax(); } // ✅ Good: Segregate interfaces interface IPrinter { void Print(); } interface IScanner { void Scan(); } // Class only implements what it needs class Printer : IPrinter { public void Print() { ... } } ✅ D — Dependency Inversion Principle (DIP) "Depend on abstractions, not on concretions." High-level modules should not depend on low-level modules, but both should depend on abstractions (interfaces). Benefits: Makes code flexible and reduces coupling. Example: csharp CopyEdit // Interface interface IMessageSender { void SendMessage(string message); } // Concrete implementation class EmailSender : IMessageSender { public void SendMessage(string message) { ... } } // High-level class depending on abstraction class NotificationService { private readonly IMessageSender _sender; public NotificationService(IMessageSender sender) { _sender = sender; } public void Notify(string message) { _sender.SendMessage(message); } } ✅ Summary of SOLID: Principle Description Goal S - Single Responsibility One class = one job Low coupling, high cohesion O - Open/Closed Open for extension, closed for modification Extensible and stable code L - Liskov Substitution Subtypes replace base types without issues Reliable polymorphism I - Interface Segregation Many specific interfaces > one large one Avoid bloated interfaces D - Dependency Inversion Depend on abstractions, not concretions Flexible, testable, maintainable code Quote Link to comment Share on other sites More sharing options...
*Prince Charming Posted Thursday at 08:24 PM Report Share Posted Thursday at 08:24 PM 10 minutes ago, dasari4kntr said: రెండు interviews..లో ఇద్దరిని అడిగితే …ఇద్దరూ నీళ్ళు నమిలారు… SOLID principles kakunda inkem telsikovaali ?? For interviews?? Quote Link to comment Share on other sites More sharing options...
Popular Post Spartan Posted Thursday at 08:25 PM Popular Post Report Share Posted Thursday at 08:25 PM frankly....interviews ki tappa...real world daily work lo does anyone even care about these anna.. SOLID, ACID... etc vatillo unna concepts over the period experience to ostai....but desining or coding appudu I havent seen anyone bring this up and adhere to them.. unless someone wants to play Devils Advocate during the session.... @Konebhar6 @dasari4kntr @csrcsr 8 Quote Link to comment Share on other sites More sharing options...
Aquaman Posted Thursday at 08:38 PM Report Share Posted Thursday at 08:38 PM 11 minutes ago, Spartan said: frankly....interviews ki tappa...real world daily work lo does anyone even care about these anna.. SOLID, ACID... etc vatillo unna concepts over the period experience to ostai....but desining or coding appudu I havent seen anyone bring this up and adhere to them.. unless someone wants to play Devils Advocate during the session.... @Konebhar6 @dasari4kntr @csrcsr code reviews lo chustam anna Quote Link to comment Share on other sites More sharing options...
Spartan Posted Thursday at 08:40 PM Report Share Posted Thursday at 08:40 PM Just now, Aquaman said: code reviews lo chustam anna LGTM. 2 Quote Link to comment Share on other sites More sharing options...
dasari4kntr Posted Thursday at 09:00 PM Author Report Share Posted Thursday at 09:00 PM 41 minutes ago, EggpuffReddy said: this is the chatGPT answer, ila chebte oknaa, next follow up questions em vuntaayi Great! Let's go over the SOLID principles, which are 5 key design principles in object-oriented programming (OOP) to make software more maintainable, flexible, and scalable. The acronym SOLID stands for: ✅ S — Single Responsibility Principle (SRP) "A class should have only one reason to change." Each class or module should focus on one task or responsibility. Benefits: Easier to maintain, test, and understand. Example: csharp CopyEdit // ❌ Bad: Mixing responsibilities class Report { void GenerateReport() { ... } void SaveToFile() { ... } // Saving is not report generation } // ✅ Good: Separate responsibilities class Report { void GenerateReport() { ... } } class FileSaver { void SaveToFile(Report report) { ... } } ✅ O — Open/Closed Principle (OCP) "Software entities should be open for extension, but closed for modification." You should be able to extend a class's behavior without modifying its source code. Benefits: Easy to add new features without breaking existing code. Example: csharp CopyEdit // Base class abstract class Shape { public abstract double GetArea(); } // Extension via inheritance class Circle : Shape { public override double GetArea() { ... } } class Rectangle : Shape { public override double GetArea() { ... } } ✅ L — Liskov Substitution Principle (LSP) "Derived classes must be substitutable for their base classes." A subclass should be able to replace its parent class without breaking functionality. Benefits: Ensures consistent behavior when using base types. Example: csharp CopyEdit class Bird { public virtual void Fly() { ... } } class Sparrow : Bird { public override void Fly() { ... } } // ✅ Violating this would be making a Penguin class extend Bird and try to Fly, which it can't. ✅ I — Interface Segregation Principle (ISP) "Clients should not be forced to depend on interfaces they do not use." Many small, specific interfaces are better than a large, general-purpose one. Benefits: Avoids forcing classes to implement unnecessary methods. Example: csharp CopyEdit // ❌ Bad: One big interface interface IMachine { void Print(); void Scan(); void Fax(); } // ✅ Good: Segregate interfaces interface IPrinter { void Print(); } interface IScanner { void Scan(); } // Class only implements what it needs class Printer : IPrinter { public void Print() { ... } } ✅ D — Dependency Inversion Principle (DIP) "Depend on abstractions, not on concretions." High-level modules should not depend on low-level modules, but both should depend on abstractions (interfaces). Benefits: Makes code flexible and reduces coupling. Example: csharp CopyEdit // Interface interface IMessageSender { void SendMessage(string message); } // Concrete implementation class EmailSender : IMessageSender { public void SendMessage(string message) { ... } } // High-level class depending on abstraction class NotificationService { private readonly IMessageSender _sender; public NotificationService(IMessageSender sender) { _sender = sender; } public void Notify(string message) { _sender.SendMessage(message); } } ✅ Summary of SOLID: Principle Description Goal S - Single Responsibility One class = one job Low coupling, high cohesion O - Open/Closed Open for extension, closed for modification Extensible and stable code L - Liskov Substitution Subtypes replace base types without issues Reliable polymorphism I - Interface Segregation Many specific interfaces > one large one Avoid bloated interfaces D - Dependency Inversion Depend on abstractions, not concretions Flexible, testable, maintainable code next ఆ dependecy invesion గురించి questions పడతాయి… Quote Link to comment Share on other sites More sharing options...
dasari4kntr Posted Thursday at 09:02 PM Author Report Share Posted Thursday at 09:02 PM 36 minutes ago, Spartan said: frankly....interviews ki tappa...real world daily work lo does anyone even care about these anna.. SOLID, ACID... etc vatillo unna concepts over the period experience to ostai....but desining or coding appudu I havent seen anyone bring this up and adhere to them.. unless someone wants to play Devils Advocate during the session.... @Konebhar6 @dasari4kntr @csrcsr solid …very important… if someone knows…solid …they know the dependency injection….and next they kbow how it is useful in unit tests… 1 Quote Link to comment Share on other sites More sharing options...
dasari4kntr Posted Thursday at 09:04 PM Author Report Share Posted Thursday at 09:04 PM 38 minutes ago, Spartan said: frankly....interviews ki tappa...real world daily work lo does anyone even care about these anna.. SOLID, ACID... etc vatillo unna concepts over the period experience to ostai....but desining or coding appudu I havent seen anyone bring this up and adhere to them.. unless someone wants to play Devils Advocate during the session.... @Konebhar6 @dasari4kntr @csrcsr simple example…springboot లో ప్రతి class లో @Autowired అని రాస్తాం…అది ఎందుకు అంటే…దానికి ఆది మూలం ఇదే… Quote Link to comment Share on other sites More sharing options...
dasari4kntr Posted Thursday at 09:23 PM Author Report Share Posted Thursday at 09:23 PM 56 minutes ago, *Prince Charming said: SOLID principles kakunda inkem telsikovaali ?? For interviews?? developer role కాబట్టి …అక్కడ నుండి start చేసా…next…oka coding problem ఇచ్చి execute చేయమంటా…to see he is hands on or not… Quote Link to comment Share on other sites More sharing options...
Mr Mirchi Posted Thursday at 09:23 PM Report Share Posted Thursday at 09:23 PM 1 hour ago, dasari4kntr said: రెండు interviews..లో ఇద్దరిని అడిగితే …ఇద్దరూ నీళ్ళు నమిలారు… Kanikaram ledhu e khatina manavudiki 2 Quote Link to comment Share on other sites More sharing options...
Mr Mirchi Posted Thursday at 09:25 PM Report Share Posted Thursday at 09:25 PM 59 minutes ago, Spartan said: frankly....interviews ki tappa...real world daily work lo does anyone even care about these anna.. SOLID, ACID... etc vatillo unna concepts over the period experience to ostai....but desining or coding appudu I havent seen anyone bring this up and adhere to them.. unless someone wants to play Devils Advocate during the session.... @Konebhar6 @dasari4kntr @csrcsr Acid yes…. Solid jujubi mostly intervieer thana pethapam chupimchalante aduguthadu ilantivi .. kondharu ithe java lantivi ok but thuppasi vatiki kuda VERSIONS adugutharu Quote Link to comment Share on other sites More sharing options...
citizenofIND Posted Thursday at 09:32 PM Report Share Posted Thursday at 09:32 PM Okay thanks for info uncle Quote Link to comment Share on other sites More sharing options...
dasari4kntr Posted Thursday at 09:33 PM Author Report Share Posted Thursday at 09:33 PM sare.. @Spartan @Mr Mirchi...ee code ki unit test ela raastro.. cheppandi.... class OrderService { private final SqlDatabase database; private final FileLogger logger; public OrderService() { this.database = new SqlDatabase(); this.logger = new FileLogger(); } public void processOrder(Order order) { try { database.save(order); logger.log("Order processed: " + order.getId()); } catch (Exception e) { logger.log("Error processing order: " + e.getMessage()); } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.