
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
1K+ Views
We are required to write a function that takes in a string, trims it off any whitespaces, converts it to lowercase and returns an array of numbers describing corresponding characters positions in the english alphabets, any whitespace or special character within the string should be ignored.For example −Input → ‘Hello ... Read More

AmitDiwan
219 Views
Let’s say, we are required to write a function that takes an array as input and returns the maximum slice of the array which contains no more than two different numbers. If we closely examine this problem this involves checking for a stable sub array and iterating over the original ... Read More

AmitDiwan
784 Views
We are required to write a function, say isEqual() that takes in two strings as argument and checks if they both contains the same characters independent of their order and case.For example −const first = 'Aavsg'; const second = 'VSAAg'; isEqual(first, second); //trueMethod: 1 Using arraysIn this method we convert ... Read More

AmitDiwan
278 Views
Let’s say we have the following array of objects −const people = [{ firstName: 'Ram', id: 301 }, { firstName: 'Shyam', lastName: 'Singh', id: 1016 }, { firstName: 'Dinesh', lastName: 'Lamba', id: 231 }, { id: 341 }, { firstName: ... Read More

AmitDiwan
602 Views
We are given an array of numbers and a number; our job is to write a function that returns an array of all the sub arrays which add up to the number provided as second argument.For example −const arr = [23, 5, 1, 34, 12, 67, 9, 31, 6, 7, ... Read More

AmitDiwan
147 Views
We are given a months array, which elements less than 12, where each element will be between 1 and 12 (both inclusive). Our job is to take this array and create a full months array with 12 elements, if the element is present in the original array we use that ... Read More

AmitDiwan
523 Views
We are required to write a function containsAll() that takes in two arguments, first an object and second an array of strings. It returns a boolean based on the fact whether or not the object contains all the properties that are mentioned as strings in the array.So, let’s write the ... Read More

AmitDiwan
320 Views
We are required to write a function that takes in two numbers and returns their product, but without using the (*) operator.Trick 1: Using Divide Operator TwiceWe know that multiplication and division are just the inverse of each other, so if we divide a number by other number’s inverse, won’t ... Read More

AmitDiwan
272 Views
We are given an object that contains some random properties, including some numbers, boolean, strings and the object itself.We are required to write a function that takes in the object as first argument and a string as second argument, possible value for second argument is a name of any data ... Read More

AmitDiwan
781 Views
Let’s say, we have an array of arrays, each containing some numbers along with some undefined and null values. We are required to create a new array that contains the sum of each corresponding sub array elements as its element. And the values undefined and null should be computed as ... Read More