I took so many attempts for the RPA practice questions, the only question I did wrong is this particular question, can someone help me for the explanation?
I think the documentation on queues give the best explanation of how queues are processed:
Processing Order Within any given queue the transactions are processed in a hierarchical manner, according to this order:
Items that have a Deadline, as follows: a. in order of Priority; and b. according to the set Deadline for items with the same Priority.
Items with no Deadline, in order of Priority, and a. according to the rule First In, First Out for items with the same Priority.
So basically, if the item has a deadline value then it will run the task according to that date deadline using the priority. Your example should then grab Ref1 because of the priority, then Ref3 because of the early date, then Ref2, then Ref4. When the item does not have a deadline, it simply uses the first-in-first-out method and processes them in order so Ref4 priority doesn't matter.