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++
This problem deals with printing the median of a stream of integers. At each time step, the median of the integers received so far is printed out.
About this solution: The candidate's solution is complete and solves the problem. The approach is to use two priority queues, one for the max heap and one for the min heap. The max heap is used to store the smaller half of the numbers and the min heap is used to store the larger half of the numbers. This approach ensures that the median can be calculated in O(1) time.
Dec 01
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem is about finding the first non-repeating character in a string. For example, if the input string is "GeeksforGeeks", then the output should be 'f '.
About this solution: The candidate's solution is correct and uses a dictionary to store the characters and their counts. The time complexity of this solution is O(n) because the dictionary is iterated over once. The space complexity of this solution is O(n) because the dictionary is the same size as the input string.
Dec 01
Databases / SQL DifficultyHard SQL
This technical problem involves finding all customers who have ordered a product that is out of stock. The input is three tables: customers, orders, and products. The output is the customers table with the id and name of the customers who have ordered a product that is out of stock.
About this solution: The candidate's solution is incomplete - it does not return the expected output. The candidate has correctly identified that a join is needed to combine the data from the three tables, but has not included all the necessary conditions in the WHERE clause. A better approach would be to use a LEFT JOIN and check for NULL values in the products table, as this would return all customers who have placed an order for a product that is out of stock.
Dec 01
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This technical problem involves finding the sum of all elements in an array. The input is an array of integers, and the output is the sum of all elements in the array.
About this solution: The candidate's solution is correct and demonstrates an understanding of how to find the sum of all elements in an array. The candidate's approach is clear and concise.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium Python
Given a set of distinct integers, this algorithm will return all possible permutations of those integers. For example, if the input is [1,2,3], the algorithm will return [[ 1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]].
About this solution: This solution is complete and solves the problem. The approach is to generate all permutations by iterating through the list of numbers and recursively generating all permutations of the sublist without the current number. This is then added to the list of permutations.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium C#
To find the maximum depth of a binary tree, we can use recursion. First, we need to check if the tree is empty. If not, we need to find the maximum depth of the left and right subtrees. The maximum depth of the tree is the maximum of the left and right subtrees' depths, plus one.
About this solution: The candidate's solution correctly finds the maximum depth of a binary tree. The solution uses a recursive approach, which is a good approach for this problem. The solution is clear and easy to understand.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
This technical problem deals with finding the sum of all integers in a list using recursion. An example input is given, along with the expected output.
About this solution: This solution is correct and demonstrates a good understanding of recursion. The approach is clear and concise.
Nov 30
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem is about finding the shortest path through a maze. The input is a 2D array representing the maze, and the output is the shortest path from the top-left corner to the bottom-right corner.
About this solution: The candidate's solution correctly solves the problem and demonstrates a level of completeness. The candidate uses a breadth-first search algorithm to find the shortest path through the maze. The time and space complexity of the algorithm is correctly analyzed.
Nov 30