Compute x^y for Floats and Negative Exponents: Fast Exponentiation
5 min read Compute x^y for Floats and Negative Exponents: Fast Exponentiation Computing pow(x, y) efficiently is LeetCode #50 and a frequently-asked interview […] Read article
5 min read Compute x^y for Floats and Negative Exponents: Fast Exponentiation Computing pow(x, y) efficiently is LeetCode #50 and a frequently-asked interview […] Read article
6 min read Reverse a Doubly Linked List: Iterative, Recursive, and the Common Mistakes Reversing a doubly linked list (DLL) is a classic Read article
6 min read Two Sum: Find a Pair in an Array That Sums to a Target Two Sum is the most-asked coding interview Read article
2 min read I met three dragons. One always tells the truth, other one always lies and the last one alternates between lie Read article
5 min read Right Rotate an Array by K Elements: Three-Reverse, Cyclic Replacements, and Modulus Tricks Rotating an array by k positions is Read article
5 min read Bayesian Weather Forecasting: How Forecasts Update with Evidence “How do you forecast tomorrow’s weather given today’s observation?” is a classic Read article
2 min read A half is a third of it. What is it? 2026 Update: The Half-Full Glass — Estimation and Fermi Problems Read article
1 min read When was the last year that looked the same upside down? (1961) 2026 Update: Strobogrammatic Numbers — Rotation Invariant Digits Read article
2 min read A book costs $1 plus half its price. How much does it cost? 2026 Update: The Interview Icebreaker — How Read article
4 min read Question: You have two identical eggs. Standing in front of a 100 floor building, you wonder what is the maximum Read article
3 min read Suppose you had a Stack class. Write a new class MaxStack which, in addition to push() and pop(), has a Read article
1 min read How can you get a fair coin toss if someone hands you a coin that is weighted to come up Read article
2 min read What is the most efficient way, memory-wise, to store 1 million phone numbers? Apparently this is an interview question at Read article
3 min read A typical programming interview question is “reverse a string, in place”. if you understand pointers, the solution is simple. even Read article
3 min read Problem: you have 100 doors in a row that are all initially closed. you make 100 passes by the doors Read article