#100DaysOfCrackingTheCodingInterview: Day 1 - LinkedList

I am tired of being rubbish at technical interviews. I realized that the only way that I can stop being rubbish at technical interviews is to develop a better understanding of data structures, develop a more friendly relationship with algorithms, and practice.

Today, I made the public commitment to #100DaysOfCrackingTheCodingInterview. What follows is the implementation I came up with for a LinkedList in JavaScript.


Problem Statement Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without extra memory? Thought Process My initial conclusion was that no, you couldn’t. Since there’s not a range for the possible numbers in the array and the array isn’t already sorted, you can solve in linear time if you used an object to store counts, but you need that extra storage or sorting is O(n log n).

Array Manipulation

Problem Statement: Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each of the array elements between two given indices, inclusive. Once all operations have been performed, return the maximum value in the array.

Getting Going With Go Part II

For this second installment of Getting Going With Go, we’re going to cover slices – how to create them, how to add more elements to them, and how to retrieve the elements of them individually. We’ll also cover how what maps are in Go and how to create them.

Getting Going With Go Part I

After hearing a lot about the Go programming language and its similarity to C, I decided to finally get around to trying to learn it (I’m currently watching Brenna Martenson’s course on Frontend Masters, “Go for JavaScript Developers”). And since the best way to ensure you’ve actually learned a thing is to teach a thing, I decided to start this blog. So join me as I muddle through the early stages of learning a language.