Code Challenges

Get better at coding with practice problems.

Coding Challenges

Select a problem, write code, run test cases, and submit your solution.

Showing 19 of 355 problems

Implement the palindromeLinkedListCheck method that checks whether the linked list values form a palindrome. Solved

Implement the middleNodeLinkedList method that returns the value stored at the middle node of the linked list. Solved

Implement the removeNthNodeFromEnd method that removes the nth node from the end and returns the updated list values. Solved

Implement the mergeTwoSortedLinkedLists method that merges two sorted linked lists and returns the sorted values. Solved

Implement the detectCycleLinkedListValues method that checks whether the linked list has a cycle at the given position. Solved

Implement the reverseLinkedListInterview method that returns linked list values after reversing the list. Solved

Implement the movingAverageStreamLast method that returns the last moving average value for a fixed-size window. Solved

Intermediate

Implement the circularTourStartIndex method that returns a starting petrol pump index that can complete the circular tour. Solved

Intermediate

Implement the taskSchedulerIntervals method that returns the minimum intervals required to schedule tasks with cooldown. Solved

Proficient

Implement the shortestPathBinaryMatrixLength method that returns the shortest path length through a binary matrix. Solved

Intermediate

Implement the openLockMinimumTurnsSimple method that returns the minimum turns needed to reach the lock target. Solved

Intermediate

Implement the perfectSquaresBfsSteps method that returns the minimum number of perfect squares that sum to n. Solved

Intermediate

Implement the numberOfIslandsBfsCount method that counts islands in a grid using breadth-first search. Solved

Intermediate

Implement the rottingOrangesMinutes method that returns the minutes required for all fresh oranges to rot. Solved

Intermediate

Implement the firstNonRepeatingCharacterStream method that returns the first non-repeating character after processing a stream. Solved

Proficient

Implement the slidingWindowMaximumDeque method that returns maximum values for every sliding window of size k. Solved

Implement the basicCalculatorPlusMinus method that evaluates an expression containing plus and minus operations. Solved

Implement the onlineStockSpanLast method that returns the latest stock span value from the price stream. Solved

Implement the removeKDigitsMinimum method that removes k digits to form the smallest possible number. Solved