Search Header Logo

Design Patterns & SOLID Principles for YP

Authored by Dotnet Quiz

Professional Development

Professional Development

Used 2+ times

Design Patterns & SOLID Principles for YP
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. What does the 'S' in SOLID principles stand for?

a) Scalability Principle
b) Single Responsibility Principle
c) Separation Principle
d) Substitution Principle
None of these

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Which SOLID principle is violated in the following code? java class User { public void saveToDatabase() { ... } public void sendEmail() { ... } public void validateInput() { ... }}

a) Open/Closed Principle
b) Liskov Substitution Principle
c) Single Responsibility Principle
d) Dependency Inversion Principle
None of these

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. The Open/Closed Principle states that classes should be:

a) Open for modification, closed for extension
b) Open for extension, closed for modification
c) Open for both modification and extension
d) Closed for both modification and extension
None of these

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. Which principle ensures that derived classes can replace their base classes without breaking functionality?

a) Single Responsibility Principle
b) Open/Closed Principle
c) Liskov Substitution Principle
d) Interface Segregation Principle
None of these

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. The Interface Segregation Principle suggests:

a) Using one large interface for all methods
b) Clients should not depend on interfaces they don't use
c) Interfaces should be implemented by multiple classes
d) Interfaces should contain only abstract methods
None of these

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Which principle is demonstrated by injecting dependencies rather than creating them inside a class?

a) Single Responsibility Principle
b) Dependency Inversion Principle
c) Interface Segregation Principle
d) Open/Closed Principle
None of these

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. Which SOLID principle is violated when a subclass throws an exception that the parent class doesn't throw?

a) Single Responsibility Principle
b) Open/Closed Principle
c) Liskov Substitution Principle
d) Interface Segregation Principle
None of these

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Professional Development