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++
Find the minimum path sum in a 2D array from the top-left corner to the bottom-right corner.
About this solution: The candidate's solution correctly solves the problem and uses a dynamic programming approach. The code is well-written and easy to follow.
Dec 04
Code Problem / Data Structures and Algorithms DifficultyMedium Python
Given an array of n integers, find the contiguous subarray of given length k that has the maximum average value. Output the maximum average value.
About this solution: The candidate's solution correctly finds the maximum average value of a given array and length k. The solution is clear and easy to follow. One potential improvement would be to use the built-in max() and sum() functions rather than creating a custom max_sum function.
Dec 04
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This problem deals with finding the first non-repeating character in a given string. For example, if the input string is "GeeksforGeeks", then the output should be ' f'.
About this solution: The candidate's solution correctly finds the first non-repeating character in a string. The solution uses a hash map to keep track of the number of times each character appears in the string, then loops through the string again to find the first character with a count of 1. One potential improvement to this solution would be to use a LinkedHashMap instead of a regular hash map. This would allow the characters to be iterated over in the order in which they appear in the string, which would make the second loop unnecessary.
Dec 03
Code Problem / Data Structures and Algorithms DifficultyMedium Python
Given a binary tree, this function checks whether it is symmetrical around its center. For example, the first tree in the input is symmetrical, but the second one is not.
About this solution: The candidate's solution correctly implements a recursive solution to check if a binary tree is symmetric. The approach is sound, and the code is clean and easy to follow.
Dec 03
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This technical problem deals with determining whether or not a given string consisting of only brackets is valid. A string is considered valid if the open brackets are closed by the same type of brackets in the correct order. An empty string is also considered valid.
About this solution: The candidate's solution is correct and uses a stack to keep track of the order of the brackets. The solution is also complete, with tests for all the different cases.
Dec 03
Code Problem / Data Structures and Algorithms DifficultyMedium Python
Given a list of integers, this code problem finds the largest integer in the list. For example, given the input [1, 2, 3, 4, 5], the output would be 5.
About this solution: This is a good solution that demonstrates a level of completeness and solves the problem. The approach is straightforward and easy to understand.
Dec 03
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
Given an array of n integers, find the contiguous subarray of given length k that has the maximum average value. Output the maximum average value.
About this solution: The candidate's solution is correct and solves the problem. The approach is good, iterating through the array once and keeping track of the sum of the previous k elements. The time complexity is O(n) and the space complexity is O(1).
Dec 03
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
The "two sum problem" is a classic problem in computer science that involves finding two numbers in an array that add up to a given target. This problem can be solved using a simple brute -force approach, but more efficient solutions exist, such as using a hash table.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate has correctly identified the problem and has provided a solution that solves the problem. The candidate's approach is general and could be applied to similar problems.
Dec 02