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
298 Views
We are required to write a JavaScript program that reverses the order of the bits in a given integer.For example −56 -> 111000 after reverse 7 -> 111Another example, 234 -> 11101010 after reverse 87 -> 1010111Exampleconst num1 = 789; const num = 43 const reverseBits = (num = 1) ... Read More
AmitDiwan
429 Views
Given a string s which consists of lowercase or uppercase letters, we are required to return the length of the longest palindrome that can be built with those letters. Letters are case sensitive, for example, "Aa" is not considered a palindrome here.For example −If the input string is −const str ... Read More
AmitDiwan
351 Views
We are required to write a JavaScript function that takes in a non-negative Integer and computes and returns its square root. We can floor off a floating-point number to an integer.For example: For the number 15, we need not to return the precise value, we can just return the nearest ... Read More
AmitDiwan
394 Views
We are required to write a JavaScript function that takes a string as input and reverse only the vowels of a string.For example −If the input string is −const str = 'Hello';Then the output should be −const output = 'Holle';The code for this will be −const str = 'Hello'; const ... Read More
AmitDiwan
111 Views
Consider the following input and output arrays −const input = ["0:3", "1:3", "4:5", "5:6", "6:8"]; const output = [ [0, 1, 3], [4, 5, 6, 8] ];Considering each number as a node in a graph, and each pairing x:y as an edge between nodes x and y, we ... Read More
AmitDiwan
160 Views
We are required to write a JavaScript function that takes in an array of arrays of Numbers as the first argument and an array of Numbers as the second argument. The function should pick a subarray from each array of the first array, (subarray that contains item common to both ... Read More
AmitDiwan
600 Views
We are required to write a JavaScript function that takes in an array of Numbers that may contain some repeating elements. The function should return the length of the longest repeating number sequence from the array.For example −If the input array is −const arr = [2, 1, 1, 2, 3, ... Read More
AmitDiwan
432 Views
Suppose, we have two arrays like these −const input = ['S-1', 'S-2', 'S-3', 'S-4', 'S-5', 'S-6', 'S-7', 'S-8']; const sortingArray = ["S-1", "S-5", "S-2", "S-6", "S-3", "S-7", "S-4", "S-8"];We are required to write a JavaScript function that takes in two such arrays as first and second argument respectively.The function should ... Read More
AmitDiwan
2K+ Views
Suppose, we have the following JSON object −const obj = { "context": { "device": { "localeCountryCode": "AX", "datetime": "3047-09-29T07:09:52.498Z" }, "currentLocation": { "country": "KM", ... Read More
AmitDiwan
6K+ Views
Suppose we have the following nested JSON object −const obj = { id: 1, title: 'hello world', child: { id: null, title: 'foobar', child: { id: null, title: 'i should ... Read More