Interview Basics: Reverse a Linked List

Reversing a linked list is a very common task in technical interviews. That’s why we devote a whole section of Interview Practice to them! Being able to solve this question easily is a great way to demonstrate to an interviewer that you’re a capable, competent programmer. Let’s discuss two different ways of reversing the direction of a linked list: recursively and iteratively.Linked list refresher A linked list can be modeled by Node objects, where each node stores a value and

Continue Reading

CodeFights Solves It: houseRobber

houseRobber interview practice solution

This week’s Interview Practice Task of the Week is houseRobber, a technical interview question that’s been asked at LinkedIn. In this challenge, we’re asked to assist a robber in stealing from houses. Not something that we recommend you do in real life, of course! We will be looking at an (inefficient) recursive solution and then seeing how we can speed it up using memoization (not a typo!) or dynamic programming. In this task, we are given an array loot, where

Continue Reading

CodeFights Solves It: chessQueen

Adobe technical interview question solution

Our latest Interview Practice Task of the Week was chessQueen, which has been asked in technical interviews at Adobe. This question might seem fairly easy at first: Given the location of a queen piece on a standard 8 × 8 chess board, which spaces would be safe from being attacked by the queen? But as with any “easy” technical interview question, it’s imperative that you think it through fully, watch out for potential traps, and be able to explain your

Continue Reading

CodeFights Solves It: goodStringsCount

programming jobs technical interview problem solution

Our Interview Practice challenge this week is goodStringsCount, a combinatorics problem. As the name suggests, combinatorics deals with combinations of objects that belong to finite sets, and it’s one of those topics that come up a lot in technical interviews. This specific coding problem is from Apple, which makes sense since they’re known for asking combinatorics questions in their technical interviews! If this isn’t your first CodeFights Solves It rodeo, I bet you know what I’m going to ask next:

Continue Reading

CodeFights Solves It: findSubstrings

trie data structure Uber technical interview question

The Interview Practice Task of the Week was findSubstrings. This is an Uber interview question, and their technical interviews are notoriously lengthy and difficult. And the solution implements tries, a data structure that you’ll see a lot in interview questions. It’s a double whammy! You know the drill by now: If you haven’t solved this challenge yet, hop on over to CodeFights and do it! Then come back here and we’ll walk through solving it together. We’ll start with a

Continue Reading

CodeFights Solves It: isTreeSymmetric

tree coding challenge interview question

The most recent Interview Practice Challenge of the Week was isTreeSymmetric. This interview question from LinkedIn and Microsoft is checking to see how comfortable you are with the tree data structure. Trees have a wide variety of applications, so your interviewer is going to make sure that you know your stuff! Have you solved it yet? If not, head over to CodeFights and give it a shot. Once you have a solution, come back here and I’ll walk you through

Continue Reading

CodeFights Solves It, Interview Practice Edition: groupsOfAnagrams

Interview question: Find the groups of anagrams from an array.

This week’s featured Interview Practice challenge was groupsOfAnagrams. It’s a Twitter interview question, and they’re known for their difficult technical interviews! If you haven’t solved it yet, go ahead and do that first, then head back here and we’ll discuss how to get to a solution with a good runtime. …Done? Okay, let’s dig into this coding challenge! The technical interview challenge You are given a list of n words. Two words are grouped together if they are anagrams of

Continue Reading

CodeFights Solves It, Interview Practice Edition: productExceptSelf

CodeFights Solves It Interview Practice

If it’s been asked as an interview question at Amazon, LinkedIn, Facebook, Microsoft, AND Apple, you know it’s got to be a good one! Have you solved the challenge productExceptSelf in Interview Practice yet? If not, go give it a shot. Once you’re done, head back here. I’ll walk you through a naive solution, a better solution, and even a few ways to optimize. …Done? Okay, let’s get into it! The object of this problem is to calculate the value

Continue Reading

Site Footer