CS 101
Stack Overflow
I Learned This At 3am
100

What does CPU stand for?

Central Processing Unit

100

You're waiting in line at Chipotle. What data structure does that represent?

Queue — first in, first out

100

What does it mean when an algorithm is O(n)?

Its runtime grows linearly — double the input, double the time

200

What does HTML stand for?

HyperText Markup Language

200

You hit "undo" in VSCode. What data structure makes that possible?

Stack — last action is the first to undo

200

You're searching for a name in a sorted list of 1 million people. Why is binary search way better than checking one by one?

Binary search cuts the list in half each time — O(log n) vs O(n)

300

What's the difference between RAM and a hard drive?

RAM is temporary/fast, hard drive is permanent storage

300

Why would you use a dictionary/hashmap over a regular list?

Faster lookups on average — O(1) vs O(n) — because you search by key directly instead of scanning through every element

300

What's the difference between recursion and a regular loop?

Recursion = function calls itself, loop = repeats a block. Recursion is cleaner for problems that naturally split into smaller versions of themselves

400

What does it mean for a function to "return" something?

It sends a value back to whoever called it

400

You're building a feature that checks if a user's code has matching brackets. What data structure do you reach for and why?

Stack — push open brackets, pop when you see a closing one

400

Why do we sort data before doing certain operations on it?

Makes searching faster — binary search, merging, and comparisons all rely on order

500

What's the difference between a compiled language and an interpreted language?

Compiled = translated all at once before running, interpreted = translated line by line as it runs

500

Your app is slow. Someone says "maybe it's the data structure you're using." What does that actually mean?

Different structures have different time complexities — wrong choice = slower reads, writes, or searches)

500

What's the difference between breadth first search and depth first search?

BFS = explore level by level, good for shortest path. DFS = go as deep as possible first, good for exploring all possibilities