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 JavaScript
This problem asks you to write a function to reverse a singly linked list in place. The input is a singly linked list, and the output should be the same list, but reversed .
About this solution: The candidate's solution is a good attempt at solving the problem. However, there are a few things that could be improved. First, the candidate does not mention what the input and output of the function are. It is assumed that the input is a singly linked list and the output is the reversed singly linked list. Second, the candidate does not mention any edge cases that need to be considered. For example, what if the linked list is empty? What if the linked list has only one node? Third, the candidate's explanation of the while loop could be more clear. In particular, it is not entirely clear what is happening when the current node is set to the next node. Overall, the candidate's solution is a good attempt at solving the problem. With some clarification, it could be a great solution.
Nov 28
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
Given a string of parentheses, this function determines whether the string is balanced. A string is balanced if each opening parentheses is matched by a closing parentheses. For example, the input "(())" would return True, while the input "())(" would return False.
About this solution: This is a great solution! The candidate has thought through the problem and has come up with a very efficient solution.
Nov 28
Code Problem / Data Structures and Algorithms DifficultyMedium Python
The function should take a sorted array of integers and a target value as inputs, and return the index of the target value if it exists in the array, or -1 if it does not .
About this solution: This is a well-detailed and complete solution to the problem. The candidate has correctly identified the time and space complexity of the solution and has provided a clear explanation of the approach. The candidate has also correctly implemented a binary search algorithm to solve the problem.
Nov 28
Databases / SQL DifficultyHard SQL
Query a database for customers who live in a given state and have made a purchase within the past 30 days.
About this solution: This is a good solution that demonstrates a level of completeness and solves the problem. The approach is efficient and uses the index on the state column to find all customers in the given state, and then filters out the ones who have not made a purchase in the past 30 days.
Nov 28
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This problem asks you to generate all possible subsets from a set of distinct integers. For example, given the input [1,2,3], the output should be [[3],[1 ],[2],[1,2,3],[1,3],[2,3],[1,2],[]]
About this solution: The candidate's solution is complete and solves the problem. The candidate's approach is to first add the empty subset to the result, and then iterate through the numbers in the input array. For each number, the candidate loops through all the subsets in the result and adds the number to create a new subset. This approach is correct.
Nov 28
Databases / SQL DifficultyHard SQL
Design a SQL query that will return the titles of all books that are currently checked out from a library catalog.
About this solution: The candidate's solution is complete and solves the problem. The candidate's approach is straightforward and easy to understand.
Nov 28
Code Problem / Data Structures and Algorithms DifficultyMedium Python
The problem is to find the sum of all the integers in a stack. An example input is given, as well as the expected output.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Nov 28
Databases / SQL DifficultyHard SQL
Given a table of data with two columns, "id" and "value", this SQL query will find all rows where the value is greater than the average value.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also efficient, as it only requires one pass through the table.
Nov 28