Question
Design the authorization and secure-sharing layer for an enterprise file-storage product with 50M users and billions of files. It must answer 'can user U do action A on file F?' in under 10ms for 1M checks/s, support nested folders with permission inheritance, group/role grants, and public/expiring share links, and propagate a permission revocation quickly. Threat model: confused-deputy and IDOR bugs, over-broad share links, and a revoked user retaining access via a cached grant or an old link. Cover the permission model, the inheritance/evaluation engine, share links, and revocation propagation.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.