What kind of data structure (C/C++) questions can a 2-year experienced expect in an interview?

"Problem Solving in Data Structures and Algorithms using C" by Hemant Jain is a great resource for preparing for data structure questions in a C/C++ interview. It covers a wide range of data structures and algorithms with examples in C.

As a 2-year experienced candidate, you can expect to be asked a variety of data structure questions in a C/C++ interview. Here are some examples of data structure questions that you may encounter:

  1. Arrays and strings: Questions related to arrays and strings such as finding duplicates in an array, finding the maximum sum subarray, and finding the first non-repeating character in a string.
  2. Linked lists: Questions related to linked lists such as implementing a linked list, reversing a linked list, finding the middle element in a linked list, and detecting a cycle in a linked list.
  3. Stacks and queues: Questions related to stacks and queues such as implementing a stack and queue using an array and linked list, finding the minimum element in a stack, and implementing a queue using two stacks.
  4. Trees: Questions related to trees such as implementing a binary search tree, finding the height of a binary tree, traversing a tree (preorder, inorder, and postorder), and finding the lowest common ancestor of two nodes in a binary tree.
  5. Graphs: Questions related to graphs such as implementing a graph, finding the shortest path between two nodes in a graph, and detecting a cycle in a graph.