1Z0-829 • Practice Exam 3 — 20 Questions
Free 1Z0-829 practice exam 3 — 20 questions with explanations. No signup required.
You are designing a logging framework for a distributed application. The framework must support multiple output destinations (console, file, network socket) and allow clients to dynamically add new destinations at runtime without modifying existing code. Currently, the application uses a single static Logger class with methods like logToConsole(String msg) and logToFile(String msg). The team needs to refactor the code to adhere to the Open/Closed Principle and support extensibility. After reviewing the requirements, you propose using a combination of an interface and a strategy pattern. However, a senior developer argues that using a simple enum with abstract methods would be sufficient. Which course of action best adheres to object-oriented design principles and allows the most flexibility for future extensions?
Choose an answer to begin — your selection is scored in the full session.
20 questions · instant feedback and full explanations after every question.