My guess is that there is every possible combination of items that is added to the cart, and then the API response returns what items are unavailable/out of stock.
Honestly, I'm not in love with this post for HN. It seems like something done and communicated for twitter clout and is devoid of interesting details.