Posts

Showing posts with the label Data Structure

JavaScript Most Commonly Asked Data Structure Questions

Image
Let's See Some Of The Most Commonly Asked Data Structure Interview Questions with Answers Related To Arrays, String and Objects JS Data Structure - Education Funda 1. Custom sorting program in JS via Bubble Sort ? 2. Write a program to check if a string or word or number is palindrome ? Examples of Palindrome Words are:  racecar, madam. 3. Write a program to check if value/target exists or not in ascending array in O(log n) time complexity ? For doing this you should know the Binary Search Algorithm. 4. Write a program to get total vowel count from String ? 5. Write a program to prints factorial of any number ? 6. Write a program for check number is prime or not from 100 to 200 ? 7. Write a program to check whether number is perfect number or not ? Prime Number:  whose SUM of all factors equal to value expect value itself factor. 8. Write a program to find duplicate numbers in an integer array ? 9. How do you find all pairs of an integer array whose sum is equal to a...

DSA Questions As Per Interview Prep SE

Let's see some of the Important Basic to Advanced Questions Regarding Data Structure & Algorithm Array Questions 1. Given a square matrix (2D array), calculate the sum of the primary diagonal and the secondary diagonal.      [[1, 2, 3], [4, 5, 6], [9, 8, 9]]     Primary Diagonal: 1 + 5 + 9 = 15 Secondary Diagonal: 3 + 5 + 7 = 15 2. Find out the duplicate elements from array.      const numArr = [1, 2, 1, 3, 2, 1, 2, 3, 4, 5]     const strArr = "data structure and algorithm discussion" 3.  The Fibonacci series is a sequence of numbers where each number is the sum of the two preceding ones, starting from 0 and 1. Write the program for it      Example: 0,1,1,2,3,5,8,13,21,34,55,…     Time complexity should be O(n)      Formula: F(n)=F(n−1)+F(n−2) 4. Flatten the below given array without using array.flat() method.      [1, [2, 3], [4, 5, 6, [7, 8]]]     Output sho...