Member-only story
Optimizations Beyond the Big O — Performance Tricks I Learned at Google
I did learn many of these at university, but either didn’t fully understand them or forgot due to lack of practice. Using it at work was a game changer!
For many of us in the field of computer science, our early education in this area starts with the concept of big O or big Omega(Ω).
Big O is used in computer science to describe the performance or complexity of an algorithm. Big O is used to describe the worst case complexity of algorithms while Big Omega is used to describe the best case complexity.
For many of us, it might be our biggest nightmare as well. Software engineering interviews often involve technical questions which requires interviewee to come up with optimised algorithms within a strict timeframe.
A single programming problem can be solved in several ways so the key aspect is often to reduce the time and space complexity — the big O.
A quick example of this would be — searching for an element in a sorted array.
- The brute-force algorithm has O(N) complexity.
- OTOH, a binary search would have O(logN) complexity.