Data Access Times Translated to Distances (with Pictures)

This well-known article, Numbers Everyone Should Know, was intriguing, but it was hard to mentally get a handle on the scale of the numbers. Here are a few: So I converted some of them into round trips, since data accesses are round trips in themselves. I started with an L1 cache access, at 0.5ns,…

Read more

Finishing the Learning Phase

Back on August 8, I talked about how I was going to change up my study schedule for the interview. I discovered that it was difficult to interleave learning new things and practicing, and I wanted to get past the learning phase done so I can just practice all day long. The Remainder of the Learning…

Read more

Cryptography & Compression

Today I studied cryptography and compression, so I’m trucking along. These topics are not on the coaching docs I’ve seen, but I added them to round out my studies. I’m basically trying to compress a 4 year CS degree into less than 1 year. It’s lossy…

Read more

Tackling Entropy

I’ve heard the term “entropy” over the years and never understood it until now. I used to think entropy was randomness, and it’s kind of related. Entropy can be defined in a few ways, some more complicated than others. Entropy is a measure of how much information is gained…

Read more

An Experiment in Sorting in Linear Time

Yes, you can sort in linear time, as long as you’re avoiding comparisons. Radix sort and counting sort are two examples. They both avoid comparisons, and are possible because they sort based on grouping by a single element at a time, where that single element is a letter or digit (in…

Read more

Context Switch in My Coding Interview Study Plan

Time management can be tough. I found myself spending way too long on some subjects. Some take more time than others. Graphs, trees and sorting take more time to go over than studying priority queues, for example. But I could just watch videos on dynamic programming for days. I just keep learning…

Read more

Important: Pick One Language for the Coding Interview

I wanted to clarify the programming language requirement for the interview. I was under the impression that I needed C++ or Java to do the interview, and that in some cases C would suffice. But I also felt the need to know Python, since it is also widely used. A further reason for getting deep into…

Read more

How to Run Valgrind in CLion, for C and C++ Programs

I needed this for myself, and Googled around but didn’t find anything satisfactory, but now after a little work, I’m all set with Valgrind. Wouldn’t you love this on your toolbar? Well, you can have it, friend. Read on. 1. Add this Bash script I have it in my current project,…

Read more

Dijkstra's Algorithm in Python 3

Greed is good. And Dijkstra’s algorithm is greedy. Dijkstra’s algorithm not only calculates the shortest (lowest weight) path on a graph from source vertex S to destination V, but also calculates the shortest path from S to every other vertex. My implementation in Python doesn’t…

Read more

Graphs and Dynamic Programming

I’ve been learning graphs and dynamic programming somewhat interleaved. Dynamic programming tends to help solve graph problems because: Every problem solvable by dynamic programming can be represented in a DAG. A couple of things I discovered in my experiments: Using a queue for graph…

Read more