Big-O & Your Two Workhorses

Post-graduation: the interview module

You built the PawWalk backend. Now let's get you through the coding interview that stands between you and the job. This module is data structures and problem-solving β€” the LeetCode-shaped questions β€” done in real Go, anchored in PawWalk where it helps.

Big-O is just how the work grows as the input grows. O(1) is constant β€” same cost no matter the size. O(n) scales linearly with the number of items. O(n log n) is a good sort. O(n^2) is two nested loops over the same data β€” fine at 100 items, a disaster at ten million. When an interviewer asks 'can you do better?', they mean 'can you lower that exponent?'