Data structures Interview Questions

Sort: Popular Date
Sort: Popular Date

“Given a singly linked list, how can you find if there is a loop in the list?”

“Binary tree with parent pointers, given two nodes find common ancestor.”

“Write a code for finding a certain element in an unsorted array assuming element definitely exists. How can we improve the efficiency?”

“How would you print last n elements of a linked list, n being small compared to size of linked list?”

“Given an array of integers, all but one of which appears an even number of times, find the one integer which appears an odd number of times.”

1 of 1 found helpful

“Give me 5 different ways of finding the median (middle element) of a linked list. For the sake of simplicity, assume the list has odd number of ints. Also mention the runtime for each.
Follow up…”

“How would you implement a stack to achieve constant time for "push", "pop" and "find mininum" operations?”

“1. Find common elements between two arrays of integers.
2. Find cycles in a graph.
3. Efficiently find duplicate elements in an array of numbers with bounded entries (for example, elements are…”

“Create a Queue using two Stacks.”

“3. Trees (binary and otherwise) form the basis of many common data structures.
Please describe some of these data structures and when they might be used.”

2130 of 111 Interview Questions