CS FundamentalsHardProduct-company design interview
Student and Course have a many-to-many association with an association class Enrollment holding the grade. If 30 students each enrol in 4 courses, how many Enrollment objects exist?
- A. 34
- B. 120
- C. 4
- D. 30
Correct answer: B. 120
An association class has one instance per link, i.e. per (student, course) pair actually related: 30 x 4 = 120. It is not per class (2) or per side (34).
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A change to how GST is calculated forces small edits in nine different classes across the code base. Which code smell is this, and how…
- Match each code smell with the refactoring that usually fixes it. P: a method takes 9 parameters, several of which always travel together…
- Using the Chidamber-Kemerer metric CBO (coupling between objects: the number of other classes a class is coupled to, counting both classes…
- Class Cart has 5 methods. Together they call 9 methods of other classes, of which 7 are distinct. What is its Response For a Class (RFC) =…
- A class has four methods with cyclomatic complexities 1, 3, 2 and 4. Using the CK metric Weighted Methods per Class (WMC) with cyclomatic…
- David Parnas's information-hiding principle says how a system should be divided into modules. Which statement captures it?