Latest / CyberSecurity Summary / A Common-Sense Guide to Data Structures and Algorithms: Level Up Your Core Programming Skills
Transcript
- 0:00Speaker 1: Welcome to today's deep dive. If you use web or
- 0:03Speaker 1: mobile apps, or if you're someone who wants to write
- 0:05Speaker 1: code that just doesn't instantly crash under heavy user loads,
- 0:08Speaker 1: today is definitely for you.
- 0:10Speaker 2: Yeah. Absolutely.
- 0:11Speaker 1: We are on a mission to take the fear and honestly,
- 0:14Speaker 1: the heavy mathematical jargon out of computer science. We're going
- 0:19Speaker 1: to be exploring excerpts from Jay Weng GROW's brilliant book,
- 0:22Speaker 1: A Common Sense Guide to Data Structures and Algorithms.
- 0:26Speaker 2: And you know when GROW's work is just an incredible
- 0:29Speaker 2: resource for this mission. It totally strips away all the
- 0:32Speaker 2: academic pretense, right, it really grounds software engineering in practical reality.
- 0:37Speaker 1: Okay, let's unpack this. Wehenrose starts with a really grounding
- 0:40Speaker 1: premise that all programs from like a simple little background
- 0:44Speaker 1: stripped on your laptop, all the way up to massive
- 0:46Speaker 1: enterprise software running global supply chains, they all run on data.
- 0:49Speaker 2: Yep, every single one.
- 0:51Speaker 1: And his argument is that everything about algorithms and data
- 0:54Speaker 1: organization it just boils down to common sense. You don't
- 0:57Speaker 1: need advanced calculus. You literally just need basic arithmetic to
- 1:01Speaker 1: master this stuff exactly.
- 1:03Speaker 2: I mean, data structures is just this intimidating term for
- 1:06Speaker 2: how data is physically and logically organized within a computer.
- 1:10Speaker 2: That is the entire secret.
- 1:12Speaker 1: It sounds so much scarier than it is.
- 1:14Speaker 2: It really does, But my core belief has always been
- 1:17Speaker 2: that knowledge is well, it's most valuable when it's understood
- 1:22Speaker 2: and applied to real systems. Right right, Choosing the right
- 1:25Speaker 2: data structure isn't just some exercise to pass a whiteboard interview.
- 1:29Speaker 2: It literally dictates whether your application survives the real world
- 1:33Speaker 2: or you know, collapses the moment a thousand people try
- 1:36Speaker 2: to hit the same database table simultaneously.
- 1:39Speaker 1: Which happens a lot. But before we can actually evaluate
- 1:41Speaker 1: the structures themselves, we have to establish how we measure
- 1:44Speaker 1: their success. Right, Oh, absolutely, because we can't objectively know
- 1:48Speaker 1: which structure is better if we don't have a reliable
- 1:51Speaker 1: metric for speed in the context of computing.
- 1:54Speaker 2: Yeah, if we don't have a reliable hardware agnostic metric,
- 1:57Speaker 2: we're just comparing apples to oranges. Right. A lot of
- 2:00Speaker 2: people outside of computer science assume we measure code speed
- 2:03Speaker 2: in like pure time seconds, milliseconds, microseconds, but the.
- 2:07Speaker 1: Book introduces the concept of time complexity to explain why
- 2:12Speaker 1: measuring code speed in pure time on a clock is
- 2:15Speaker 1: fundamentally flawed.
- 2:17Speaker 2: Yeah, it's a huge trap because you.
- 2:18Speaker 1: Could write an incredibly inefficient piece of code, but if
- 2:21Speaker 1: you run it on a state of the art server farm,
- 2:24Speaker 1: it might execute in a fraction of a second exactly.
- 2:27Speaker 1: But then take that exact same code and run it
- 2:29Speaker 1: on like a five year old smartphone, and it might
- 2:32Speaker 1: freeze the device for ten seconds.
- 2:33Speaker 2: Right, because modern hardware actually masks a lot of terrible
- 2:36Speaker 2: coding practices.
- 2:37Speaker 1: Oh totally.
- 2:38Speaker 2: A massive cloud computing INCIDNSE can just brute force its
- 2:42Speaker 2: way through a highly inefficient algorithm, but the developer only
- 2:46Speaker 2: finds out how bad their code is when the monthly
- 2:50Speaker 2: cloud hosting bill arrives.
- 2:51Speaker 1: Ouch. Yeah, that's the worst way to find out.
- 2:53Speaker 2: It really is. Time is relative to the hardware processor,
- 2:56Speaker 2: the available RAM, and even what other applications are running
- 3:00Speaker 2: in the background. It is a really flaky, inconsistent measurement.
- 3:04Speaker 1: So instead, computer science measures speed by the absolute number
- 3:07Speaker 1: of computational steps and operation requires. Yes, it reminds me
- 3:11Speaker 1: of giving directions like if I tell you my commute
- 3:14Speaker 1: to work takes twenty minutes, that information is actually kind
- 3:17Speaker 1: of useless for you to replicate right because it changes exactly.
- 3:20Speaker 1: It changes depending on traffic, the weather, or whether I
- 3:23Speaker 1: hit every red light. But if I tell you my
- 3:25Speaker 1: commute is exactly three turns in two straightaways, that is
- 3:29Speaker 1: a measure of steps. I love that analogy, thanks, because
- 3:32Speaker 1: those physical steps never change regardless of whether I'm driving
- 3:34Speaker 1: a sportscar riding a bicycle.
- 3:36Speaker 2: What's fascinating here is how this completely levels the playing
- 3:39Speaker 2: field for analysis ow so well. By shifting our focus
- 3:43Speaker 2: from variable seconds to fixed steps, which we refer to
- 3:46Speaker 2: conceptually through time complexity or big O notation, we can
- 3:50Speaker 2: definitively say operation A is fundamentally better than operation B,
- 3:55Speaker 2: always always, on any hardware. If operation A takes five
- 4:00Speaker 2: steps to complete a task and operation B takes five
- 4:02Speaker 2: hundred steps, operation A wins, right.
- 4:05Speaker 1: And when we scale that up to millions of beta points,
- 4:07Speaker 1: that step difference is literally the barrier between a fast
- 4:11Speaker 1: application and an application that crashes the server. So now
- 4:14Speaker 1: that we are counting computational steps, let's put a specific
- 4:18Speaker 1: data structure to the test. Let's start with the most
- 4:21Speaker 1: foundational tool in the programmer's toolbox, the array.
- 4:24Speaker 2: Good place to start.
- 4:25Speaker 1: We all know arrays are just basic zero indexed lists
- 4:29Speaker 1: of data. But the hidden tax and the performance implications
- 4:32Speaker 1: they come entirely from how a computer's memory physically accommodates them.
- 4:36Speaker 2: Yeah, the physical architecture of randmaxis memory is the defining
- 4:41Speaker 2: constraint here.
- 4:42Speaker 1: Right.
- 4:42Speaker 2: Think of a computer's memory as a massive continuous grid
- 4:46Speaker 2: of empty cells, just millions of tiny storage lockers in.
- 4:50Speaker 1: A row, Okay, I'm picturing it.
- 4:52Speaker 2: And every single one of those memory cells has a
- 4:54Speaker 2: sequential address, very much like a street address. You might
- 4:57Speaker 2: have memory cell one thousand and one, thousand and one,
- 4:59Speaker 2: one thousand and two, and so on.
- 5:01Speaker 1: So when you create an array in your code, the
- 5:03Speaker 1: operating system has to find a contiguous block of empty
- 5:06Speaker 1: memory cells.
- 5:06Speaker 2: Yes, contiguous is the keyword, right.
- 5:09Speaker 1: The cells have to be right next to each other
- 5:11Speaker 1: in physical space. If we have a simple array of
- 5:14Speaker 1: five items, say like an online grocery order containing apples, bananas, cucumbers, beats,
- 5:20Speaker 1: and elderberries, the OS locks down five adjacent memory addresses exactly.
- 5:26Speaker 2: Let's assume it places the start of our array index
- 5:28Speaker 2: zero the apples at memory address ten. Ten. Okay, the
- 5:32Speaker 2: computer permanently records that starting address, it knows. Okay, this
- 5:36Speaker 2: specific grocery array begins at address ten ten.
- 5:40Speaker 1: Now, the book breaks down how we interact with this
- 5:42Speaker 1: array into four main operations. The first one is retting, right.
- 5:46Speaker 1: This means looking up what is stored at a specific index. Say,
- 5:49Speaker 1: I want to know what the user put in their
- 5:51Speaker 1: cart at index three. It's easy to forget that computers
- 5:54Speaker 1: don't scan lists the way human reads a menu. No,
- 5:57Speaker 1: not really, because human eyes scan from top to bottom.
- 6:00Speaker 1: Computer just calculates memory addresses. How on earth does a
- 6:03Speaker 1: computer instantly jump to index three without looking at zero
- 6:06Speaker 1: one and two.
- 6:07Speaker 2: First, it's just because every cell is laid out sequentially,
- 6:10Speaker 2: and because the computer knows the starting address. Reading is
- 6:13Speaker 2: purely a mathematical function. Oh, I see, you want index three.
- 6:16Speaker 2: The computer takes the starting address of ten ten and
- 6:19Speaker 2: simply adds three. It instantly knows the data is located
- 6:23Speaker 2: at address ten thirteen.
- 6:24Speaker 1: Wow.
- 6:25Speaker 2: Yeah, it jumps directly to that address and retrieves the dates.
- 6:28Speaker 1: So when we say reading an array takes exactly one step,
- 6:30Speaker 1: it's because it's a single calculation. It doesn't even look
- 6:33Speaker 1: at index zero, one or two. It just does the
- 6:36Speaker 1: math and jumps to the destination exactly in.
- 6:39Speaker 2: The language of time complexity. We call this one or
- 6:42Speaker 2: constant time. Okay, whether your array has five items or
- 6:46Speaker 2: five million items, If you know the index, the computer
- 6:50Speaker 2: performs one edition problem and retrieves the data.
- 6:52Speaker 1: That's amazing.
- 6:53Speaker 2: It is the gold standard of performance. It heavily relies
- 6:57Speaker 2: on the concept of spatial locality. Central process units are
- 7:00Speaker 2: physically optimized to blast through contiguous blocks of memory faster
- 7:04Speaker 2: than anything else.
- 7:05Speaker 1: So reading is solved beautifully by memory addresses. But what
- 7:08Speaker 1: happens when the situation is inverted?
- 7:10Speaker 2: What do you mean?
- 7:11Speaker 1: Like, what if the user's search query is the data
- 7:14Speaker 1: itself and the index address is completely unknown? For example,
- 7:18Speaker 1: I know I want to find dates in this database,
- 7:20Speaker 1: but I have no idea where it lives in the array.
- 7:22Speaker 2: Uh. Yeah, that is a fundamentally different problem for the
- 7:25Speaker 2: CPU to solve. We've moved from the reading operation to
- 7:28Speaker 2: the searching operation.
- 7:29Speaker 1: Right because a computer doesn't have eyes to instantly spot
- 7:32Speaker 1: the word dates in a list. It just has those
- 7:35Speaker 1: memory addresses exactly according to the source. To find dates,
- 7:39Speaker 1: the computer has to start at index zero. It opens
- 7:42Speaker 1: the cell at ten ten and says, is this dates, No,
- 7:45Speaker 1: it's apples. Then it has to move to index one
- 7:47Speaker 1: is this dates, No, it's bananas.
- 7:49Speaker 2: Yeap has to check every single one.
- 7:50Speaker 1: Then index two cucumbers. Finally, at index three it finds dates.
- 7:55Speaker 2: It had to check four separate memory cells, meaning the
- 7:58Speaker 2: operation took four computational steps. Right, and this introduces a
- 8:03Speaker 2: critical concept in algorithm analysis. The worst case scenario.
- 8:06Speaker 1: Oh right, because when we look at the list our
- 8:09Speaker 1: eyes seed dates instantly. But what if the item is
- 8:12Speaker 1: at the very end of the list.
- 8:13Speaker 2: Exactly When we evaluate the efficiency of an operation, we
- 8:18Speaker 2: must assume the most pessimistic outcome to truly understand its
- 8:21Speaker 2: limits at scale.
- 8:22Speaker 1: So the worst case scenario for our five item array
- 8:25Speaker 1: is that the user searches for Elderberris, which is at
- 8:27Speaker 1: the very end, or they search for Figs, which isn't
- 8:30Speaker 1: in the array at all.
- 8:31Speaker 2: Right, In either case, the computer is sourced to check
- 8:34Speaker 2: every single cell from start to finish. Wow, it takes
- 8:37Speaker 2: five steps for a five item array. If the array
- 8:40Speaker 2: has n items where n represents any arbitrary number of elements,
- 8:44Speaker 2: this linear search takes a maximum of end steps. Okay,
- 8:47Speaker 2: an array of fifty thousand items takes fifty thousand steps.
- 8:50Speaker 2: This is linear time complexity. Orn, the number of steps
- 8:54Speaker 2: grows proportionately, literally step for step, with the size of
- 8:57Speaker 2: the data.
- 8:58Speaker 1: This highlights why developers often fall into a trap when
- 9:01Speaker 1: building applications. A developer might write a search function and
- 9:04Speaker 1: test it locally on their laptop using a dummy database
- 9:07Speaker 1: with like fifty rows.
- 9:09Speaker 2: Happens all the time.
- 9:10Speaker 1: Right, a linear search of fifty items take microseconds. It
- 9:13Speaker 1: feels instantaneous. They deploy the code thinking it's highly optimized.
- 9:16Speaker 2: But then six months later the application is successful and
- 9:20Speaker 2: the production database has grown to fifty million rows. Yikes,
- 9:23Speaker 2: Suddenly that exact same search function is executing fifty million
- 9:27Speaker 2: discrete memory checks every single time a user hits the
- 9:31Speaker 2: search button.
- 9:31Speaker 1: And the server just grinds to a halt completely.
- 9:34Speaker 2: This is why understanding the difference between one reading and
- 9:37Speaker 2: oan searching is so vital. You are projecting the trajectory of.
- 9:42Speaker 1: Scale, but finding data is really only half the battle.
- 9:46Speaker 1: Real world software is highly dynamic. Users are constantly adding
- 9:50Speaker 1: items to cards, deleting messages, updating feeds.
- 9:53Speaker 2: Yeah, mutating data is where the rigid, contiguous nature of
- 9:57Speaker 2: the array creates massive hidden costs. Let's look at the
- 10:01Speaker 2: operations of insertion and deletion. Okay, the physical constraints of
- 10:04Speaker 2: memory we discussed earlier. The absolute requirement that an array
- 10:07Speaker 2: must be a contiguous block of adjacent cells make mutating
- 10:10Speaker 2: an array very complex.
- 10:12Speaker 1: So if I want to insert figs to the very
- 10:14Speaker 1: end of my five item grocery list, that's essentially a
- 10:17Speaker 1: best case scenario, right, Okay. The computer knows where the
- 10:19Speaker 1: array starts and knows how long it is, so it
- 10:22Speaker 1: just calculates the address for the next empty space at
- 10:24Speaker 1: the end of the line and drops Figs in one step.
- 10:29Speaker 2: Inserting at the end is fast, but applications rarely just
- 10:32Speaker 2: append data to the end of a list. Right. Think
- 10:35Speaker 2: of a news feed or an email inbox. The newest
- 10:38Speaker 2: data is almost always inserted at the very top at
- 10:41Speaker 2: index zero.
- 10:42Speaker 1: Oh true. And if we try to insert figs at
- 10:45Speaker 1: index zero, the computer has a major physical problem. It
- 10:49Speaker 1: cannot just overwrite the apples that are already sitting there,
- 10:52Speaker 1: oh cap, And it has to keep all the data contiguous.
- 10:54Speaker 1: It can't skip a cell or fragment the array into
- 10:57Speaker 1: different parts of RAM, So to make a vacant slot
- 11:00Speaker 1: at index zero, a massive cleanup job begins.
- 11:04Speaker 2: The computer literally has to move the item at the
- 11:06Speaker 2: end of the array one sell to the right, then
- 11:09Speaker 2: the item before that. Wow, it shifts every single element
- 11:12Speaker 2: down the line one by one just to clear that
- 11:14Speaker 2: first memory address.
- 11:16Speaker 1: Here's where it gets really interesting. It's like pulling a
- 11:18Speaker 1: book out of the middle of a tightly packed shelf.
- 11:20Speaker 2: Oh I love that taking.
- 11:22Speaker 1: The actual book out or placing one in is just
- 11:24Speaker 1: one physical motion. But sliding all the remaining books over
- 11:28Speaker 1: so they don't fall down, or sliding them apart to
- 11:30Speaker 1: make a gap, that takes all the actual effort.
- 11:33Speaker 2: That's exactly it. And this is where modern high level
- 11:35Speaker 2: programming languages actually do developers a massive disservice by hiding
- 11:39Speaker 2: these mechanics behind simple syntax. What do you mean, Well,
- 11:43Speaker 2: if you are coding in Python or JavaScript, inserting an
- 11:47Speaker 2: item the beginning of an array is just a single
- 11:50Speaker 2: elegant line of code. You type a method call like
- 11:53Speaker 2: array dot, unshift and passing your data.
- 11:55Speaker 1: And because it only took the developer one second to type,
- 11:59Speaker 1: their brain subconcent maps that to one operation. It feels
- 12:02Speaker 1: like a single step, right, But.
- 12:04Speaker 2: The underlying runtime environment, the underlying C or C plus
- 12:08Speaker 2: engine that is actually executing your JavaScript or Python code
- 12:11Speaker 2: is sweating bullets. Laughs. Yeah, it is running a massive
- 12:14Speaker 2: background loop, physically shifting every single element in memory to
- 12:17Speaker 2: the right. If your array has ten thousand items, you
- 12:20Speaker 2: just trigger ten thousand memory shifts with a single line
- 12:23Speaker 2: of code.
- 12:23Speaker 1: Unbelievable. You have n shifts to make room, plus one
- 12:27Speaker 1: step to actually insert the new data. So worst case
- 12:30Speaker 1: insertion is n plus one steps exactly, and deletion is
- 12:34Speaker 1: basically that same hidden tax, but in reverse. If I
- 12:37Speaker 1: delete apples from the front of the list, removing it
- 12:40Speaker 1: takes one step. But now there is an empty gap
- 12:43Speaker 1: at index zero, and arrays are strictly forbidden from having internal.
- 12:47Speaker 2: Gaps, right, so the domino effect triggers again. The computer
- 12:50Speaker 2: must pull the item at index one to the left
- 12:52Speaker 2: to fill index zero, then pull index two to index one.
- 12:56Speaker 1: So removing the first email in an inbox of ten
- 12:59Speaker 1: thousand emails means the computer has performed nine ninety nine
- 13:03Speaker 1: memory shifts just to.
- 13:04Speaker 2: Plug the gap exactly.
- 13:06Speaker 1: That's wild. If an application allows users to delete batches
- 13:09Speaker 1: of emails or clear multiple notifications at once, a poorly
- 13:13Speaker 1: chosen array structure will accidentally command the CPU to execute
- 13:16Speaker 1: hundreds of thousands of shifting steps. Oh yeah, the applications
- 13:19Speaker 1: user interface will freeze entirely all because the developer didn't
- 13:22Speaker 1: realize the computational weight of maintaining contiguous memory.
- 13:26Speaker 2: And this forces us to ask, if shifting data is
- 13:28Speaker 2: so incredibly costly, how do we build dynamic systems? One
- 13:32Speaker 2: group points out that if you slightly alter the mathematical
- 13:35Speaker 2: rules of a data structure, you create entirely new tools
- 13:38Speaker 2: with entirely different time complexities. He introduces the array based set.
- 13:43Speaker 1: Okay, so visually and in terms of memory layout, an
- 13:47Speaker 1: array based set looks exactly like a standard array. It
- 13:50Speaker 1: is a contiguous block of items, yes, but it has
- 13:53Speaker 1: one strict defining rule, no duplicate values allowed. It enforces
- 13:58Speaker 1: absolute uniqueness. If apples is already in the set, the
- 14:02Speaker 1: system will reject a second Apples.
- 14:04Speaker 2: Enforcing uniqueness is a really common requirement. Think of a
- 14:07Speaker 2: database of user IDs or a list of tags on
- 14:09Speaker 2: a blog post. You don't want the same tag applied twice. However,
- 14:13Speaker 2: a rule is just an inbstraction. The computer physically has
- 14:16Speaker 2: to enforce that rule using computational steps.
- 14:18Speaker 1: So what does this all mean If a set is
- 14:21Speaker 1: just an array with a no duplicants rule. How does
- 14:23Speaker 1: that actually change the efficiency we just talked about. Doesn't
- 14:26Speaker 1: the computer have to do extra work to enforce that rule.
- 14:29Speaker 2: This raises an important question because to prevent duplicates, the
- 14:33Speaker 2: computer must inherently perform a search operation before it can
- 14:36Speaker 2: perform an insertion.
- 14:37Speaker 1: Oh, meaning it cannot just blindly drop a new item
- 14:41Speaker 1: into a set, even at the very end of the line.
- 14:43Speaker 2: Exactly. Let's walk through the mechanics of that compound tax.
- 14:47Speaker 2: If you want to insert figs at the end of
- 14:49Speaker 2: a standard array, we establish that takes just one step.
- 14:52Speaker 2: It's the best case scenario. But with a set, the
- 14:54Speaker 2: computer first have to search index zero, then index one,
- 14:57Speaker 2: index two, checking every single existing cell to verify that
- 15:00Speaker 2: Figs doesn't already exist somewhere in the data.
- 15:02Speaker 1: Wow. Only after it reaches the end of the set
- 15:05Speaker 1: and confirms the item is unique, can it finally execute
- 15:08Speaker 1: the one step insertion.
- 15:09Speaker 2: Yes, an operation that was one in an array suddenly
- 15:13Speaker 2: requires an on search phase.
- 15:15Speaker 1: First, you are paying a massive performance tax for that
- 15:18Speaker 1: uniqueness rule.
- 15:19Speaker 2: Huge tax, And consider the worst case scenario inserting a
- 15:22Speaker 2: unique item at the very beginning of the set.
- 15:24Speaker 1: Oh.
- 15:24Speaker 2: No, First, the computer pays then tax to search the
- 15:28Speaker 2: entire structure to confirm uniqueness. Then it pays a second
- 15:32Speaker 2: on tax to shift all the existing data to the
- 15:34Speaker 2: right to make room at index zero.
- 15:36Speaker 1: It fundamentally changes the time complexity, The computational cost essentially doubles.
- 15:40Speaker 2: It really does.
- 15:41Speaker 1: It proves that choosing between a standard array and a
- 15:44Speaker 1: set isn't just a matter of developer preference or neatness.
- 15:48Speaker 1: It heavily impacts the speed and scalability of the code completely.
- 15:52Speaker 1: If you absolutely need to ensure data is unique, a
- 15:56Speaker 1: set is necessary and you accept the cost. But if
- 15:59Speaker 1: you don't actually care about duplicates mindlessly using a set
- 16:03Speaker 1: instead of an array will needlessly throttle your application every
- 16:07Speaker 1: time a user tries to add new data.
- 16:09Speaker 2: It requires a strategic mindset. You have to anticipate the
- 16:12Speaker 2: primary way your application will interact with its data. Will
- 16:16Speaker 2: it read data millions of times a day but rarely mutated,
- 16:20Speaker 2: or is it a highly volatile feed where data is
- 16:22Speaker 2: constantly being inserted and deleted. The structure must match the
- 16:25Speaker 2: behavior absolutely well.
- 16:27Speaker 1: Let's summarize the key insights from this deep dive for
- 16:29Speaker 1: everyone listening. We started by completely redefining how we measure speed.
- 16:33Speaker 2: Yes, moving away from time, we learn that.
- 16:36Speaker 1: Code efficiency isn't about seconds on a clock, which are
- 16:39Speaker 1: easily obscured by powerful hardware. It is about the absolute
- 16:42Speaker 1: number of computational steps required as the size of the
- 16:45Speaker 1: data scales up.
- 16:46Speaker 2: And we explore the physical constraints of the array. Because
- 16:50Speaker 2: it requires contiguous memory, it allows the CPU to use
- 16:53Speaker 2: basic math to read any index instantly. Yeah, but that
- 16:56Speaker 2: exact same physical constraint turns searching, inserting, and deleting into
- 17:02Speaker 2: massive operations where thousands of memory cells have to be
- 17:05Speaker 2: scanned or physically shifted to avoid empty gaps.
- 17:09Speaker 1: Right, and finally we saw how introducing just a single
- 17:12Speaker 1: constraint like the uniqueness rule of a set creates a
- 17:16Speaker 1: cascading effect on performance, forcing a full search before any
- 17:19Speaker 1: new data can be added. You know, you don't need
- 17:22Speaker 1: an advanced math degree or a textbook on big O
- 17:24Speaker 1: notation to master code efficiency. By simply thinking logically about
- 17:28Speaker 1: how data is physically arranged in hardware and the underlying
- 17:31Speaker 1: mechanics hidden by modern programming languages, you can architect systems
- 17:35Speaker 1: that handle massive scale without breaking a sweat.
- 17:37Speaker 2: Knowledge applied is power. Understanding the hidden cost of abstraction
- 17:41Speaker 2: allows you to write software that works with the physical
- 17:44Speaker 2: machine rather than fighting against it.
- 17:46Speaker 1: It totally changes how you look at the digital infrastructure
- 17:49Speaker 1: around us, and it leads me to one final thought
- 17:51Speaker 1: to leave you with building on the trade off we
- 17:53Speaker 1: saw with the set.
- 17:54Speaker 2: Okay, let's hear it.
- 17:55Speaker 1: If the set prevents duplicate data but forces your computer
- 17:59Speaker 1: to spend all those extra steps checking for those duplicates,
- 18:03Speaker 1: it reveals a universal truth in computer science. You really
- 18:06Speaker 1: get something for nothing.
- 18:08Speaker 2: Never.
- 18:08Speaker 1: You are almost always trading time to save space, or
- 18:12Speaker 1: trading space to save time, adding constraints costs compute.
- 18:16Speaker 2: That's a fundamental law.
- 18:17Speaker 1: So next time you organize your own digital desktop folders
- 18:20Speaker 1: or even the physical files on your desk, ask yourself,
- 18:23Speaker 1: did I organize this to be fast to read, fast
- 18:26Speaker 1: to search, or fast to add new things into Because
- 18:29Speaker 1: just like a CPU managing contiguous memory, you usually can't
- 18:32Speaker 1: have all three. Sometimes it's not a catastrophic failure that
- 18:35Speaker 1: slows our systems down. Sometimes it really is just a
- 18:38Speaker 1: poorly organized list. Thanks for joining us on the steep
- 18:41Speaker 1: dive