Join our community to practice, learn, solve your problems with AI. Recruiters: create tests and evaluate candidates instantly.
Categories: Code Problem Databases Python Programming Languages Mathematics Machine Learning NodeJS Puzzles Math Algorithms Strings Theorems Data structures Games JavaScript  More...

Recent solutions:

Check these solutions from our community:
Code Problem / Data Structures and Algorithms DifficultyMedium C#
Given a list of integers, write a function that returns the index of the first integer that is greater than or equal to the given target. If there is no such integer, return -1 .
About this solution: The candidate's solution correctly finds the index of the first integer that is greater than or equal to the given target. However, the code could be more concise. For example, the candidate could use a for-each loop instead of a for loop. In addition, the candidate could use the Array.FindIndex method instead of writing their own loop.
Dec 02
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem asks us to find all the words in a 2D array of characters. The input is a 2D array of characters, and the output is a list of strings containing all the words in the array.
About this solution: The candidate's solution correctly solves the problem. The candidate uses a StringBuilder to construct the words from the 2D array, which is a good approach. The candidate's code is also clean and easy to read.
Dec 02
Code Problem / Data Structures and Algorithms DifficultyMedium C#
Given a list of numbers, the function will return the index of the number if it exists in the list. If it does not exist, the function will return -1.
About this solution: The candidate's solution correctly solves the problem. However, it is not the most efficient solution. A more efficient solution would be to use a binary search algorithm, which would run in O(log n) time.
Dec 02
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
Given a string, reverse the order of the words. Do not use any built-in reverse functions.
About this solution: This solution is correct and demonstrates a level of completeness. The approach is straightforward and easy to understand. The time and space complexity of the solution is also optimal.
Dec 01
Code Problem / Data Structures and Algorithms DifficultyMedium C++
Given an array of n integers, the maximum sum of any contiguous subarray of the array can be found by using the example input and output above.
About this solution: The candidate's solution correctly finds the maximum sum of any contiguous subarray of the array. The candidate's approach is to keep track of the current sum and update the maximum sum as needed. This is a good approach.
Dec 01
Code Problem / Data Structures and Algorithms DifficultyMedium C++
Given an array of integers and a target value, this problem asks if there is a pair of integers in the array that sums to the target value. An example input and output are given.
About this solution: The candidate's solution is complete and solves the problem. The candidate has used a hash map to store the complement of each number in the array. If the complement exists in the hash map, then the candidate returns true. Otherwise, the candidate adds the current number and its index to the hash map.
Dec 01
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This problem asks you to return the sum of the elements in an array of integers. For example, given the input array [1, 2, 3, 4, 5], the output would be 15 (1 + 2 + 3 + 4 + 5 = 15).
About this solution: This solution is correct and solves the problem. The approach is also optimal, as it has a time complexity of O(n).
Dec 01
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This technical problem involves determining whether a route exists between two nodes in a directed graph. An example input and output are given.
About this solution: The candidate's solution is correct and uses a breadth-first search to find the shortest path between two nodes. The time complexity is O(n) and the space complexity is O(n).
Dec 01