100 people grab 10 red envelopes, how to ensure that red envelopes will not be snatched by the same person many times?

such as the question: 100 people grab 10 red packets, how to ensure that the red packets will not be snatched by the same one many times? This is the first interview question

Mar.07,2021

are there any traps?


queue, puts 10 red packets into the queue and takes out one red packet from the queue when accepting the request.


this question is not very clear. Is the same red packet not snatched by multiple people? Or can't everyone grab the red packet many times? Or is there both

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e484c2-439da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e484c2-439da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?