SOFTWARE DESIGN 11.
What is the purpose of the
requirements analysis phase in
1. Which of the following is the first SDLC?
phase in the Software Development Answer: The goal is to understand
Life Cycle (SDLC)? what the software should accomplish
Answer: Requirements and document it clearly.
Gathering/Analysis 12. Which of the following best describes
2. Which design pattern restricts the modular design?
instantiation of a class to one object? 13. Which design pattern involves using
Answer: Singleton Pattern an intermediary to communicate
3. In Python, which keyword is used to between two classes?
define a class? Answer: Mediator Pattern
Answer: class 14. Why is it important to follow coding
4. What is the primary focus of the standards when structuring a
Object-Oriented Design (OOD)? modular codebase?
Answer: To design software using Answer: To ensure consistency,
objects that encapsulate data and readability, maintainability, and
behavior. easier collaboration among
5. Which UML diagram is used to developers.
represent classes and their 15. What does the “L” in the SOLID
relationships? principles represent?
Answer: Class Diagram Answer: Liskov Substitution
6. Which SDLC model follows a linear Principle
sequential approach? 16. Which of the following is an
Answer: Waterfall Model advantage of object-oriented design?
7. What does SOLID stand for in Answer: Improved maintainability
software design principles? and reusability through
Answer: S: Single Responsibility encapsulation, inheritance, and
Principle polymorphism.
O: Open-Closed Principle 17. What is a use case diagram used for
L: Liskov Substitution in software design?
Principle Answer: To capture the functional
I: Interface Segregation requirements of a system and the
Principle interactions between users and the
D: Dependency Inversion system.
Principle 18. Which of the following describes
8. What is the purpose of the Factory encapsulation in object-oriented
design pattern? programming?
Answer: Provides an interface for Answer: The bundling of data
creating objects in a super class but (attributes) and methods (functions)
allows subclasses to alter the type of that operate on the data into a single
objects that will be created. unit, or object. This helps protect the
9. Which of the following is NOT an data from unauthorized access.
Object-Oriented Principle? 19. What is a key feature of the Agile
Answer: OOP include SDLC model?
Encapsulation, Inheritance, and Answer: Iterative development with
Polymorphism. frequent feedback from users and
10. In Python, which symbol is used to stakeholders.
denote private attributes in a class? 20. Which of the following best describes
Answer: Double underscore (__) the Singleton pattern?
Answer: A design pattern that 31. Given the following class diagram,
ensures a class has only one instance what relationship does class B have
and provides a global point of access with class A?
to that instance. 32. You are analyzing the requirements
21. Which of the following would be the for a project. Which of the following
best use of the Factory pattern? would be considered a non-
Answer: When the object creation functional requirement?
process can be complex or involves 33. A function in Python returns
logic based on conditions. different results depending on its
22. How would you use inheritance to input type (e.g., integer vs. string).
model a system of animals where Which OOP concept is this an
each animal has unique behaviors? example of?
Answer: Create a base Animal class Answer: Polymorphism
with common attributes and 34. A project team is using the Agile
methods, and then create subclasses model for a fast-paced project. What
for each specific type of animal. would be the key advantage of this
23. Which SDLC model would you approach?
recommend for a project with fixed Answer: Flexibility to adapt to
requirements and strict deadlines? changing requirements and frequent
Answer: Waterfall Model delivery of working software.
24. In OOP, what would you do to allow 35. You observe that a class is becoming
a method in a subclass to have a too large with too many
different implementation than in its responsibilities. Which principle of
parent class? SOLID is being violated?
Answer: The method in the subclass. Answer: Single Responsibility
25. What kind of testing is focused on Principle (SRP)
testing individual components or 36. In the context of object-oriented
modules? design, how does composition differ
26. You are implementing the Observer from inheritance?
design pattern in Python. Which Answer: Composition involves
problem does this pattern solve? creating objects with instances of
Answer: It allows a subject to notify other objects (has-a relationship),
its observers about changes without while inheritance involves creating
knowing who or what the observers new classes that inherit behavior
are. from parent classes (is-a
27. In which phase of the SDLC would relationship).
you use a class diagram? 37. You’re tasked with improving code
Answer: System Design Phase performance by reducing
28. What does the Open-Closed redundancy. Which software design
Principle (OCP) of SOLID advocate? principle is most applicable?
29. You need to ensure that logging is Answer: DRY (Don't Repeat
consistent across your Python Yourself)
application. Which design pattern 38. Given two classes, Vehicle and Car,
would you implement? where Car inherits from Vehicle,
Answer: Singleton Pattern which of the following would be true
30. What kind of diagram would be used if you followed the Liskov
to describe how data flows through a Substitution Principle?
system? Answer: A Car object should be able
Answer: Data Flow Diagram (DFD) to replace a Vehicle object without
affecting the correct behavior of the 48. Create a class diagram for a system
program. that involves multiple users with
39. When reviewing a use case diagram, different roles (e.g., Admin, Editor,
you notice that all interactions Viewer). Which object-oriented
between users and the system are principle would you prioritize?
captured except for system errors. 49. You are tasked with building a
Which requirement has likely been scalable Python application. How
overlooked? would you apply the Singleton
40. In SDLC, if the client’s requirements pattern to ensure scalability in a
change frequently, which model logging system?
would be least suitable for 50. You are tasked with designing a user
development? authentication system in Python
41. You are evaluating a class that using object-oriented principles.
violates the Open-Closed Principle Which features would you
by constantly being modified for new implement, and how would you
features. What would be the best ensure security?
refactoring strategy?
42. During a code review, you identify
that a class is directly instantiating
dependencies instead of relying on
abstractions. Which SOLID
principle is being violated?
Answer: Dependency Inversion
Principle (DIP)
43. You are tasked with evaluating two
modular designs. One uses small,
highly focused modules, while the
other uses larger, monolithic
modules. Which is more
maintainable and why?
44. Which of the following is a key
advantage of applying design
patterns to software development?
45. A design team decides to implement
the Adapter pattern. How would you
evaluate whether this was a good
decision?
46. You are asked to create a new
software component that must evolve
frequently. Which SDLC model
would you choose and why?
Answer: Agile Model, because it
allows for iterative development and
frequent changes based on evolving
requirements.
47. You are designing a modular system
and need to implement security in
each module. Which approach
would you take?