You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-azure/design-resilient-code-interfaces/8-knowledge-check.yml
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -29,34 +29,34 @@ quiz:
29
29
explanation: "Correct. Interfaces define a set of methods and properties that implementing classes must provide, promoting loose coupling and making the code easier to test and maintain."
30
30
- content: "How can the issue of tightly coupled code be addressed?"
31
31
choices:
32
-
- content: "By modifying existing code to add new features"
32
+
- content: "By modifying existing code to add new features."
33
33
isCorrect: false
34
34
explanation: "Incorrect. Modifying existing code to add new features violates the Open/Closed Principle."
35
-
- content: "By refactoring the code using interfaces to make it more modular and flexible"
35
+
- content: "By refactoring the code using interfaces to make it more modular and flexible."
36
36
isCorrect: true
37
37
explanation: "Correct. Using interfaces to decouple components can make the code more modular and flexible, addressing the issue of tightly coupled code."
38
-
- content: "By increasing dependencies between components"
38
+
- content: "By increasing dependencies between components."
39
39
isCorrect: false
40
40
explanation: "Incorrect. Increasing dependencies would lead to more tightly coupled code, not less."
41
41
- content: "What is the main advantage of using an interface in programming?"
42
42
choices:
43
-
- content: "It allows to modify the class without adding new type items"
43
+
- content: "It allows you to modify the class without adding new type items."
44
44
isCorrect: false
45
45
explanation: "Incorrect. An interface does not allow modification of the class, but it does allow adding new type items without modifying the class."
46
-
- content: "It makes the system more complex and difficult to understand"
46
+
- content: "It makes the system more complex and difficult to understand."
47
47
isCorrect: false
48
48
explanation: "Incorrect. An interface actually simplifies maintenance by making the system easier to understand, test, and extend."
49
-
- content: "It isolates behavior, ensuring the class doesn't depend on specific implementations"
49
+
- content: "It isolates behavior, ensuring the class doesn't depend on specific implementations."
50
50
isCorrect: true
51
51
explanation: "Correct. An interface sets a contract for behavior without detailing its implementation, thus reducing dependencies and improving modularity."
52
52
- content: "How does an interface contribute to the principle of Separation of Concerns?"
53
53
choices:
54
-
- content: "By isolating behavior and ensuring responsibilities are clearly divided"
54
+
- content: "By isolating behavior and ensuring responsibilities are clearly divided."
55
55
isCorrect: true
56
56
explanation: "Correct. An interface isolates behavior, which aligns with the principle of Separation of Concerns by ensuring responsibilities are clearly divided."
57
-
- content: "By complicating the system's understanding, testing, and extension"
57
+
- content: "By complicating the system's understanding, testing, and extension."
58
58
isCorrect: false
59
59
explanation: "Incorrect. An interface simplifies maintenance by clearly dividing responsibilities."
60
-
- content: "By allowing the class to depend on specific implementations"
60
+
- content: "By allowing the class to depend on specific implementations."
61
61
isCorrect: false
62
62
explanation: "Incorrect. An interface actually ensures that the class doesn't depend on specific implementations."
0 commit comments