Data structures Interview Questions | Glassdoor

Data structures Interview Questions

117

interview questions shared by candidates

Data structures Interview Questions

Sort: Relevance Popular Date

Design an LRU cache

1 Answer

What are the differences between a linked list and an array? What are the pros and cons? What kind of situations would you use each in? Can a stack be a queue? Can a queue be a stack?

1 Answer

reverse a linked list, in place

1 Answer

How do you avoid collisions when multiple keys map to same hash value.

1 Answer

HashMap implementation

1 Answer

Write a function that given a sequence and a number b between [-10,10] return a new sequence. Sequences are generated by this: http://en.wikipedia.org/wiki/Look-and-say_sequence a number b if equal to 0 the function will return the input sequence Valid sequences: 1 11 21 1211 111221 ... Example: input: 1211, +1 output: 111221 Example: input: 111221, -1 output: 1211

3 Answers

main() { A() C() } A() { B() } B() {} C() {} input: t1 main enter t2 A enter t3 B enter t4 B exit t5 A exit t6 C enter t7 C exit t8 main exit output: main (t8-t1) A (t5-t2) B (t4-t3) C (t7-t6) Write a function that given the input will create the output

1 Answer

Create an application/program that lists all words in the English language that can be created using a set of random characters. Characters cannot be reused, words must use all characters in the set.

1 Answer

Implement a stack that supports push, pop and mode(the one from statistics) operation. Gave an O(log n ) push and pop and O(1) mode operation.Another good question was implement atoi function. I assumed it as base 10 but was asked to support from binary to any base numbers(even base 50).

2 Answers

level by level print BST

1 Answer
5160 of 117 Interview Questions