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 asks for the shortest route between two nodes in a graph. The input is a list of nodes and their connections. The output should be the shortest route between the two given nodes.
About this solution: The candidate's solution correctly implements a breadth-first search to find a route between two nodes in a graph. The solution is complete and correctly handles edge cases such as null input values.
Dec 07
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem asks you to reverse a singly linked list. An example input is given as 1->2->3->4->5, and the expected output is 5->4->3 ->2->1.
About this solution: The candidate's solution correctly implements a solution to reverse a singly linked list, both iteratively and recursively. The iterative solution is more efficient, however, both solutions are correct. The candidate demonstrates a good understanding of linked lists and how to reverse them.
Dec 07
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
This problem deals with finding the index of an element in a sorted array of integers. The input is a sorted array of integers and an integer value to find. The output is the index of the value in the array, or -1 if the value is not present in the array.
About this solution: The candidate's solution is correct and uses binary search, which is the most efficient way to search a sorted array for a specific value. The candidate's code is well-written and easy to understand.
Dec 07
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
To sum all elements in a list, we can simply iterate through the list and add each element to a running total. This will take O(n) time, where n is the length of the list.
About this solution: This solution is correct and demonstrates a level of completeness. The approach is straightforward and easy to follow.
Dec 06
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem involves reversing a linked list using recursion. The given example input is a list of integers, but this technique can be applied to lists of any data type. The output should be the reverse of the input list.
About this solution: The candidate's solution correctly reverses the nodes in a linked list. The approach is straightforward and easy to understand. The code is well-organized and easy to read.
Dec 06
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
Write a function that takes a linked list as input and returns the second to last node in the list.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The approach is also optimal, as it only requires one pass through the list.
Dec 06
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem asks for all possible permutations of a set of distinct integers.
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 remaining numbers.
Dec 06
Code Problem / Data Structures and Algorithms DifficultyMedium C++
Given a 2D array of integers, write a function that returns the length of the longest path of consecutive integers starting from the top left corner of the array. The path can move up, down, left, or right.
About this solution: The candidate's solution is complete and solves the problem. The candidate has taken a dynamic programming approach, which is a good approach for this problem. The candidate's code is well-written and easy to understand.
Dec 05