Better Programming

Advice for programmers.

Member-only story

Optimizations Beyond the Big O — Performance Tricks I Learned at Google

Minhaz
12 min readJul 11, 2022

--

Photo by Pixabay on Pexels.

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.

--

--

Minhaz
Minhaz

Written by Minhaz

Staff Software Engineer @Google. Leading teams democratising On device AI for for masses. Writes about programming generics & specifics.