Question 1: What does UML stand for?
A. Universal Modeling Language
B. Unified Modeling Language
C. Unique Modeling Logic
D. Unified Module Language
Answer: B
Explanation: UML stands for Unified Modeling Language, a standard language for specifying, visualizing,
constructing, and documenting the artifacts of software systems.
Question 2: What is the primary purpose of UML in software development?
A. Coding algorithms
B. Modeling system structures and behaviors
C. Database design only
D. Hardware configuration
Answer: B
Explanation: UML is used to model both the structure and behavior of a system to facilitate clear
communication and design.
Question 3: Which UML diagram type is used to represent system classes and their relationships?
A. Use Case Diagram
B. Class Diagram
C. Activity Diagram
D. Deployment Diagram
Answer: B
Explanation: Class diagrams illustrate classes, attributes, operations, and relationships among classes in
a system.
Question 4: Which diagram best shows object instances at a specific moment in time?
A. Object Diagram
B. Sequence Diagram
C. State Machine Diagram
D. Component Diagram
Answer: A
Explanation: Object diagrams represent a snapshot of instances and their relationships at a particular
moment.
Question 5: What type of UML diagram focuses on the physical deployment of artifacts on nodes?
A. Package Diagram
B. Component Diagram
C. Deployment Diagram
D. Composite Structure Diagram
Answer: C
Explanation: Deployment diagrams show how software artifacts are physically deployed on hardware
nodes.
,Question 6: Which of the following is not a structural diagram in UML?
A. Class Diagram
B. Activity Diagram
C. Component Diagram
D. Package Diagram
Answer: B
Explanation: Activity diagrams are behavioral, not structural.
Question 7: In a Use Case Diagram, which element represents a role that interacts with the system?
A. Component
B. Actor
C. Node
D. Interface
Answer: B
Explanation: Actors represent roles played by users or external systems interacting with the system.
Question 8: Which diagram type emphasizes interactions between objects over time?
A. Sequence Diagram
B. Communication Diagram
C. State Machine Diagram
D. Deployment Diagram
Answer: A
Explanation: Sequence diagrams detail the time-ordered flow of messages between objects.
Question 9: What does a state machine diagram model?
A. Physical components
B. Object interactions
C. State-dependent behavior
D. Class structures
Answer: C
Explanation: State machine diagrams model the states an object goes through and transitions based on
events.
Question 10: Which UML diagram is best suited for modeling workflows and business processes?
A. Activity Diagram
B. Class Diagram
C. Component Diagram
D. Use Case Diagram
Answer: A
Explanation: Activity diagrams illustrate the flow of activities and decision points in workflows.
Question 11: Which relationship represents a “has-a” relationship where parts can exist
independently?
A. Composition
B. Aggregation
C. Inheritance
D. Realization
,Answer: B
Explanation: Aggregation represents a whole-part relationship where the part can exist separately from
the whole.
Question 12: What is the main difference between aggregation and composition?
A. Aggregation is a strong ownership, composition is weak
B. Composition indicates a lifecycle dependency, aggregation does not
C. Aggregation is only used in behavioral models
D. There is no difference
Answer: B
Explanation: In composition, the child’s lifecycle is tied to the parent, whereas in aggregation, the parts
can exist independently.
Question 13: In UML, which element represents a blueprint for creating objects?
A. Interface
B. Package
C. Class
D. Component
Answer: C
Explanation: A class serves as a template or blueprint for objects.
Question 14: What do attributes in a class diagram represent?
A. Behaviors of an object
B. Characteristics or properties of an object
C. Inheritance relationships
D. System use cases
Answer: B
Explanation: Attributes represent the data or properties held by an object.
Question 15: Which UML element defines a contract for behavior without implementation?
A. Class
B. Interface
C. Object
D. Package
Answer: B
Explanation: Interfaces specify a set of operations that a class must implement, defining behavior
without implementation details.
Question 16: In a sequence diagram, what do the vertical lifelines represent?
A. Time progression for each object
B. Inheritance hierarchy
C. Aggregation relationships
D. Package dependencies
Answer: A
Explanation: Lifelines represent the passage of time for individual objects in the diagram.
, Question 17: Which diagram would you use to model the collaboration between objects to accomplish
a task?
A. Sequence Diagram
B. Communication Diagram
C. Object Diagram
D. Class Diagram
Answer: B
Explanation: Communication diagrams focus on how objects interact and collaborate via messages.
Question 18: What is a use case in UML?
A. A detailed description of class attributes
B. A scenario that describes system functionality
C. A type of deployment diagram
D. A software coding standard
Answer: B
Explanation: Use cases describe functional requirements and interactions between actors and the
system.
Question 19: What relationship in use case modeling indicates that one use case is always called by
another?
A. Extend
B. Include
C. Generalization
D. Aggregation
Answer: B
Explanation: The include relationship shows that one use case always includes the functionality of
another.
Question 20: In UML, what does an extend relationship indicate?
A. Mandatory behavior
B. Optional or conditional behavior
C. Inheritance of attributes
D. Synchronous message passing
Answer: B
Explanation: An extend relationship adds optional or conditional behavior to a base use case.
Question 21: What modeling concept emphasizes hiding implementation details?
A. Inheritance
B. Abstraction
C. Encapsulation
D. Polymorphism
Answer: C
Explanation: Encapsulation hides the internal state and implementation details from the outside world.
Question 22: Which concept involves creating a simplified representation of a complex system?
A. Specialization
B. Abstraction