Devsinc Questions
Devsinc Questions
DSA:
1. Suppose there is an array [1,2,3,4,5,6,7]. Find the largest and second largest number in
this array with O(n) complexity.
2. Suppose there is a 2D array that always remain square (meaning rows == columns). Find
the sum of it’s both diagonals.
[[ 1 , 2 , 3 , 4 ],
[ 2 , 3 , 4 , 5 ],
[ 3 , 4 , 5 , 6 ],
[ 4 , 5 , 6 , 7 ]]
3. Write a function that if you pass in number 3 it should return 1 and if you pass in 1 it
should return 3.
4. How to make a stack using linked list.
5. Make a binary tree using a sorted array.
6. What’s the use case of BST.
7. What’s the time complexity of BST searching.
8. What’s the time complexity of finding a value in Hash table.
9. Suppose there is a sorted array [1,2,3,4,5,6] and a number 10. Find two pairs in this array
whose sum is equal to given number. Make sure to find it in O(n) time complexity.
10. How many ways are there to traverse a BST.
11. What is BFS?
12. Write algorithm for BFS.
13. What is heap tree and what is it used for?
14. What is the use case of BST.
OOP:
1. What is composition?
2. Give real world examples of inheritance.
3. What is static binding in Java?
4. If A class inherits B class and B class inherits C class and you instantiate A’s constructor.
Show how the program will be executed.
5. What is a class?
6. What is static and non-static in Java?
DB:
MERN:
React:
Node JS:
Express JS: