I had an interview. The interviewer asked me:
If two nodes are sending two messages of the same identifier (0x100) with different data, who will win the arbitration? Which message will be there on the bus?
If node 1 wins then what about node 2's message? When will node 2's message be sent?
There are two cases here
CASE 1: when two nodes are trying to transmit the same ID and the same data field, the CAN will see it as a single message, and it will send it on the CAN bus. Here you really can't say if node 1 is sending or node 2 is sending, because both has the same ID and data.
CASE 2: here the data field is different. Until the arbitration field there will be no problem. Since the data is different for both the nodes you will get a bus error. This is because your data field is protected by a CRC and bit stuffing also will come into the picture.