APPLICATION DEVELOPMENT AND EMERGING TECHNOLOGY.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

APPLICATION DEVELOPMENT AND EMERGING TECHNOLOGY LONG QUIZ Part 1: APP DEV 03 **1. What is the primary goal of the SOLID design principles?** a) To increase code complexity b) To make software easier to change when requirements change c) To minimize the number of...

APPLICATION DEVELOPMENT AND EMERGING TECHNOLOGY LONG QUIZ Part 1: APP DEV 03 **1. What is the primary goal of the SOLID design principles?** a) To increase code complexity b) To make software easier to change when requirements change c) To minimize the number of classes d) To increase the size of codebase **2. Which of the following violates the Single Responsibility Principle?** a) A class that handles both user authentication and report generation b) A class that handles only report generation c) A class that handles file encryption only d) A class that handles database connectivity **3. In the Open-Closed Principle, a class should be:** a) Open for modification and extension b) Open for extension but closed for modification c) Closed for extension but open for modification d) Closed for both extension and modification **4. Which of the following best describes the Liskov Substitution Principle?** a) Derived classes must be substitutable for their base classes b) Base classes must depend on derived classes c) Classes should not be dependent on interfaces d) A class should have only one responsibility **5. The Interface Segregation Principle suggests:** a) Large interfaces are more efficient b) Clients should not be forced to implement methods they don’t use c) Interfaces should contain as many methods as possible d) Clients should depend on abstract classes **6. What does the Dependency Inversion Principle advocate?** a) High-level classes should depend on low-level classes b) Both high-level and low-level classes should depend on abstractions c) Low-level classes should depend on high-level classes d) All classes should be independent **7. Which of the following is a result of following the SOLID principles?** a) Increased code rigidity b) Decreased testability c) Reduced complexity d) Increased code fragility **8. In the context of SRP, which of the following would be an example of a violation?** a) A class responsible for handling file operations b) A class responsible for logging and handling user inputs c) A class responsible for managing network connections d) A class responsible for encryption **9. What is an advantage of following the Open-Closed Principle?** a) It allows changes in the class behavior through subclassing b) It prevents any class from being modified c) It avoids code duplication d) It makes testing more difficult **10. A violation of the Liskov Substitution Principle can result in:** a) Code extensibility b) Code that is difficult to maintain c) High-level abstraction d) Flexibility in implementation **11. In the SOLID principles, which letter stands for the Liskov Substitution Principle?** a) S b) O c) L d) I **12. Which principle aims to decouple high-level classes from low-level classes?** a) Open-Closed Principle b) Dependency Inversion Principle c) Single Responsibility Principle d) Interface Segregation Principle **13. The Open-Closed Principle can be applied through which of the following?** a) Method overloading b) Inheritance and interfaces c) Constructors d) Single inheritance **14. Which of the following helps to minimize code dependencies?** a) Single Responsibility Principle b) Liskov Substitution Principle c) Dependency Inversion Principle d) Open-Closed Principle **15. The SOLID principles help in improving which of the following?** a) Code reusability and flexibility b) Compilation time c) Complexity of algorithms d) Hardware performance **16. Which of the following breaks the Interface Segregation Principle?** a) A client class depending on an interface it uses b) An interface that requires a class to implement methods it doesn’t need c) An interface that has only necessary methods d) A class that depends on small, role-specific interfaces **17. According to the Dependency Inversion Principle, high-level modules should depend on:** a) Low-level modules b) Concrete classes c) Abstract interfaces d) Private methods **18. The SOLID principles were primarily introduced to avoid which of the following?** a) Object-oriented programming b) Procedural programming c) Common design issues in software development d) Reducing the number of classes **19. Which principle focuses on breaking down responsibilities into smaller classes?** a) Open-Closed Principle b) Single Responsibility Principle c) Dependency Inversion Principle d) Liskov Substitution Principle **20. When should the Single Responsibility Principle be applied?** a) When a class handles multiple types of actors or users b) When a class only performs one action c) When a class is interacting with multiple subsystems d) When a class needs to manage many objects **21. In the Liskov Substitution Principle, a subclass must:** a) Use a completely different interface b) Replace the parent class without affecting the program's behavior c) Implement new methods not in the parent class d) Violate the parent class contract **22. Which SOLID principle ensures that classes can be reused across different projects?** a) Open-Closed Principle b) Liskov Substitution Principle c) Interface Segregation Principle d) Dependency Inversion Principle **23. Why is the Dependency Inversion Principle important?** a) It increases code rigidity b) It allows high-level modules to depend on low-level modules c) It increases flexibility and reduces dependency on concrete implementations d) It promotes the use of static methods **24. The OCP advocates for:** a) Always modifying existing code b) Extending classes through inheritance c) Avoiding inheritance d) Creating large, monolithic classes **25. According to the SOLID principles, code should be:** a) Easily modified with minimal testing b) Self-contained and difficult to extend c) Extensible without changing existing code d) Tightly coupled with other classes Part 2: APP DEV 2 04 **26. What is the main purpose of design patterns in software development?** a) To provide specific code b) To offer general reusable solutions to common design problems c) To make software design rigid d) To increase the number of methods in a class **27. Which of the following is a Creational design pattern?** a) Adapter b) Singleton c) Composite d) Proxy **28. The Singleton pattern ensures that:** a) A class has more than one instance b) A class has only one instance and provides a global point of access c) Multiple instances of a class are created d) Objects are created dynamically **29. In which category of design patterns does the Factory Method belong?** a) Creational b) Structural c) Behavioral d) None of the above **30. What is the primary function of the Prototype design pattern?** a) To create multiple instances of a class b) To copy existing objects without depending on their classes c) To ensure only one instance of a class d) To allow object composition **31. The Abstract Factory pattern is used to:** a) Create different types of unrelated objects b) Provide an interface for creating families of related objects c) Combine multiple interfaces d) Create a single object from a family of related classes **32. In a Structural pattern, which one converts one interface into another interface that the client expects?** a) Adapter b) Builder c) Factory d) Observer **33. Which design pattern is used to add new responsibilities to an object dynamically?** a) Decorator b) Proxy c) Chain of Responsibility d) Flyweight **34. What problem does the Composite pattern solve?** a) It allows the dynamic creation of objects b) It treats individual objects and compositions of objects uniformly c) It adds extra behavior to classes without modifying them d) It creates a global access point for an instance **35. Which design pattern suggests using a Director to define the order of object construction?** a) Builder b) Singleton c) Adapter d) Factory Method **36. The Bridge pattern is primarily used to:** a) Separate an object’s abstraction from its implementation b) Ensure that a class has only one instance c) Allow a class to have multiple interfaces d) Convert data between incompatible formats **37. The Facade pattern provides:** a) A complex, multi-layered interface b) A simplified interface to a complex subsystem c) Multiple entry points for the system d) A way to wrap multiple classes with additional behavior **38. Which of the following is a Behavioral design pattern?** a) Adapter b) Iterator c) Singleton d) Factory **39. Which design pattern is best for providing a global point of access while ensuring controlled access to an object?** a) Proxy b) Adapter c) Builder d) Composite **40. The Observer pattern allows objects to:** a) Be dependent on each other b) Be notified and updated automatically upon changes c) Have multiple instances d) Share state across instances **41. In the Chain of Responsibility pattern, how are requests handled?** a) By passing the request to multiple objects b) By directly invoking methods in a class c) By handling the request at the first point of contact d) By creating a new instance for each request **42. Which of the following is an example of a Creational design pattern?** a) Proxy b) Strategy c) Abstract Factory d) Observer **43. The Flyweight pattern is useful for:** a) Controlling object creation b) Sharing state between many objects to save memory c) Creating families of objects d) Ensuring only one instance of a class exists **44. The Prototype pattern can be used when:** a) A new object needs to be copied from an existing one b) You want to share state across objects c) You need to create multiple instances dynamically d) You want to control access to an object **45. The main goal of the Strategy pattern is to:** a) Dynamically select an algorithm at runtime b) Share behavior across objects c) Simplify object creation d) Provide a global point of access **46. Which pattern is responsible for controlling the access to a certain object?** a) Proxy b) Singleton c) Abstract Factory d) Decorator **47. The purpose of the Iterator pattern is to:** a) Traverse elements of a collection without exposing the underlying structure b) Convert one interface into another c) Add responsibilities to an object dynamically d) Manage memory efficiently **48. Which pattern defines a subscription mechanism to notify multiple objects about changes?** a) Strategy b) Observer c) Prototype d) Builder **49. In the Facade pattern, the client interacts with:** a) A complex set of subsystems directly b) A simplified interface provided by the Facade c) Multiple classes at once d) One object that represents many **50. Which pattern allows objects to change their behavior based on their state?** a) State b) Factory c) Composite d) Singleton

Use Quizgecko on...
Browser
Browser