Write a class with a method getKey(key, callback) that invokes an API with the provided key. The method should also invoke a callback with the corresponding value returned by the API . Calls that are made within a… Read more →
Category: interview
-
Find the City With the Smallest Number of Neighbors at a Threshold Distance
For a given bidirectional weighted graph, find the node (city) with the least number of nodes reachable within a given threshold. Note: If there are multiple such nodes, then return the node with the highest value among them.… Read more →
-
Window.location object
Javascript can access the URL of the current page with window.location object. This object contains various properties of the URL such as protocol, host, pathname, search and more. window.location.href returns the href (URL) of the current pagewindow.location.hostname returns… Read more →
-
Find the winner
Lets say you want to find the winner of a game where the participants pick up stones (n). If 'A' and 'B' are the 2 players, then the rules of the game are as follows: Player 'A' always… Read more →
-
Multi List Iterator – Javascript
Print a list of lists vertically using an Iterator. For example: Input: Demo You can print this list horizontally as well. For example: Input: Demo Read more →
-
Items in Container
An inventory management system represents items and compartment walls as a string s: * represents an item. | represents a compartment wall (pipe). An item is considered enclosed (inside a valid compartment) only if it lies between two… Read more →
-
In-Flight Media
In-Flight Media — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Implement Array.prototype.map()
Implement Array.prototype.map() — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Create Array of size in Js
Create Array of size in Js — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →
-
Uglify CSS Class names
Uglify CSS Class names — clean JavaScript solution and code implementation for software engineering interview preparation. Read more →