Welcome to the most accessible guide to technical interviews. Let's start reviewing some concepts that you need to know to land a job at a top software company.
Sign in now to track your progress on the platform.
We'll send you 100+ of the most common coding interview questions, once a day with visual explanations. Join over 53,000+ users who are doubling their salaries in 30 minutes a day.
Day▲ | Img | Title | Lvl |
---|---|---|---|
0 | ![]() | Reverse a String Hey there, welcome to the **challenges** portion of the **AlgoDaily** technical interview course! Over the next few days, you'll get some hands on experience with the essential data structures and algorithms that will help you nail your interview, and land your dream software engineering job. The ... | 2 |
1 | ![]() | Array Intersection As we ease our way into the course, we'll want to start with the basic data structures and their operations. However, don't be fooled how fundamental these things are! Interviewers will often test you on things that are deceptively easy. We saw this in Reverse a String challenges reverse a stri... | 2 |
2 | ![]() | Fizz Buzz Fizz Buzz is a classic interview question that apparently many experienced engineering candidates often can't solve! Let's cover it today. We're given a number in the form of an integer n . Write a function that returns the string representation of all numbers from 1 to n based on the followin... | 3 |
3 | ![]() | Reverse Only Alphabetical Reversing Only Alphabetical Characters in a String ! Visual Diagram https: storage.googleapis.com algodailyrandomassets curriculum easy strings reverse only alphabetical.png The Problem Statement You are provided with a string that's a blend of alphabetic and non alphabetic characters. T... | 3 |
4 | ![]() | Is An Anagram Understanding Anagrams: A Simple Definition An anagram is a fascinating literary device where you can rearrange the letters of a word, phrase, or name to form another meaningful sequence. Think of it as a jigsaw puzzle made of letters. For example, the word "cinema" can be rearranged to form "ice... | 3 |
5 | ![]() | Validate Palindrome Given a string str , can you write a method that will return True if is a palindrome and False if it is not? If you'll recall, a palindrome is defined as "a word, phrase, or sequence that reads the same backward as forward". For now, assume that we will not have input strings that contain spec... | 3 |
6 | ![]() | Majority Element Suppose we're given an array of numbers like the following: 4, 2, 4 Could you find the majority element? A majority is defined as "the greater part, or more than half, of the total. It is a subset of a set consisting of more than half of the set's elements." Let's assume that the array l... | 3 |
7 | ![]() | Power of Three Given an integer num , write a method to determine if it is a power of 3. The method will be called as follows: js console.log powerOfThree 9 true console.log powerOfThree 7 false Constraints The given would be a non zero positive integer in the ran... | 3 |
8 | ![]() | Single Lonely Number In a given array of numbers, one element will show up once and the others will each show up twice. Can you find the number that only appears once in O n linear time? Bonus points if you can do it in O 1 space as well. lonelyNumber 4, 4, 6, 1, 3, 1, 3 6 lonelyNumber 3, 3, 9 9... | 3 |
9 | ![]() | Implement a Hash Map 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. ... | 3 |
10 | ![]() | Binary Tree Inorder Traversal Can you write a function to traverse a binary tree **in order**, and print out the value of each node as it passes? 4 5 6 The example would output 4, 6, 5 since there is no left child for 4 , and 6 is visited in order before 5 . The definition of a tree node i... | 3 |
11 | ![]() | Sum Digits Until One We're provided a positive integer num . Can you write a method to repeatedly add all of its digits until the result has only one digit? Here's an example: if the input was 49 , we'd go through the following steps: start with 49 4 9 13 since the previous addition was 13, move ont... | 4 |
12 | ![]() | Detect Substring in String How would you write a function to detect a substring in a string? If the substring can be found in the string, return the index at which it starts. Otherwise, return 1 . js function detectSubstring str, subStr return 1 Important do not use the native String clas... | 4 |
13 | ![]() | Dollar Sign Deletion You're given an array of strings containing alphabetical characters and certain characters. A represents a DELETE action whereby the character before it is deleted. Each of these strings will be run through a method to operate on the DELETE action. We want to find out if the final string... | 4 |
14 | ![]() | Find First Non-Repeating Character You're given a string of random alphanumerical characters with a length between 0 and 1000 . Write a method to return the first character in the string that does not repeat itself later on. So if we had a string input of "asdfsdafdasfjdfsafnnunl'" , we can see there are multiple letters that... | 4 |
15 | ![]() | Max of Min Pairs We have an array of length 2 * n even length that consists of random integers. 1, 3, 2, 6, 5, 4 We are asked to create pairs out of these integers, like such: 1, 3 , 2, 6 , 5, 4 How can we divide up the pairs such that the sum of smaller integers in each pair is maximized? ... | 4 |
16 | ![]() | Missing Number In Unsorted Assume we're given an unsorted array of numbers such as this: 2, 5, 1, 4, 9, 6, 3, 7 We are told that when this array is sorted, there is a series of n consecutive numbers. You are given a lower bound and an upper bound for this sequence. There is one consecutive number missing, and ... | 4 |
17 | ![]() | Find Missing Number in Array We're given an array of continuous numbers that should increment sequentially by 1 , which just means that we expect a sequence like: 1, 2, 3, 4, 5, 6, 7 However, we notice that there are some missing numbers in the sequence. 1, 2, 4, 5, 7 Can you write a method missingNumb... | 4 |
18 | ![]() | Sum All Primes You're given a number n . Can you write a method sumOfAllPrimes that finds all prime numbers smaller than or equal to n , and returns a sum of them? For example, we're given the number 15 . All prime numbers smaller than 15 are: 2, 3, 5, 7, 11, 13 They sum up to 41 , so sumOfA... | 4 |
19 | ![]() | Fast Minimum In Rotated Array We're given an array of integers that looks like the following: js 0, 1, 2, 3, 4, 5, 6, 7, 8 Let's imagine we're an assembly line and we decide to shift some workers around. Say we take our array, and rotate it at a random pivot so that the section after the pivot comes before. Le... | 4 |
20 | ![]() | Remove Duplicates From Array Given an array, return another array with just the ordered unique elements from the given array. In other words, you're removing any duplicates. Note: Order needs to be preserved, so no sorting should be done. And the order should be maintained with the first occurrence of the element in the given... | 4 |
21 | ![]() | Contiguous Subarray Sum Given an array of numbers, return true if there is a subarray that sums up to a certain number n . A subarray is a contiguous subset of the array. For example the subarray of 1,2,3,4,5 is 1,2,3 or 3,4,5 or 2,3,4 etc. js const arr 1, 2, 3 , sum 5 subarraySum arr, sum... | 4 |
22 | ![]() | Treats Distribution Say we are given an integer array of an even length, where different numbers in the array represent certain kinds of snacks or treats. Each number maps to, or represents, one kind of snack. So the following array would have two kinds: snack type 3 and type 2 : js const snacks 3, 3, 2, 2 ... | 4 |
23 | ![]() | Least Missing Positive Number We have an unsorted array of integers such as the following: 0, 3, 1, 2, 1 csharp if len 2 return Math.Max nums 0 , nums 1 In the above example, the minimum number is 2 and the maximum is 3 . If it were sorted, it would look like: 2, 1, 0, 1, 3 csharp ... | 4 |
24 | ![]() | Product Except Self If we are given an array of integers, can you return an output array such that each corresponding input's elements returns the product of the input array except itself? This can be hard to explain, so let's take an array: 1, 2, 4, 16 What we want to return is 128, 64, 32, 8 . This is... | 4 |
25 | Two Sum This is a classic and very common interview problem. Given an array of integers, return the indices of the two numbers in it that add up to a specific "goal" number. Suppose we had an array 1, 3, 6, 7, 9 , and let's say our "goal" number was 10 . Our numbers to sum to it could be 3 and 7 , an... | 4 | |
26 | ![]() | Find the Intersection of Two Linked Lists Assume you have a Linked List implementation that has the following API: js prepend to start of list prepend val appends to end of list append val get an array of node values for testing toArray Can you write a method getIntersection list1, list2 to find the interse... | 4 |
27 | ![]() | Grab a Random Node Given a linked list, can you write a method to get a random node within it? Let's assume you're given a random node generator. The linked list will have at least 2 nodes, and may look something like this: 1 2 3 4 The odds of getting any number between 1 and 4 inclusive should b... | 4 |
28 | ![]() | Swap Every Two Nodes in a Linked List Write a recursive algorithm that swaps every two nodes in a linked list. This is often called a pairwise swap. For example: js * original list 1 2 3 4 after swapping every 2 nodes 2 1 4 3 * You may assume that the definition of a linked list node is: ... | 4 |
29 | ![]() | Union of Linked Lists Now that we've implemented a Linked List challenges implement a linked list , let's start operating on it! Assume you have a Linked List implementation with this definition: js class LinkedList constructor this.head null this.tail null prepend newVal const ... | 4 |