
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
2K+ Views
We have to write a function, say searchRecursively() that takes in an array and a search query and returns the count of that search query in the nested array.For example, if the array is given by −const names = ["rakesh", ["kalicharan", "krishna", "rakesh", "james", ["michael", "nathan", "rakesh", "george"]]];Then −searchRecursively(names, ‘’rakesh’);Should ... Read More

AmitDiwan
508 Views
We have to write a function that takes in two objects, merges them into a single object, and adds the values for same keys. This has to be done in linear time and constant space, means using at most only one loop and merging the properties in the pre-existing objects ... Read More

AmitDiwan
1K+ Views
Let’s say, we are required to write a function, say intToRoman(), which, as the name suggests, returns a Roman equivalent of the number passed in it as an argument.Let’s write the code for this function −Exampleconst intToRoman = (num) => { let result = ""; while(num){ ... Read More

AmitDiwan
1K+ Views
We have an array of elements that contains both truth and false values. Our job is to write a function that returns an array with indices of those elements which are NaN in the original array.NaN !== NaNThe datatype of NaN is actually number. Although NaN is a falsy value, ... Read More

AmitDiwan
136 Views
Let’s say, we have two arrays both containing String literals, one of which is required to sort alphabetically, but if this array, the one we have to sort contains some words from the other array, those words should appear at the very top and the rest of the element should ... Read More

AmitDiwan
278 Views
Let’s say, we have to write a function that takes in a number and returns an array of numbers with elements as the digits of the number but in reverse order. We will convert the number into a string, then split it to get an array of strings of digit, ... Read More

AmitDiwan
312 Views
We have to write a function that generates a random color between two given colors. Let’s tackle this problem in parts −First → We write a function that generates a random number between two given numbers.Second → Instead of using the hex scale for random color generation, we will map ... Read More

AmitDiwan
2K+ Views
We have to write a function that takes in an object with many keys and replaces all false values with a dash (‘ - ’). We will simply iterate over the original object, checking for the keys that contain false values, and we will replace those false values with ‘-’ ... Read More

AmitDiwan
364 Views
We have to write a function, say padSting() that takes in two arguments, first is a string and second is a number. The length of string is always less than or equal to the number. We have to insert some random numbers at the end of the string so that ... Read More

AmitDiwan
590 Views
We have an array that contains String and number mixed data types, we have to write a sorting function that sorts the array so that the NaN values always end up at the bottom. The array should contain all the normal numbers first followed by string literals and then followed ... Read More