Lowest Common Ancestor of a Binary Tree — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
Category: interview
-
Number of subsets
For a given list of integers and integer K, find the number of non-empty subsets S such that min(S) + max(S) Read more →
-
Verifying an Alien Dictionary (Js)
Verifying an Alien Dictionary (Js) — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Filter objects (ES6)
Filter objects (ES6) — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Rotate Matrix
To perform in place rotation of a matrix, the matrix needs to be a square matrix (n x n i.e., n-rows and n-columns). This case is similar to a square image rotation. The Javascript (ES6) code to rotate… Read more →
-
Currying
Breaking down a function into a series of function calls with an argument. The following is an Javascript ES6 example of a sum function that returns the sum of the calls until no argument is passed. Code Demo Read more →
-
Range Sum Query 2D Mutable – Java
We can use a 2D Binary Indexed Tree (Fenwick Tree) to efficiently calculate sum in a rectangular area in a mutable 2D matrix. An alternative approach could be to convert the 2D array into a 1D array. For… Read more →
-
Union find with path compression (Js, Java)
Union find with path compression (Js, Java) — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Dropdown ES6
Dropdown ES6 — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →