# Author: Kavit

## Minimum Absolute Difference in an Array

Given an array of integers, find and print the minimum absolute difference between any two elements in the array. For example, Input: -59 -36 -13 1 -53 -92 -2 -96 -54 75 Output: 1...

## Evaluate Reverse Polish Notation in Javascript

Input: [“3”, “1”, “+”, “5”, “*”] Output: 9 Explanation: ((3 + 1) * 5) = 20 Algorithm: The key thing to realize in this to use stack as a data structure for the solution....

## Merge Two Sorted Linked Lists in Javascript

Problem : Given list l1 = 1->2->3. And list l2 = 10->20->30. Generate a new list mergedList = 1->2->3->10->20->30. Given list l1 = 1->3->4. And list l2 = 1->2->3. Generate a new list mergedList...

## Programming shorthands / tricks

Different ways to track the max value while iterating over different values We can use if, ternary operator or Math.max function as shown below. if (val > max) {   max = val...

## Find the first unique character in a given string or an array

Problem You are given an a string of characters including duplicates. You need to find the first non-repeating / unique character. input: foobar output: f input: aabbccdef output: d input: aabbcc output: ‘No Unique...

## Loop over an array with the given timeout for each element

Problem You are given an array of objects each with its name and timeout value. Iterate over each element inside an array in the interval of the given timeout. Solution We have to set...

## Create a protocol to transmit numbers efficiently or Huffman coding puzzle

Problem statment There are two people on different sides of the bridge. The only way they can communicate is via Flash lights. One person wants to communicate the numbers, came up with roll of...

## Top 10 Interview Questions for Front-end, Web, ui, JavaScript Developers

Gauging candidates knowledge of Javascript, HTML, CSS skills in less than an hour is certainly a challenging task. It is almost impossible to calibrate candidates success at the company by asking technical questions. If...

## Implement the bind function in javascript

Implement the Function.prototype.bind function in javascript bind allows you to change the scope of this also allows you to create functions when called are prefixed with arguments as shown in the solution (aka currying,...

## Fix a function that assigns event handler functions to an array of nodes the wrong way

Fix the following function. When you click on a node, an alert box is supposed to display the ordinal of the node. But it always displays the number of nodes + 1 instead. [codepen_embed...