
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 10744 Articles

AmitDiwan
391 Views
We are required to write a function that does the following transformation −If the input object is −const input = { a: 0, b: {x: {y: 1, z: 2}}, c: 3 };Then the output of the function should be −const output = { a: 0, ... Read More

AmitDiwan
209 Views
Let’s say, we are required to write a function, say parseEqualInterval() that takes in an array of Numbers of strictly two elements as the first argument and a number n as the second argument and it inserts n-1 equidistant entries between the actual two elements of the original array so ... Read More

AmitDiwan
427 Views
Let’s say, we are required to write a function, say isSame() that accepts a nested object and returns a boolean depending on the fact whether or not all the keys have the same values. When saying all the keys we mean all the last keys like if a key has ... Read More

AmitDiwan
268 Views
We are required to write a function, say minMax() that takes in an array of Numbers and rearranges the elements such that the greatest element appears first followed by the smallest elements then the second greatest element followed by second smallest element and so on.For example −// if the input ... Read More

AmitDiwan
209 Views
Consider we have an array of Numbers that looks like this −const array = [3.1, 1, 2.2, 5.1, 6, 7.3, 2.1, 9];We are required to write a function that counts how many of the elements are in the array below / above a given number.For example, if the number is ... Read More

AmitDiwan
1K+ Views
We have an array of objects like this −const arr = [ { value: 12, gap: 1 }, { value: 13, gap: 1 }, { value: 14, gap: 1 }, { value: 15, gap: 1 }, { value: 19, gap: 2 }, { value: ... Read More

AmitDiwan
264 Views
We are required to write a function that takes in a string as the first and the only argument and constructs an object with its keys based on the unique characters of the string and value of each key being defaulted to 0.For example −// if the input string is: ... Read More

AmitDiwan
185 Views
We are required to write a function splitNumber() that takes in a positive integer and returns an array populated with the place values of all the digits of the number.For example −//if the input is: const num = 2346; //the output should be: const output = [2000, 300, 40, 6];Let’s ... Read More

AmitDiwan
1K+ Views
Let’s say, we have an array of string / number literals that contains some duplicate values like this −const array = ['day', 'night', 'afternoon', 'night', 'noon', 'night', 'noon', 'day', 'afternoon', 'day', 'night'];We are required to write a function groupSimilar() that takes in this array and returns a new array where ... Read More

AmitDiwan
185 Views
We are required to write a function that, given an array arr and a number n, returns the array with elements repeating no more than n times. And we have to do all this without disturbing the indices of desired elements. So, let’s write the code for this function, We ... Read More