Bird
0
0

Consider this simplified pseudocode for Lambda architecture layers:

medium📝 Predict Output Q13 of 15
Hadoop - Modern Data Architecture with Hadoop
Consider this simplified pseudocode for Lambda architecture layers:
batch_result = batch_layer(data)
speed_result = speed_layer(stream)
final_result = merge(batch_result, speed_result)
print(final_result)
If batch_layer returns {'count': 100} and speed_layer returns {'count': 5}, what will final_result be after merging by summing counts?
A{'count': 105}
B{'count': 100}
C{'count': 5}
DError: Cannot merge dictionaries
Step-by-Step Solution
Solution:
  1. Step 1: Understand merging logic

    Merging sums the 'count' values from batch and speed results: 100 + 5 = 105.
  2. Step 2: Confirm final result

    The final dictionary after merging is {'count': 105}.
  3. Final Answer:

    {'count': 105} -> Option A
  4. Quick Check:

    100 + 5 = 105 [OK]
Quick Trick: Sum batch and speed counts for final result [OK]
Common Mistakes:
  • Ignoring speed layer result
  • Assuming merge replaces batch with speed
  • Thinking merge causes error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes