It’s been a wild week. You and your team have been engaged in an all-out war with the codebase for the past two sprints. There’s this new integration with a partner that’s close to being shipped, and it promises bountiful revenue and voluminous web traffic. And you’ve been working on the part of it that’ll seal the deal and let your squad deploy, come Monday morning.
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers.
You find yourself on the Friday night before launch, 6pm, absolutely fried at your desk. Everyone else on your team already left to attend the company happy hour, or has gone home seeking sanity from work. For the past several hours, you’ve been tracking down a nasty, horrendous bug that could prevent the feature from shipping next week. …
I’ve had a few friends recently ask me about breaking into the software industry. Most have been looking for advice on getting a developer job at a consumer-facing web/internet company — though places like Tesla and WeWork are also very popular.
These friends have probably heard about the amazing slew of benefits; like interesting work, smart and passionate colleagues, and free food/snacks/alcohol galore. It doesn’t hurt that compensation is usually above market at these companies, and career prospects are second-to-none for talented technologists.
There’s already an abundance of information out there on obtaining software engineering jobs, but much of the advice is geared towards people who have experience already. …
Arrays are amazing for looking up elements at specific indices as all elements in memory are contiguous, allowing for O(1)
or constant time lookups. But often we don't, or can't, perform lookups via indices. Hash maps and hash tables are a way around this, enabling us to lookup via keys
instead.
Can you implement the Map
class from scratch? Only two methods are necessary-- get
and set
. Many programming languages have a built-in hash or dictionary primitive (like Javascript
Object
s and {}
notation), but we don't want to use that for this exercise.
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers. …
A binary tree
, as the name suggests, is any tree
in which each node has at the most two child nodes. A binary tree can be empty, implying zero nodes in the tree. The cool thing about binary trees
is that they are recursive structures. This means a rule can be applied to the entire tree by applying it turn by turn to all of its subtrees.
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers.
To define a binary tree, we need two data structures. One would be the overall binary tree structure that keeps track of the root node. The other would be the node structure that keeps track of the left and right subtrees. …
Many new developers wonder what the difference is between SQL
and NoSQL
. The subjects come up often in theoretical discussions and systems design interview preparation.
In this tutorial, we will be looking at the difference between SQL and NoSQL based on certain parameters. Before we begin, let’s analyze each individually to develop our understanding of these contrasting concepts.
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers.
Some definitions to start:
SQL
stands for Structured Query Language. As evident from the name, it is a querying language that is used to perform various data operations. …
Oftentimes, interviewers will test you on things that are deceptively easy. We saw this in Reverse a String, and will see more in future challenges. But sometimes you might get tested on a concept that, while a bit trivial, is really useful in day to day software engineering.
One of those things is array manipulation
, or basically doing things to an array
that creates some kind of transformation.
Can you write a function that takes two arrays as inputs and returns to us their intersection? Let’s return the intersection in the form of an array.
Note that all elements in the final result should be unique. …
Can you write a function that reverses an inputted string without using the built-in Array#reverse
method?
Let’s look at some examples. So, calling:
reverseString("jake")
should return "ekaj"
.
reverseString("reverseastring")
should return "gnirtsaesrever"
.
binary tree
over its vertical axis? This is a famous problem made popular by this tweet:Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.
- Max Howell (@mxcl) June 10, 2015
Given a binary tree
like this:
4
/ \
2 7
/ \ / \
1 3 6 9
Performing an inversion would result in:
Output:
4
/ \
7 2
/ \ / \
9 6 3 1
The definition of a tree node is as follows:
function Node(val) {
this.val = val;
this.left = null;
this.right = null;
}
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers. …
The two-pointer technique is a near necessity in any software developer’s toolkit, especially when it comes to technical interviews. In this guide, we’ll cover the basics so that you know when and how to use this technique.
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers.
The name two pointers
does justice in this case, as it is exactly as it sounds. It's the use of two different pointers (usually to keep track of array or string indices) to solve a problem involving said indices with the benefit of saving time and space. …
The Longest Increasing Subsequence (LIS)
is a subsequence within an array of numbers with an increasing order. The numbers within the subsequence have to be unique and in an ascending manner. It's important to note that the items of the sequence do not have to be in consecutive locations within the array.
Can you write an efficient program that finds the length of Longest Increasing Subsequence
, also called LIS
?
This lesson was originally published at https://algodaily.com, where I maintain a technical interview course and write think-pieces for ambitious developers.
Here are some examples and their solutions:
Input: {1,5,2,7,3}
LIS = 3. The longest increasing subsequence could be any of…