TGViewer
Coding Projects Coding Projects @programming_experts · 67.9K subscribers
Post #2756 2.86K
🚀 Coding Interview Questions with Answers (Part 6)

5️⃣1️⃣ What is a Hash Table?
Answer:
A hash table (also called a hash map or dictionary) is a data structure that stores data as key-value pairs. It uses a hash function to calculate an index where the value is stored, enabling very fast lookup, insertion, and deletion.

Average Time Complexity:
• Search: O(1)
• Insert: O(1)
• Delete: O(1)

Applications:
• Caching
• Database indexing
• Dictionaries
• Symbol tables

5️⃣2️⃣ What is Hashing?
Answer:
Hashing is the process of converting a key into a fixed-size integer (called a hash value) using a hash function. This hash value determines where the data will be stored in a hash table.

Benefits:
• Fast data retrieval
• Efficient searching
• Reduced lookup time

5️⃣3️⃣ What are Collisions in Hashing?
Answer:
A collision occurs when two or more different keys produce the same hash value and are assigned to the same index in a hash table.

Common Collision Resolution Techniques:
• Separate Chaining
• Linear Probing
• Quadratic Probing
• Double Hashing

5️⃣4️⃣ What is a Binary Tree?
Answer:
A binary tree is a hierarchical data structure in which each node has at most two children, known as the left child and the right child.

Applications:
• Expression trees
• File systems
• Decision trees
• Hierarchical data representation

5️⃣5️⃣ What is a Binary Search Tree (BST)?
Answer:
A Binary Search Tree (BST) is a binary tree in which:
• All values in the left subtree are smaller than the root.
• All values in the right subtree are greater than the root.

This property allows efficient searching, insertion, and deletion.

Average Time Complexity:
• Search: O(log n)
• Insert: O(log n)
• Delete: O(log n)

5️⃣6️⃣ What is an AVL Tree?
Answer:
An AVL Tree is a self-balancing Binary Search Tree where the height difference (balance factor) between the left and right subtrees of any node is at most 1.
Whenever the tree becomes unbalanced, rotations are performed to restore balance.

Benefit: Maintains O(log n) search, insertion, and deletion time.

5️⃣7️⃣ What is a Heap?
Answer:
A heap is a complete binary tree that satisfies the heap property.

Types:
• Min Heap: The parent node is smaller than or equal to its children.
• Max Heap: The parent node is greater than or equal to its children.

Applications:
• Priority Queues
• Heap Sort
• Scheduling algorithms

5️⃣8️⃣ What is the Difference Between a Min Heap and a Max Heap?
Answer:
Min Heap
• Smallest element is at the root.
• Parent ≤ Children.
• Used when the minimum value is frequently required.

Max Heap
• Largest element is at the root.
• Parent ≥ Children.
• Used when the maximum value is frequently required.

5️⃣9️⃣ What is a Graph?
Answer:
A graph is a non-linear data structure consisting of vertices (nodes) and edges that connect those vertices.
Graphs can be:
• Directed or Undirected
• Weighted or Unweighted
• Cyclic or Acyclic

Applications:
• Social networks
• GPS navigation
• Computer networks
• Recommendation systems

6️⃣0️⃣ What are the Types of Graphs?
Answer:
Graphs are classified into several types based on their structure:
• Directed Graph: Edges have a direction.
• Undirected Graph: Edges have no direction.
• Weighted Graph: Edges have weights or costs.
• Unweighted Graph: All edges have equal weight.
• Cyclic Graph: Contains one or more cycles.
• Acyclic Graph: Does not contain any cycles.
• Connected Graph: Every node is reachable from every other node.
• Disconnected Graph: Some nodes cannot be reached from others.

🔥 Double Tap ❤️ For Part-7
  • ❤ 10
More from @programming_experts
  1. Oct 7, 2026🧩Now, Let's Understand Functions in Programming 👨‍💻🔥 After variables, operators, condi…
  2. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
  3. Oct 7, 2026𝗠𝗮𝘀𝘁𝗲𝗿 𝗣𝗼𝘄𝗲𝗿 𝗕𝗜 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘! 🔥 Learn Power BI through these FREE learnin…
  4. Sep 29, 2026Post #2901
  5. Sep 29, 2026Post #2900
  6. Sep 29, 2026Post #2899
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →