0% found this document useful (0 votes)
16 views4 pages

40 Interview Questions

Upload

Uploaded by

devanand3022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

40 Interview Questions

Upload

Uploaded by

devanand3022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

https://ocw.mit.

edu/courses/6-006-introduction-to-algorithms-fall-2011/pages/lecture-notes/

Here are 40 most asked DSA questions to ace your next interview -

➤ 𝗔𝗿𝗿𝗮𝘆𝘀 𝗮𝗻𝗱 𝗦𝘁𝗿𝗶𝗻𝗴𝘀:

1. Find the maximum sum subarray.

2. Find all substrings that are palindromes.

3. Implement the "two sum" problem.

4. Implement Kadane's algorithm for maximum subarray sum.

5. Find the missing number in an array of integers.

6. Merge two sorted arrays into one sorted array.

7. Check if a string is a palindrome.

8. Find the first non-repeating character in a string.

9. Write a program to remove duplicates from a sorted array.

➤ 𝗟𝗶𝗻𝗸𝗲𝗱 𝗟𝗶𝘀𝘁𝘀:

10. Reverse a linked list.

11. Detect a cycle in a linked list.

12. Find the middle of a linked list. (kth element from end of the linked list)

13. Merge two sorted linked lists.

14. Implement a stack using linked list.

15. Find the intersection point of two linked lists.

➤ 𝗦𝘁𝗮𝗰𝗸𝘀 𝗮𝗻𝗱 𝗤𝘂𝗲𝘂𝗲𝘀:

16. Implement a stack using an array.

17. Implement a stack that supports push, pop, top, and retrieving the minimum element.

18. Implement a circular queue.


19. Design a max stack that supports push, pop, top, retrieve maximum element.

20. Design a queue using stacks. (Implement Stack using queue)

➤ 𝗧𝗿𝗲𝗲𝘀 𝗮𝗻𝗱 𝗕𝗶𝗻𝗮𝗿𝘆 𝗦𝗲𝗮𝗿𝗰𝗵 𝗧𝗿𝗲𝗲𝘀:

21. Find the height of a binary tree.

22. Find the lowest common ancestor of two nodes in a binary tree.

23. Validate if a binary tree is a valid binary search tree.

24. Serialize and deserialize a binary tree.

25. Implement an inorder traversal of a binary tree.

26. Find the diameter of a binary tree.

27. Convert a binary tree to its mirror tree.

➤ 𝗚𝗿𝗮𝗽𝗵𝘀:

28. Implement depth-first search (DFS).

29. Implement breadth-first search (BFS).

30. Find the shortest path between two nodes in an unweighted graph.

31. Detect a cycle in an undirected graph using DFS.

32. Check if a graph is bipartite.

33. Find the number of connected components in an undirected graph.

34. Find bridges/ cut vertices in a graph.

➤ 𝗦𝗼𝗿𝘁𝗶𝗻𝗴 𝗮𝗻𝗱 𝗦𝗲𝗮𝗿𝗰𝗵𝗶𝗻𝗴:

35. Implement (bubble, insertion, selection, merge) sort.

36. Implement quicksort.

37. Implement binary search.

38. Implement interpolation search.

39. Find the kth smallest element in an array.

40. Given an array of integers, count the number of inversions it has. An inversion occurs when two
elements in the array are out of order.
https://docs.google.com/spreadsheets/d/13752-34GdqVl4Ci_YEcp9MMtf6_m3Xrw_giFoy3m1DA/
edit?gid=0#gid=0=

You might also like