Data Structures
Deep dive into essential data structures that every software engineer must master. From basic arrays and linked lists to advanced structures like tries and segment trees, this category prepares you for any data structure question.
Core Data Structures:
Linear: Arrays, linked lists, stacks, queues
Hierarchical: Binary trees, BSTs, heaps, tries
Hash-based: Hash maps, hash sets, bloom filters
Advanced: Graphs, disjoint sets, segment trees
Key Skills:
Choosing the right data structure for the problem
Understanding time/space tradeoffs
Implementing from scratch in interviews
Optimizing operations (insert, delete, search)
Companies: Every major tech company tests data structures. Particularly important at Amazon, Google, and Microsoft.
Implement a rate limiter
shouldAllowRequest() that returns true if the incoming requests have arrived at a rate less than or equal to specified rate,
Missing country code
Missing Country Code Imagine you get a data set from a client that contains addresses from 150 countries all around
Find Out if a Linked List has a Cycle
Without marking nodes, find out if a linked list has a cycle in it or not.
Missing or Duplicate Number in an Array
Write a function that will find a missing or duplicated number in an array.
Probability Distribution Function
Write code to generate all possible combinations of ‘r’ elements in a given array of size ‘n’?
Find The Depth of a Binary Tree
How will you find the depth of a binary tree?
Check if a Linked list is a Palindrome or Not
Write code that will check if a linked list is a palindrome or not.
Write a program for producer-consumer problem
Write a program for producer-consumer problem. Use a blocking queue.
Serialize and Deserialize a Binary Tree
Write code to serialize and deserialize a given binary tree.
Sum Up a Pair in Array
Can you find a pair in array that will sum up to particular number?
Right Rotate an array by k elements
An array of elements is given arr arr is of length n Right rotate array by k elements Time complexity