Bird
Raised Fist0

Which of the following is the CORRECT syntax to document a class method's input and output in an LLD document?

easy๐Ÿง  Conceptual Q3 of Q15
LLD - Advanced LLD Concepts
Which of the following is the CORRECT syntax to document a class method's input and output in an LLD document?
AcalculateSum: inputs are a and b, output is sum
BMethod: calculateSum(a: int, b: int) -> int: Returns sum of a and b
CFunction calculateSum inputs a and b outputs sum
DcalculateSum(a, b) returns sum
Step-by-Step Solution
Solution:
  1. Step 1: Identify proper method documentation format

    Clear input types and output types with description is best practice.
  2. Step 2: Compare options for clarity and completeness

    Method: calculateSum(a: int, b: int) -> int: Returns sum of a and b uses parameter types and return type explicitly, making it clear.
  3. Final Answer:

    Method: calculateSum(a: int, b: int) -> int: Returns sum of a and b -> Option B
  4. Quick Check:

    Correct method doc syntax = D [OK]
Quick Trick: Use explicit types and return values in method docs [OK]
Common Mistakes:
MISTAKES
  • Omitting types
  • Using vague descriptions
  • Not specifying return type

Want More Practice?

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

Free Signup - Practice All Questions
More LLD Quizzes