Skip to content
InterviewEra
Loading account navigation
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Product

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Resources

  • Interview Questions
  • All Resources
  • Blog
  • Community Hub
  • DSA Topic Map
  • Placement Guide
  • STAR Guide

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy

© 2026 InterviewEra. All rights reserved.

Privacy Policy|Terms & Conditions|Refund Policy
|Ranchi, Jharkhand, India
Interview Questions›Topics›Data Structures

CS Fundamentals · Fresher-relevant

Data Structures Interview Questions 2026

Data structures interview questions on arrays, linked lists, trees, graphs, stacks, and queues — mandatory for every engineering role at Indian tech companies.

CS FundamentalsFresher-relevant

Data Structures Interview Questions

Placement-oriented · Updated 2026
  1. 01

    When would you use an array vs a linked list?

    TechnicalEasy

    Tip: Arrays give O(1) random access and cache-friendly contiguous memory but O(n) insertion/deletion in the middle. Linked lists give O(1) insert/delete given a node but O(n) access and poor cache locality. Use arrays for indexing-heavy work, linked lists for frequent middle insertions.

  2. 02

    How does a hash table work and how are collisions handled?

    TechnicalMedium

    Tip: A hash function maps keys to bucket indices for average O(1) lookup. Collisions are resolved by chaining (linked list/tree per bucket) or open addressing (linear/quadratic probing). Load factor triggers resizing/rehashing. Worst case degrades to O(n) with poor hashing.

  3. 03

    What is the difference between a stack and a queue?

    TechnicalEasy

    Tip: A stack is LIFO (push/pop at one end) — used for function calls, undo, and DFS. A queue is FIFO (enqueue rear, dequeue front) — used for scheduling and BFS. Both support O(1) insert/remove.

  4. 04

    Compare BFS and DFS on a graph.

    TechnicalMedium

    Tip: BFS uses a queue, explores level by level, and finds shortest paths in unweighted graphs; memory grows with the frontier width. DFS uses a stack/recursion, goes deep first, uses less memory on wide graphs, and suits cycle detection and topological sort. Both are O(V+E).

  5. 05

    What is a binary search tree and when does it degrade?

    TechnicalMedium

    Tip: A BST keeps left < node < right, giving O(log n) search/insert when balanced. Inserting sorted data degrades it into a linked list (O(n)). Self-balancing trees (AVL, Red-Black) keep height logarithmic by rotating on insert/delete.

  6. 06

    What is a heap and what is it used for?

    TechnicalMedium

    Tip: A binary heap is a complete tree where each parent is ≤ (min-heap) or ≥ (max-heap) its children, stored in an array. It gives O(1) peek and O(log n) insert/extract — used for priority queues, Dijkstra, and finding the top-K elements.

  7. 07

    What is a trie and when is it the right choice?

    TechnicalMedium

    Tip: A trie (prefix tree) stores strings by shared prefixes, giving O(L) lookup/insert where L is word length, independent of the number of words. Ideal for autocomplete, prefix search, and dictionary/spell-check — at the cost of higher memory.

  8. 08

    How do you detect a cycle in a linked list?

    TechnicalMedium

    Tip: Floyd's cycle detection (tortoise and hare): advance one pointer by 1 and another by 2; if they meet, there is a cycle. It uses O(1) extra space vs a hash set's O(n). To find the cycle start, reset one pointer to head and advance both by 1.

Practice DS questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need DS

  • Software Engineer questions
  • Java Developer questions
  • Python Developer questions
  • Backend Developer questions
  • Machine Learning Engineer questions

Related cs-fundamentals topics

  • Algorithms questions
  • System Design questions
  • Object-Oriented Programming questions
  • Database Management Systems questions
  • Operating Systems questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples