Algorithms

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem deals with reversing a linked list. An example input is given as 1 -> 2 -> 3 -> 4, and the corresponding output would be 4 -> 3 -> 2 -> 1.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The approach is not clear.
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 C#
This technical problem involves implementing a function that reverses a string using recursion. For example, given the input string "Hello", the function would return the output string "olleH".
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The general approach is not clear.
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