DTCC Interview Question

A query in SQL. Monte carlo method. Grreks