Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10740 Articles
AmitDiwan
2K+ Views
Suppose we have an array of two elements with both of its elements being two asynchronous functions. We are required to do some work, say print something to the console (for the purpose of this question) when the execution of both the async function completes.How can we approach this challenge?There ... Read More
AmitDiwan
679 Views
We are required to write a function which compares how many values match in an array. It should be sequence dependent. That means i.e. the first object in the first array should be compared to equality to the first object in the second array and so on.For example −If the ... Read More
AmitDiwan
463 Views
Let’s say, we have a special kind of string that contains characters in couple, like this −const str = "AABBCCDDEE";We are required to construct an object based on this string which should look like this −const obj = { code: "AA", sub: { code: "BB", ... Read More
AmitDiwan
478 Views
Suppose, we have two arrays of literals like these −const arr1 = [4, 23, 7, 6, 3, 6, 4, 3, 56, 4]; const arr2 = [4, 56, 23];We are required to write a JavaScript function that takes in these two arrays and filters the first to contain only those elements ... Read More
AmitDiwan
192 Views
Suppose, we have an array and an object like these −const arr = [1, 2, 3, 4, 5]; const obj = { group1: ["Ram", "Mohan", "Shyam"], group2: ["Jai", "Dinesh"], };We are required to zip the array and the object so that the values in the array are assigned ... Read More
AmitDiwan
168 Views
We have to write a function that takes in an array, removes all duplicates from it and inserts the same number of empty strings at the end.For example −If we find four duplicate values, we have to remove then all and insert four empty strings at the end.ExampleFollowing is the ... Read More
AmitDiwan
2K+ Views
Let’s say, we have to write a simple function in JavaScript that takes in the following array of Numbers (nested to any level) −const arr = [ 15, 24, [ 29, 85, 56, [ 36, 14, 6, ... Read More
AmitDiwan
143 Views
Let’s say, we have an array of arrays of Numbers like below −const arr = [ [1, 16, 34, 48], [6, 66, 2, 98], [43, 8, 65, 43], [32, 98, 76, 83], [65, 89, 32, 4], ];We are required to write a function that maps ... Read More
AmitDiwan
291 Views
Let’s say, we have an array of numbers −const arr = [3, 5, 7, 8, 3, 5, 7, 4, 2, 8, 4, 2, 1];We are required to write a function that returns an array with the average of the corresponding element and its predecessor. For the first element, as there ... Read More
AmitDiwan
217 Views
Let’s say, we are required to write a function that returns the index of the very first element that appears at least twice in the array. If no element appears more than once, we have to return -1. We have to do this in constant space (i.e., without utilizing extra ... Read More