The formula for the area of a circle is given by πr². Use the Monte Carlo method to approximate the…
Given an integer k and a string s, write a function to determine the length of the longest substring in…
There is a staircase with N steps, and you can ascend either 1 step or 2 steps at a time.…
Build an autocomplete system that, given a query string s and a set of possible query strings returns all strings…
Design a job scheduler that accepts a function f and an integer n. The scheduler should execute the function f…
Problem Statement (Asked By Airbnb) Given a list of integers, write a function to compute the largest sum of numbers…
A unival tree (short for "universal value tree") is a tree in which all nodes have the same value. Given…
Problem Statement (Asked By Facebook) Given the mapping a = 1, b = 2, ..., z = 26, and an…
An XOR-linked list is a memory-efficient version of a doubly linked list. Instead of each node storing separate next and…
Problem Statement (Asked By Jane Street) The function cons(a, b) creates a pair of two elements. Implement two functions: car(pair):…