أسئلة القسم

تدرب على أسئلة المقابلات في هذا القسم. اكتب إجابتك، قم بتقييمها، أو اضغط على "عرض الإجابة" بعد التفكير.

What is SOLID? Can you elaborate on each SOLID acronym? سهل

A set of 5 object-oriented design principles:

Acronym Principle Meaning (simple)
S Single Responsibility Principle A class should have only one reason to change.
O Open/Closed Principle Open for extension, closed for modification.
L Liskov Substitution Principle Subclasses should be substitutable for base classes.
I Interface Segregation Principle Many small, specific interfaces are better than one large one.
D Dependency Inversion Principle Depend on abstractions, not on concrete implementations.
Name design patterns and principles you know and how they are utilized in .NET Framework. سهل
  • Creational Patterns:
    • Singleton: IConfiguration or IHttpClientFactory as singleton in DI.
    • Factory: DbContextFactory creates EF Core contexts.
  • Structural Patterns:
    • Adapter: Wrapping a third-party API in your own interface.
    • Decorator: Adding behavior to services without changing them (middleware).
  • Behavioral Patterns:
    • Strategy: PasswordHasher implementations or ILoggerProvider.
    • Command: MediatR library in .NET implements Command pattern for CQRS.
  • Principles:
    • SOLID, DRY, KISS, YAGNI