Data Structures and Algorithms (DSA)

🔥 Frequently Asked Interview Questions 🔥

I am soon going to start my blog. All the questions featured here will be answered in detail over there. I will post answers for some of these in Twitter platform as well. Questions will be added with time. Stay tuned.

Now, let's go through the questions.

1️⃣ Basics

✪ What is an algorithm?
✪ What is time complexity?
✪ What is space complexity?
✪ What is a Data Structure?
✪ What are types of Data Structures? (Linear/Non-linear)
✪ What are different operations that can be performed on different data structures?
2️⃣ Array/Stack/Queue/HashTable

✪ Write pseudo code for Array based operations
✪ Write pseudo code for Stack based operations
✪ Write pseudo code for Queue based operations
✪ Implement a Stack using Queue
✪ Implement a Queue using a Stack
✪ What is a dynamic sized array

++
✪ What is an associative array?
✪ What data structure should be used for LRU cache?
✪ Write a code to reverse an array
✪ Write a code to sort an array
✪ What is a Hash Table?
✪ What are Keys and Values in a Hash Table?
✪ What is a Hashing Function?

++
✪ What are different Hashing Functions available?
✪ What is a hash collision?
✪ What are different techniques used to avoid/resolve a hash collision?
✪ How is a Stack different from a Queue?
✪ What is a Dequeue?
✪ What is a Priority Queue?
3️⃣ Linked List

✪ What are various types of linked list?
✪ How is an Array different from a Linked List?
✪ For which use cases Linked List should be preferred?
✪ Write pseudo code to insert/delete/fetch a node in a Linked List

++
✪ Write pseudo code to insert/delete/fetch a node in a Doubly Linked List
✪ How to detect if a cycle (loop) is formed in a linked list?
✪ Reverse a linked list
✪ Retrieve the middle element in a Linked List
✪ Retrieve nth node from the end in a Linked List
4️⃣ Tree

✪ What is a Tree?
✪ What is a Binary Tree?
✪ What is a Binary Search Tree?
✪ What is a Heap?
✪ What is an AVL Tree?
✪ What is a B-Tree?
✪ What is a B+ Tree?
✪ What is a Red Black Tree?
✪ What is a Trie?
✪ How to find height of a binary tree?

++
✪ What is depth of a node?
✪ What is degree of a node?
✪ What is In-Order, Pre-Order and Post-Order Traversals?
✪ Convert a Double Linked List to a Binary Tree
✪ Convert a Binary Tree to a Double Linked List
✪ How to check if a Binary Tree is Binary Search Tree?

++
✪ What is a Heap?
✪ What is a Max Heap and, Min Heap?
✪ What is Heapify operation?
✪ How to pick a max/min element from a Heap?
✪ How to extract a max/min element from a Heap?
✪ What is the difference between pick and extract?
✪ What is a Fibonacci Heap?
5️⃣ Graphs

✪ What data structures are used to represent a graph?
✪ How is a Graph different from a Tree?
✪ What is BFS and DFS?
✪ Which data structures is used for BFS and DFS?
✪ What is Minimum Spanning Tree
✪ What is Kruskal's algorithm?
✪ What is Prim's algorithm?
6️⃣ Sorting/Searching

✪ Explain Best Case, Worst Case and Average Case Time Complexities of various sorting algorithms
✪ What is the worst case for Merge Sort?
✪ What is the worst case for Quick Sort?
✪ What are different searching algorithms available?
7️⃣ Algorithms

✪ What is recursion?
✪ What is divide and conquer? Give some example.
✪ What is a greedy algorithm? Why is it used?
✪ Mention some greedy algorithm.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Swapna Kumar Panda ✨

Swapna Kumar Panda ✨ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

27 Oct
JavaScript CookBook: 7️⃣ Recipes for this Week

Recipes

1️⃣ Complex String Formation
2️⃣ String Conversions
3️⃣ Default Value Assign
4️⃣ Default Function Parameters
5️⃣ Checking properties of a possibly Nullish Object
6️⃣ Fetching Values from an Object
7️⃣ Function Argument List
Recipe 1️⃣

✪ What to Cook?
Complex String Formation

✪ Ingredient
`` (String Template Literal)

✪ Cooking Process
You were cooking like this (tedious):

→ 'Hello ' + fName + ' ' + lName

Instead cook like this:

→`Hello ${fName} ${lName}'
Read 9 tweets
26 Oct
🔥 Resources to learn Data Structures and Algorithms

1️⃣ Twitter Threads

I post almost regular threads on DSA. Check out those 👇
twitter.com/i/events/14502…
2️⃣ Blogs/Articles

1️⃣ Swapna's blog is coming soon. It will include from simple to complex topics on DSA. It will also help you getting through how to approach for solving the problem. It should be your one-stop to get familiar with DSA.

Some more to look for 👇
Read 9 tweets
26 Oct
Linked List: Frequently used Operations

🔥 Interview Questions with Beginner Friendly Explanations and Pseudo Code 🔥

👇
0️⃣ Basics

✪ What is a Linked List?

• a LINEAR data structure
• its elements may not be in contiguous memory location
• each element has a reference to its next element

✪ What is an element in a Linked List popularly called?
A Node.

++ Image
✪ What is the structure of a Node in Linked List?

A node has 2 parts.

• First one contains the value
• Second one contains the reference (or, pointer) to the next node. For the last node this is NULL as it doesn't point to any other node.

++ Image
Read 20 tweets
23 Oct
Tree, Binary Tree and Binary Search Tree

Know the difference. 👇
0️⃣ Introduction to a Tree

✪ A Tree is a data structure where each element is called as a "Node".

✪ Unlike a Linked List, a Node in a Tree can point many (child) nodes.

✪ The first node from which traversal begins is called the Root Node.

++
✪ Each child node can be root of a separate tree. Each such trees are known as "Subtrees" of a given node.

✪ The number of parents, a node can have is called its "In-Degree" and it is always 1.

✪ The number of children, a node can have is called its "Out-Degree".
Read 7 tweets
22 Oct
Difference between an Array and a Linked List

These differences will make you grasp the fundamentals of both Array and Linked List really quick.

And if you are preparing for any interviews, it would definitely help you.

Let's explore 👇
1️⃣ Storage
2️⃣ Size
3️⃣ Access of Elements
4️⃣ Insertion/Deletion of Elements
5️⃣ Search for Elements
6️⃣ Memory Allocation
7️⃣ Memory Usage
8️⃣ Memory Utilisation
9️⃣ Use case

Read 12 tweets
22 Oct
All you would like to know about

✪ Array Data Structure
✪ Array Operations
✪ Array Based Problems

* Time and Space Complexities covered

DSA Series: 🧵 👇
We will cover

1️⃣ Introduction
2️⃣ Array Size
3️⃣ Array Index
4️⃣ Array Dimension
5️⃣ Array Operations
6️⃣ Other Array-based Data Structures
7️⃣ Some Array-based Problems
1️⃣ Introduction

An array is a "collection of items" stored at contiguous memory locations.

Syntax: All items are written comma-separated inside square brackets.

Example: [1, 2, 3, 4, 5]

There are total 5 items in the array. 1 is the first item, 2 is the 2nd and 5 is the last.
Read 22 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(