How does oversubscribed IPO allotment work?

When demand exceeds available shares, the registrar conducts a computerized lottery. Each applicant has an equal chance of selection, regardless of application size within their category.