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:
Databases / SQL DifficultyMedium SQL
The table has two columns, id and data. The query should return the data in ascending order of id.
About this solution: The candidate's solution correctly returns the data in the table in ascending order of id. The solution is complete and solves the problem. The approach is straightforward and easy to understand.
Nov 02
Databases / SQL DifficultyMedium SQL
This question asks for the 5th highest salary from the "Employees" table. The example input is a table with id, name, and salary columns, and the example output is a table with a salary column.
About this solution: The candidate's solution correctly finds the 5th highest salary from the "Employees" table. The solution uses a with statement to create a rating table, which is then used to select the 5th highest salary. This is a valid approach and the solution correctly solves the problem.
Nov 02
Databases / SQL DifficultyMedium SQL
Write a SQL query that returns the total quantity of each product ordered by each customer.
About this solution: The candidate's solution correctly returns the total quantity of each product ordered by each customer. The solution uses the GROUP BY clause to group the customer and product IDs together, and then uses the SUM function to calculate the total quantity for each group. The solution is clear and concise.
Nov 02
Games / Two-player Games
None
About this solution: The candidate's solution is correct and demonstrates a good understanding of the game of NIM.
Nov 01
Code Problem / Strings DifficultyMedium Python
This problem asks you to find the first character in a string that is not repeated elsewhere in the string. For example, given the string "abcdab", the answer would be "c ".
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate's approach is also optimal, as it iterates through the string only once to create the dictionary and then iterates through the string again to find the first character that is not repeated.
Nov 01
Data structures / Arrays Python
None
About this solution: The candidate's solution is correct. They have correctly identified that the output will be 5. They have also correctly identified the reason for this, which is that the for loop will only iterate through the list once and remove the first 2.
Oct 31
Databases / SQL DifficultyMedium SQL
This technical problem involves writing an SQL query that returns the top 3 most purchased products by customers. The example input and output are provided.
About this solution: The solution above is optimal because it uses the ORDER BY and LIMIT clauses to sort the table by product_id in descending order and then limit the results to the top 3.
Oct 31
Databases / SQL DifficultyMedium SQL
This problem asks for a SQL query to find all users in a table who have a valid email address.
About this solution: The solution correctly uses the LIKE operator to check if the email contains an @ symbol.
Oct 31