Optimization challenges practice problems

14 problems · 0 solved

Each problem gives you a correct but slow Python loop. Your job is to make it fast without changing the answer. Small tests check correctness, and the last test runs your function on a large input and checks the time against a fixed pure Python loop measured on your own device, so the limit is fair on slow laptops and phones. You will practise broadcasting, cumulative sums, bincount, sliding windows and fancy indexing on tasks from real ML code: distance matrices, rolling means, convolutions, box IoU, k-means assignment, packed-sequence pooling, int8 quantization and attention masks.

Easy 6

Medium 7

Hard 1

Related topics

All practice problems