Helping engineers with technical interviews

Category: Coding Problems Page 2 of 3

Leetcode 463 Island Perimeter

Container With Most Water

The Container With Most Water is a classic problem in algorithmic and computational thinking, that is often used to test the efficiency and problem-solving skills of developers. The problem statement is as follows: You are given a list of n non-negative integers, where each integer represents a vertical line at position i with a height […]

Read More
Leetcode 463 Island Perimeter

Median of Two Sorted Arrays

The problem we’re looking at is called “Median of Two Sorted Arrays.” Essentially, we’re given two sorted arrays of integers, and we need to find the median of the combined array (i.e., the middle value when the two arrays are merged together). The twist is that we’re not allowed to actually merge the two arrays […]

Read More
Leetcode 463 Island Perimeter

Longest Substring Without Repeating Characters

The problem “Longest Substring Without Repeating Characters” is a classic algorithmic problem in computer science. Given a string, the task is to find the length of the longest substring within the string that does not contain any repeated characters. For example, consider the input string “abcabcbb”. The longest substring without repeating characters is “abc”, which […]

Read More
Leetcode 463 Island Perimeter

Find the nth Node from the end of a Linked List

The problem of finding the nth node from the end of a linked list involves finding the node that is n positions away from the end of the linked list. For example, if the linked list has 10 nodes and n is 3, we need to find the 3rd node from the end of the […]

Read More
Leetcode 463 Island Perimeter

Check if a Linked List is a Palindrome

A palindrome is a sequence of characters that is read the same forward and backward. For example, “racecar” is a palindrome. In the context of a linked list, we can consider it a palindrome if the sequence of values in the list is the same when read from left to right and from right to […]

Read More
Leetcode 463 Island Perimeter

Detect and Remove a Loop in a Linked List

A linked list is a data structure in which each element in the list, known as a node, contains a value and a reference to the next node in the list. Here’s an example of a linked list: In this list, each node contains a value and a reference to the next node in the […]

Read More
Leetcode 463 Island Perimeter

Remove duplicates from a sorted linked list.

Given a sorted linked list, write a function to remove all the duplicate elements from the list, such that each element appears only once. Example: Input: 1 -> 1 -> 2 Output: 1 -> 2… Read More

Read More
Leetcode 463 Island Perimeter

Sort a linked list using shared pointer

Linked lists are commonly used data structures in computer programming. Linked lists consist of nodes that are dynamically allocated, meaning that memory must be manually managed. Memory management can be a complex and error-prone task, and to make it easier, shared pointers are used in linked list implementation. Shared pointers are smart pointers that help […]

Read More
Leetcode 463 Island Perimeter

Swapping nodes in a linked list

Swapping nodes in a linked list means exchanging the positions of two nodes in the list. For example, if we have a linked list 1 -> 2 -> 3 -> 4 -> 5 and we want to swap the second and fourth nodes, the result will be 1 -> 4 -> 3 -> 2 -> […]

Read More
Leetcode 463 Island Perimeter

Write a program to find the number of days between two dates

Using datetime library in your choice of language makes it easy to write a program to find the number of days between two dates. We write code with and without using the library. Let’s first find the number of days between two dates with using a library: 1. Prompt the user to enter the first […]

Read More

Page 2 of 3

Powered by WordPress & Theme by Anders Norén