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++
The shortest path between two nodes in an undirected graph can be found by traversing the graph from one node to the other.
About this solution: The candidate's solution is complete and solves the problem. The candidate uses a breadth-first search approach to find the shortest path between two nodes.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem asks us to find the first non-repeating character in a given string. For example, if the string is "GeeksforGeeks", then the first non-repe ating character is '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 through once. The space complexity of this solution is O(n) because the dictionary is the same size as the input string.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium C#
Implement a queue using two stacks. This means that when you enqueue an item, it goes onto one of the stacks, and when you dequeue an item, it comes off of the other stack.
About this solution: The candidate's solution correctly implements a queue using two stacks. However, the code could be more concise. For example, the ShiftStacks method can be simplified. Additionally, the candidate does not provide any comments explaining the code.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
Find the sum of the first n integers in a list.
About this solution: This solution is correct and demonstrates a level of completeness. The approach is also optimal, as it has a time complexity of O(n).
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem is about determining if a given string has all unique characters. An example input would be "abcdefg" and the corresponding output would be "True".
About this solution: The candidate's solution is correct and uses a HashSet, which is an efficient data structure for this problem. The solution is also O(n), which is the best possible time complexity for this problem.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This problem asks you to generate all possible subsets of a given set of distinct integers. For example, if the input is [1,2,3], the output should list all possible subsets: [1], [1,2], [1,2,3], [1,3], [2], [2,3], and [3].
About this solution: The candidate's solution is complete and solves the problem. The approach is to first create an empty subset, and then add each element of the given set to all existing subsets to create new subsets. This is a valid approach to solving the problem.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This problem asks you to reverse the order of a linked list. For example, if the given linked list is 1->2->3->4->5, the output should be 5-> 4->3->2->1.
About this solution: The candidate's solution correctly reverses the nodes in a linked list. The approach is clear and easy to follow.
Nov 29
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
This technical problem deals with returning all possible subsets of a given set of distinct integers. For example, if the input is [1,2,3], the output should be all possible subsets of those integers, which are [], [1], [2], [3], [1,2], [1,3], [2,3], and [1,2, 3].
About this solution: This is a good solution. It is recursive and correctly implements the algorithm. It is also optimal in terms of time and space complexity.
Nov 29