
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
512 Views
We are given an array of n entries, of which only 2 are Numbers, all other entries are null. Something like this −const arr = [null, null, -1, null, null, null, -3, null, null, null];We are supposed to write a function that takes in this array and complete the arithmetic ... Read More

AmitDiwan
144 Views
Provided an array of numbers, let’s say −const arr = [12, 54, 6, 23, 87, 4, 545, 7, 65, 18, 87, 8, 76];We are required to write a function that picks the minimum and maximum element from the array and returns an array of those two numbers with minimum at ... Read More

AmitDiwan
391 Views
We are required to write Number.prototype.reverse() function that returns the reversed number of the number it is used with.For example −234.reverse() = 432; 6564.reverse() = 4656;Let’s write the code for this function. We will use a recursive approach like this −Exampleconst reverse = function(temp = Math.abs(this), reversed = 0, isNegative ... Read More

AmitDiwan
257 Views
Digit root of some positive integer is defined as the sum of all of its digits. We are given an array of integers. We have to sort it in such a way that if a comes before b if the digit root of a is less than or equal to ... Read More

AmitDiwan
3K+ Views
We have an array like this −const arr = [{ year: 2020, month: 'January' }, { year: 2017, month: 'March' }, { year: 2010, month: 'January' }, { year: 2010, month: 'December' }, { year: 2020, month: 'April' }, { ... Read More

AmitDiwan
188 Views
We are required to write a function that accepts an array of string literals and returns the index of the longest string in the array. While calculating the length of strings we don’t have to consider the length occupied by whitespacesIf two or more strings have the same longest length, ... Read More

AmitDiwan
1K+ Views
We have an array that contains some number literals and some string literals mixed, and we are required to write a sorting function that separates the two and the two types should also be sorted within.The code for this sorting function will be −Exampleconst arr = [1, 5, 'fd', 6, ... Read More

AmitDiwan
1K+ Views
Let’s say, we have an object that describes various qualities of a football player like this −const qualities = { defence: 82, attack: 92, heading: 91, pace: 96, dribbling: 88, tenacity: 97, vision: 91, passing: 95, shooting: 90 };We wish to ... Read More

AmitDiwan
700 Views
We are here required to write a JavaScript function that takes in an array of numbers and returns another array with the factorial of corresponding elements of the array. We will first write a recursive method that takes in a number and returns its factorial and then we will iterate ... Read More

AmitDiwan
437 Views
Let’s say, we are required to write a function that takes in an array and a number and returns the index of the first element of the first pair from the array that adds up to the provided number, if there exists no such pair in the array, we have ... Read More