Apply Java Algorithms Directly to Brain
Coursera Review: Data Structures and Algorithms in Java from Princeton University
How often do you try load up an app or webpage and get irritated by how slow it is? Slow load times are frustrating. Then you close out the app and leave a ticked off review in the app store. Or throw your phone on the couch and go play video games.
Poor performance leads to dissatisfied customers. The root cause is performance and scalability problems in the application.
The workload of the application increased. But the code or infrastructure failed to scale to that level of workload.
There’s several aspects you could look at to optimize this:
Caching data
Rearchitecting databases
Horizontal scaling: Increasing the number of servers
Vertical scaling: Migrating to more powerful hardware
Or improve your data structures and algorithms in server-side code
Those data structures and algorithms (DSA) are a common bottle-neck in application performance. DSA is an important topic that is often dismissed as boring college stuff. But is critical to the performance of applications at scale.
Implementing efficient algorithms yields better performance gains than using super-computers. Hiring competent software engineers is way more cost effective than dropping mad cash on hardware.
That was my motivating factor to study up on DSA for interviews with tech companies like Amazon. I worked with DSA earlier in my career to improve the performance of my previous company’s desktop app. 1
Java, but why?
Java is more than a nickname for coffee and an island in Indonesia. It’s a solid programming language. Excellent tech companies like Amazon and Binance use Java to build their products.
Yeah there is a lot of hot new stuff out there: Rust, Go, Ruby, Python, C#, Voldemort…
And I love cool new stuff and want to learn all about it. But I learned Java in school. It’s still my go-to language when I hit the books to learn computer science concepts. Concepts like DSA are very transferable across programming languages as well.
Is the need DSA going away with AI generated code?
I use AI to get things done fast. Especially for creating boilerplate and debugging issues. But I implemented the core algorithms myself to learn the details.
I believe that as AI becomes more powerful, you still need someone who knows how to pilot your ship.
And in my recent job interview experience, the hiring managers agree. I fielded a lot of questions about hash tables and graphs. I hadn’t dug into these concepts much since college.
The Good, the Bad, and the Un-Groovy
Let’s start with what’s great about Princeton’s DSA course. The free published reading material was helpful for me to learn most of the core concepts. This included specific subjects I needed for Amazon.
The instructor videos by Professor Sedgewick were engaging. A nit to pick is that he tends to read from the slides. But the videos show program demos and add extra insight. The text-book is completely optional. I often consulted Wikipedia pages, Perplexity, and Gemini.
The interview questions provoke interesting thoughts. But they aren’t comparable to what I actually experienced at Amazon. Platforms like Leetcode and CodeSignal seem better for practicing this. Or stand-alone job interview courses and books.2
You want to be conversant in Big O notation of algorithms as a software engineer. Working through courses like this help you understand space vs runtime complexity. And the best-case, worst-case, and amortized average-case of a solution.3
The coding exercises are engaging and help to reinforce the learning. This is the most time intensive part of the course. And where they could improve the course the most.
You first install Princeton’s custom version of JetBrains IntelliJ Idea. Idea is a fantastic interactive development environment (IDE). The modifications their team put in help to standardize students’ coding process. It is NOT an excellent user experience.
The real pain point is the build, testing, and grading process for your work. That’s where a lot of students quit the course. They teach you to build at the command-line using the javac command, and run using java. Testing is implemented using the program’s main() method.
Then you submit your work via a zipfile to the automated grader. This runs through an opaque series of tests to score your submission. And then you go back to Idea to fix it and try again.
In my next set of posts I want to dig into how to improve this. And how I use AI to get things done. A premium IDE speeds up building boilerplate code. Here’s a quick summary of my recommendations:
Students should use a version control (VC) system like GitHub to track their files. The automated grading system can then hook into their GitHub repo.
Git Your Damn Files Under Control
·Pokemon is a fun time. I want to pivot to build free resources on tech topics to help readers out.
Java code is better compiled using a modern build system. Like Gradle using Groovy scripts. Gradle enables configuration of custom build and test procedures.4
Instead of using a main() method to test, students should create proper unit tests. It’s a more powerful method for testing and debugging code.
Again, I enjoyed the course. I’m curious about continuing down the DSA path with another course. Or pivoting to applications in data science, graphics and security. There’s so much interesting math and computer science out there to learn.
Let me know if you want to chat about software development or the other ideas I discuss here. The easiest way to reach me is by scheduling a meeting on Calendly.
Until next time. Stay hungry, stay foolish.