0% found this document useful (0 votes)
4 views3 pages

DSA Interview Questions

The document lists various data structures and algorithms (DSA) interview questions categorized into basic, intermediate, and advanced levels. It covers fundamental concepts such as algorithms, data structures, sorting techniques, and more complex topics like dynamic programming and graph algorithms. Each question is paired with a brief definition or explanation, providing a comprehensive overview for interview preparation.

Uploaded by

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

DSA Interview Questions

The document lists various data structures and algorithms (DSA) interview questions categorized into basic, intermediate, and advanced levels. It covers fundamental concepts such as algorithms, data structures, sorting techniques, and more complex topics like dynamic programming and graph algorithms. Each question is paired with a brief definition or explanation, providing a comprehensive overview for interview preparation.

Uploaded by

amulyamg28
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DSA INTERVIEW QUESTIONS (BASIC TO ADVANCED)

BASIC DSA QUESTIONS

1. What is an algorithm? A step-by-step process to solve a problem.

2. What is a data structure? Way to store/organize data.

3. Array vs Linked List? Array fixed, Linked list dynamic.

4. What is stack? LIFO.

5. What is queue? FIFO.

6. What is recursion? Function calling itself.

7. Hash table? Key-value structure.

8. Tree? Hierarchical structure.

9. Binary tree? Max 2 children.

10. BST? Left < root < right.

11. Graph? Nodes + edges.

12. BFS vs DFS? Level vs depth.

13. Time complexity? Algorithm running time.

14. Space complexity? Memory usage.

15. Big-O? Worst-case complexity.

16. Linear search? O(n).

17. Binary search? O(log n), needs sorted array.

18. Sorting? Arrange data.

19. Bubble sort? Swap adjacent.

20. Selection sort? Pick min each time.

INTERMEDIATE DSA QUESTIONS

1. Merge sort? Divide and merge, O(n log n).

2. Quick sort? Fast avg, O(n log n).

3. Dynamic programming? Memo + reuse.

4. DP examples? Fibonacci, knapsack.

5. Memoization vs tabulation? Top-down vs bottom-up.


6. Heap? Tree with min/max property.

7. Heap usage? Priority queue.

8. Trie? Prefix tree.

9. Balanced tree? Height minimized.

10. AVL vs BST? AVL balanced.

11. Backtracking? Try/fail/backtrack.

12. Greedy? Local best choice.

13. Kruskal vs Prim? Edge vs node based MST.

14. Topological sort? DAG ordering.

15. DAG? No cycles.

16. Sliding window? Optimize subarray problems.

17. Two-pointer? Left/right pointer technique.

18. Hash collision? Two keys same slot.

19. Collision resolution? Chaining.

20. Open addressing? Linear probing etc.

ADVANCED DSA QUESTIONS

1. Segment tree? Range queries.

2. Fenwick tree? Prefix sum optimization.

3. LRU cache? O(1) cache using DLL+hashmap.

4. KMP? Pattern matching.

5. Rabin-Karp? Hash-based matching.

6. Dijkstra? Shortest path positive weights.

7. Bellman-Ford? Works with negative edges.

8. Floyd Warshall? All-pairs shortest path.

9. DSU? Union-find structure.

10. Top-K? Min-heap / quickselect.

11. Quickselect? Kth smallest.

12. Trie complexity? O(length).


13. Suffix array? Sorted suffixes.

14. Suffix tree? Compressed suffix trie.

15. Rolling hash? Fast substring checking.

16. Floyd cycle detection? Slow/fast pointers.

17. Interpolation search? Improved binary search.

18. Red-black tree? Balanced BST.

19. Amortized analysis? Average cost over ops.

20. Bloom filter? Probabilistic set membership.

You might also like