Automation and Artificial Intelligence

An inventory requires a devices object keyed by device ID, with each device containing a ports object keyed by port name. Each port must hold a rates array of numbers in receive-then-transmit order; which document records receive 10 and transmit 20 for R1 port Gi1?

Show the answer

Correct answerD. {"devices":{"R1":{"ports":{"Gi1":{"rates":[10,20]}}}}}

AWhy not this: The ports member contains an array rather than an object keyed by port name.

BWhy not this: The devices member contains an array rather than an object keyed by device ID.

CWhy not this: The rates array reverses the required receive-then-transmit order.

DWhy this is right: Both keyed collections are objects, and the numeric rates appear in receive-then-transmit order.

Nested objects provide the required device and port keys, while the rates array preserves receive-then-transmit order. An array containing a device object is valid JSON but does not satisfy the required devices object structure.