
Hello friends!
Welcome to this week’s Sloth Bytes. I hope you had an amazing week 😁

Sloths smell like the jungle
Sloths smell fresh, green, and a little bit earthy. Smelling like the rainforest is a great way to hide from predators with a good sense of smell.

Data Structures and Algorithms

In previous issues, I’ve covered some data structures and algorithms, but it seems many of you are beginners in this subject, so let’s talk about the basics.
What Are Data Structures and Algorithms?
Data Structures are ways to organize and store data in computers so we can use it efficiently. Imagine them as containers that hold data in specific layouts.
Algorithms are step-by-step instructions or recipes for solving problems. They tell the computer how to process the data.
Why Are They Important?
Efficient problem-solving: The right representation can turn an expensive operation into a cheap one.
Reasoning about tradeoffs: You learn to ask which operations matter—lookup, insertion, deletion, ordering, traversal, nearest-neighbor search, memory usage—not just “which structure is fastest?”
Scaling: Complexity helps predict how work grows as input size grows, although real performance also depends on constants, memory locality, I/O, concurrency, and hardware.
System design: Many databases, caches, schedulers, search systems, compilers, and network algorithms are built around specialized data structures and algorithms.
Technical interviews (unfortunately): They’re still common in software-engineering interviews.
Real-World Applications
Search Engines: Use algorithms to find and rank web pages that match search queries. (So basically Google)
Navigation Systems: Calculate the quickest or shortest routes between locations. (Google maps, Apple maps, Uber, etc)
Social Media Platforms: Manage and display vast amounts of user content smoothly. (Facebook, Instagram, etc)
Online Shopping: Handle inventory, process transactions, and recommend products efficiently. (Shopify)
Financial Services: Process large numbers of transactions securely and quickly.
Benefits of Understanding Data Structures and Algorithms
Better problem decomposition: Recognize common patterns such as searching, traversal, ordering, caching, graph connectivity, and priority scheduling.
Better performance decisions: Understand why changing the representation can matter more than micro-optimizing a loop.
Better debugging: Know the invariants your structure is supposed to preserve and what can break them.
Better system-design intuition: B-trees, hash tables, queues, heaps, graphs, tries, and probabilistic structures show up in production systems constantly.
Interview fluency: You can explain tradeoffs rather than memorizing one LeetCode incantation per problem.
Challenges in Learning Them
Abstract Concepts: Can be hard to understand without real-life examples or pictures.
Mathematical Understanding: Sometimes requires basic knowledge of math principles.
Requires Practice: You can become an expert by practicing coding and solving problems regularly over time.
Careers That Benefit from This Knowledge
ALL CAREERS BECAUSE THEY TEST YOU WITH THEM
Ok but seriously:
Software Engineer
Role: Develop and maintain software applications.
Benefit: Write efficient and effective code that performs well.
Data Scientist
Role: Analyze and interpret complex data to aid decision-making.
Benefit: Use algorithms to process and make sense of large datasets.
Systems Analyst
Role: Design and implement IT solutions to meet business needs.
Benefit: Optimize systems for better performance and scalability.
Database Administrator
Role: Manage and organize data to ensure its accessibility and security.
Benefit: Efficiently structure data storage for quick retrieval and updates.
Machine Learning Engineer
Role: Develop systems that can learn and make predictions from data.
Benefit: Implement algorithms that enable machines to perform tasks without explicit instructions.
The Mental Model That Actually Matters
Do not memorize data structures as a list of vocabulary words. Learn them as bundles of tradeoffs between operations.
Structure | Often good at | Common tradeoff |
|---|---|---|
Array / dynamic array | Indexing, iteration, cache-friendly storage | Middle insert/delete can require shifting elements |
Linked list | Local insertion/removal when you already have the node | Poor random access and memory locality |
Hash table | Average-case key lookup/insertion | No natural ordering; collisions/resizing; worst case is not magically O(1) |
Balanced search tree | Ordered lookup, predecessor/successor, range traversal | More pointer/metadata overhead than a flat array |
Heap / priority queue | Repeatedly finding/removing the highest- or lowest-priority item | Not designed for arbitrary fast membership lookup |
Graph representation | Relationships, paths, dependencies, networks | Adjacency lists vs matrices have very different memory/operation costs |
The exact complexity depends on the implementation. For example, a hash table typically gives average-case O(1) lookup, but collisions and adversarial/worst-case behavior matter. A “list” in one language may be a dynamic array while a similarly named type elsewhere may be linked.
Algorithms depend on assumptions
Algorithms are not magic spells you can drop onto arbitrary data. Binary search needs an ordered/monotonic search space. Dijkstra’s algorithm assumes non-negative edge weights. Topological sorting requires a directed acyclic graph if you expect a complete ordering. Before choosing an algorithm, ask what properties make it correct.
Big O is one lens, not the scoreboard
Two O(n) algorithms can perform very differently because of constants, cache locality, allocations, branch behavior, I/O, parallelism, or the actual distribution of inputs. Use complexity to reason about growth, then profile real code when performance actually matters.
Tips for Getting Started
Learn operations, not names: For each structure, ask how lookup, insert, delete, iteration, ordering, and memory behave.
Learn invariants: Why does a binary-search tree stay searchable? Why does a heap keep its minimum/maximum at the root?
Implement a few yourself: Building a stack, queue, hash table, heap, tree traversal, and graph traversal once makes library versions much easier to understand.
Then use the standard library: Production code usually should not reimplement a battle-tested data structure for fun.
Practice recognizing assumptions: Sorted? Monotonic? Acyclic? Non-negative weights? Small bounded keyspace? Those clues often choose the algorithm for you.
Measure when it matters: Complexity narrows your choices; profiling tells you whether the suspected bottleneck is real.
Hope you understand why they’re so important! Stay curious. 🦥
If you want to keep learning
Big O notation explained — how to compare algorithm time and space complexity without timing code on one machine.
Binary search explained — a classic O(log n) algorithm and one of the best examples of why DSA matters.
Recursion explained — a core technique for trees, divide-and-conquer problems, and many interview questions.
The software engineer interview process — where DSA questions usually show up and what else to expect.




Thank you to everyone who submitted 😃
and last but not least!

Video Length in Seconds
You are given the length of a video in minutes. The format is mm:ss (ex: "02:54").
Create a function that takes the video length and return it in seconds.
Examples
minutesToSeconds("01:00") = 60
minutesToSeconds("13:56") = 836
minutesToSeconds("10:60") = -1
minuteToSeconds("121:49") = 7309Notes
The video length is given as a string.
If the number of seconds is 60 or over, return
-1(see example #3).You may get a number of minutes over 99 (e.g.
"121:49"is perfectly valid).
How To Submit Answers
Reply with
A link to your solution (github, twitter, personal blog, portfolio, replit, etc)
or if you’re on the web version leave a comment!

Another video posted! Go check it out
Working on the next video 😄
This next video will be a little different. It’s going to be about how google works. I’ve been doing some research on search engines and I thought it would be a fun topic to make a video about.
That’s all from me!
Have a great week, be safe, make good choices, and have fun coding.
See you all next week.






