Bird
Raised Fist0

In an LLD review, if a method is documented as getData(): List but the implementation returns a Map, what is the likely outcome?

medium๐Ÿ“ Analysis Q5 of Q15
LLD - Advanced LLD Concepts
In an LLD review, if a method is documented as getData(): List but the implementation returns a Map, what is the likely outcome?
APerformance optimization
BDesign inconsistency error
CNo issue, both are collections
DSyntax error in code
Step-by-Step Solution
Solution:
  1. Step 1: Compare documented and actual return types

    Document says List, implementation returns Map, types differ.
  2. Step 2: Identify impact of mismatch

    This causes inconsistency between design and code, leading to errors or confusion.
  3. Final Answer:

    Design inconsistency error -> Option B
  4. Quick Check:

    Return type mismatch = A [OK]
Quick Trick: Match documented and implemented types exactly [OK]
Common Mistakes:
MISTAKES
  • Ignoring type mismatches
  • Assuming collections are interchangeable
  • Overlooking documentation accuracy

Want More Practice?

15+ quiz questions ยท All difficulty levels ยท Free

Free Signup - Practice All Questions
More LLD Quizzes