Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: µs Clear Filter

Hashed sorting is typically faster than hash tables

Hashed sorting is typically faster than hash tables Problem statement: count the unique values in a large array of mostly-unique uint64s. Two standard approaches are: Insert into a hash table and return the number of entries. Sort the array, then count positions that differ from their predecessor. Hash tables win the interview ( O ( n ) O(n) O(n) vs O ( n log ⁡ n ) O(n \log n) O(nlogn)), but sorting is typically faster in a well-tuned implementation. This problem and its variants are the inn

Topics: hash ms radix sort µs

Optimizing FizzBuzz in Rust

Optimizing FizzBuzz in Rust for Fun and Profit My little cousin is learning Python, and wanted to know about what kinds of questions he could expect to get in coding interviews. I started him off with good ol' FizzBuzz: obsolete for any actual coding interview today (at least, I hope), but good at his level. After a little back and forth getting reminded about how to create range iterators and fixing the order, he landed on this implementation: def basic_fizzbuzz(): for i in range(1, 101): if

Topics: 00 100 let string µs

Complex Iterators Are Slow

Complex Iterators are Slow Thursday, 31 July 2025 Timi, my pure JavaScript B-Tree, achieves best in class iteration speed in part because I replaced Iterators with callbacks. They might be convenient, but the design of JavaScript Iterators is inherently slow for complex iteration as it prevents your compiler from inlining code. Inlining is when the call site of a function is replaced with its body to avoid the overhead of a function call. So, this: function add(a, b) { return a + b; } for (