Java LinkedList Interview Questions

  • Web
    • Javascript
      • Backbone.js Interview Questions
      • Ember.js Interview Questions
      • d3.js Interview Questions
      • JQuery Interview Questions
      • JAVASCRIPT:- More Interview Questions
    • Database
      • MySQL Interview Questions
      • Oracle Interview Questions
      • DB2 Interview Questions
      • Data Structures Interview Questions
      • Oracle Applications Interview Questions
      • DATABASE:- More Interview Questions
    • Web
      • Web Developer Interview Questions
      • HTML Interview Questions
      • Windows Server Interview Questions
      • CSS & CSS3 Interview Questions
      • AWS Interview Questions
      • Bootstrap Interview Questions
      • Web Design Interview Questions
      • WEB:- More Interview Questions
    • Server
      • VMWare Interview Questions
      • Websphere Interview Questions
      • Tomcat Interview Questions
      • OpenStack Interview Questions
      • Kafka Interview Questions
      • Windows Server Interview Questions
      • SERVER:- More Interview Questions
    • CMS
      • Magento Interview Questions
      • Joomla Interview Questions
      • Drupal Interview Questions
      • WordPress Interview Questions
      • CMS :- More Interview Questions
  • Microsoft
    • Microsoft
      • .NET Interview Questions
      • VB.Net Interview Questions
      • LINQ Interview Questions
      • WPF Interview Questions
      • ADO.NET Entity Framework Interview Questions
      • Active Directory Interview Questions
      • MICROSOFT :- More Interview Questions
    • Microsoft Office
      • Microsoft Outlook Interview Questions
      • Microsoft Word Interview Questions
      • Microsoft Project Interview Question
      • Microsoft PowerPoint Interview Questions
      • Microsoft OFFICE :- More Interview Questions
  • Programming
    • Programming
      • OOPs Interview Questions
      • Programming Interview Questions
      • PROGRAMMING : More Interview Questions
    • Testing
      • Performance Testing Interview Questions
      • TestNG Interview Questions
      • TESTING :- More Interview Questions
    • Java
      • Hibernate Interview Questions
      • J2EE Interview Questions
      • WebLogic Interview Questions
      • JAVA :- More Interview Questions
    • Mobile
      • iOS Developer Interview Questions
      • Swift Interview Questions
      • PhoneGap Interview Questions
      • Objective C Interview Questions
    • API
      • API Testing Interview Questions
  • Business
    • Banking & Finance
      • Banking Interview Questions
      • Insurance Interview Questions
      • Equity Trading & Dealer Interview Questions
      • Debt Collection Interview Question
      • Quickbooks Interview Questions
      • Actuarial Interview Questions
      • BANKING :- More Interview Questions
    • Sales & Marketing
      • Salesforce Interview Questions
      • Adwords (PPC) Interview Questions
      • Digital Marketing Interview Questions
      • CRM Interview Questions
      • Social Media Interview Questions
      • Receptionist Interview Questions
      • MARKETING :- More Interview Questions
    • Data Analytics
      • Data Analyst Interview Questions
      • Data Warehouse Interview Questions
      • SAS Interview Questions
      • Computer System Analyst (Software) Interview Questions
      • DATA ANALYTICS :- More Interview Questions
    • Business Intelligence
      • Hive Interview Questions
      • Datastage Interview Questions
      • Oracle Warehouse Builder Interview Questions
      • Tableau Interview Questions
      • Apache Storm Interview Questions
      • Business Intelligence :- More Interview Quetions
  • Interview Guide
    • Job Hunt Guide
      • Resume & CV Mega Guide
      • COVER Letters
      • Reference Letters
      • Administrative Assistant Resume & Cover Letter
      • Public Relations Resume Sample
      • Email Reference Letter
      • THANK YOU Email Letter
      • Letter of INTEREST
      • Letter of Recommendation
      • JOB GUIDE :- More Visit here
    • Career Guide
      • Resignation Email Letter
      • Resign Job Gracefully
      • Deal with Toxic Work Environment
      • Employee Email Farewell
      • Negotiate Salary Offer
      • 3 Steps to Get a Raise
      • CAREER GUIDE :- More Visit here
    • Interview Tips
      • Common Interview Questions
      • Tips to Crack a Job Interview
      • Ask Letter of Recommendation
      • Write a Letter of Recommendation
      • Behavioral Interview Questions
      • Follow UP Interview Letter
      • Exit Interview Questions
      • More INTERVIEW TIPS Visit Here
  • Must Read
    • Tricky
      • Googles Tricky Interview Questions
      • Leadership Interview Questions
      • Operating System Interview Questions
      • SEO Interview Questions
    • Popular
      • Autocad Interview Questions
      • Teacher Interview Questions
      • CodeIgniter Interview Questions
      • Scrum Master Interview Questions
      • Chemistry Interview Questions
      • Mathematics Interview Question
      • WCF Interview Questions
    • Not to Miss
      • Manufacturing Production Interview Questions
      • AJAX Interview Questions
      • GIT Interview Questions
      • Project Manager Interview Questions
      • VLSI Interview Questions
    • Most Shared
      • JSON Interview Questions
      • MatLab Interview Questions
      • Textile Interview Questions
      • Citrix Interview Questions
      • XML Interview Questions
    • New
      • Mainframe Interview Questions
      • PowerShell Interview Questions
      • Maintenance Interview Questions
      • Physics Interview Questions
      • Oil & Gas Interview Questions
      • Subversion SVN Interview Questions
  • Support
    • BPO & Customer Support
      • Desktop Support Interview Questions
      • BPO Interview Questions
      • Call Center Interview Questions
      • Help Desk Interview Questions
      • Office Clerk Interview Questions
      • Technical Support Interview Questions
      • LPO Interview Questions
      • Legal Interview Questions & Answers
  • Quiz
Type your search query and hit enter:
Categories: Programming

Top 17 Linked List Interview Questions & Answers (2021)

1) Mention what is Linked lists?

A linked list is a data structure that can store a collection of items. In other words, linked lists can be utilized to store several objects of the same type. Each unit or element of the list is referred as a node. Each node has its own data and the address of the next node. It is like a chain. Linked Lists are used to create graph and trees.

2) What type of memory allocation is referred for Linked lists?

Dynamic memory allocation is referred for Linked lists.

3) Mention what is traversal in linked lists?

Term Traversal is used to refer the operation of processing each element in the list.

4) Describe what is Node in link list? And name the types of Linked Lists?

Together (data + link) is referred as the Node.

Types of Linked Lists are,

  • Singly Linked List
  • Doubly Linked List
  • Multiply Linked List
  • Circular Linked List

5) Mention what is Singly Linked list?

Singly Linked list are a type of data structure. In a singly linked list, each node in the list stores the contents of the node and a reference or pointer to the next node in the list. It does not store any reference or pointer to the previous node.

6) Mention what is the difference between Linear Array and Linked List?

The difference between Linear Array and Linked List are shown below,

Linear ArrayLinked List
  • Deletion and Insertions are difficult.
  • Deletion and Insertions can be done easily.
  • For insertion and deletion, it needs movements
  • For insertion and deletion, it does not require movement of nodes
  • In it space is wasted
  • In it space is not wasted
  • It is expensive
  • It is not expensive
  • It cannot be reduced or extended according to requirements
  • It can be reduced or extended according to requirements
  • To avail each element same amount of time is required.
  • To avail each element different amount of time is required.
  • In consecutive memory locations elements are stored.
  • Elements may or may not be stored in consecutive memory locations
  • We can reach there directly if we have to go to a particular element
  • To reach a particular node, you need to go through all those nodes that come before that node.

7) Mention what are the applications of Linked Lists?

Applications of Linked Lists are,

  • Linked lists are used to implement queues, stacks, graphs, etc.
  • In Linked Lists you dont need to know the size in advance.
  • Linked lists let you insert elements at the beginning and end of the list.

8) What does the dummy header in linked list contain?

In linked list, the dummy header contains the first record of the actual data

9) Mention the steps to insert data at the starting of a singly linked list?

Steps to insert data at the starting of a singly linked list include,

  • Create a new node
  • Insert new node by allocating the head pointer to the new node next pointer
  • Updating the head pointer to the point the new node.
Node *head; void InsertNodeAtFront(int data) { /* 1. create the new node*/ Node *temp = new Node; temp->data = data; /* 2. insert it at the first position*/ temp->next = head; /* 3. update the head to point to this new node*/ head = temp; }

10) Mention what is the difference between singly and doubly linked lists?

A doubly linked list nodes contain three fields:

  • An integer value and
  • Two links to other nodes
  • one to point to the previous node and
  • other to point to the next node.

Whereas a singly linked list contains points only to the next node.

11) Mention what are the applications that use Linked lists?

Both queues and stacks are often implemented using linked lists. Other applications are list, binary tree, skip, unrolled linked list, hash table, etc.

12) Explain how to add an item to the beginning of the list?

To add an item to the beginning of the list, you have to do the following:

  • Create a new item and set its value
  • Link the new item to point to the head of the list
  • Set the head of the list to be our new item

If you are using a function to do this operation, you need to alter the head variable. To do this, you must pass a pointer to the pointer variable (a double pointer). so you will be able to modify the pointer itself.

13) Mention what is the biggest advantage of linked lists?

The biggest benefit of linked lists is that you do not specify a fixed size for your list. The more elements you add to the chain, the bigger the chain gets.

14) Mention how to delete first node from singly linked list?

To delete first node from singly linked list

  • Store Current Start in Another Temporary Pointer
  • Move Start Pointer One position Ahead
  • Delete temp i.e Previous Starting Node as we have Updated Version of Start Pointer

15) Mention how to display Singly Linked List from First to Last?

To display Singly Linked List from First to Last,

  • Create a linked list using create().
  • You cannot change the address stored inside global variable start therefore you have to declare one temporary variable -temp of type node
  • To traverse from start to end, you should allot address of Starting node in Pointer variable i.e temp.
struct node *temp; //Declare temp temp = start; //Assign Starting Address to temp

If the temp is NULL then you can say that last node is reached.

while(temp!=NULL) { printf("%d",temp->data); temp=temp->next; }

16) Mention how to insert a new node in linked list where free node will be available?

To insert a new node in linked list the free node will be available in Avail list.

17) Mention for which header list, you will found the last node contains the null pointer?

For grounded header list you will found the last node contains the null pointer.

Download PDF
Share

Leave a Reply

Your email address will not be published. Required fields are marked*

Comment *

Name *

Email *

{{response}}
{{response}}

View Comments

  • Abel says:
    at

    So nice

    Reply
    Cancel reply

    Leave a Reply

    Your email address will not be published. Required fields are marked*

    Comment *

    Name *

    Email *

    {{response}}
    {{response}}
  • sameer says:
    at

    its preety good questions ...........................

    Reply
    Cancel reply

    Leave a Reply

    Your email address will not be published. Required fields are marked*

    Comment *

    Name *

    Email *

    {{response}}
    {{response}}
  • Amritha says:
    at

    It help me soo much thankuu

    Reply
    Cancel reply

    Leave a Reply

    Your email address will not be published. Required fields are marked*

    Comment *

    Name *

    Email *

    {{response}}
    {{response}}
  • sarah says:
    at

    please how could I solve this problem
    (linked list with dummy head node)
    Given two linked lists L1 and L2, decide a procedure in pseudo language that uses ADT linked list to insert L2 after the third element from the last of L1

    If L1 is 1-2-3-4-5-6-7-8-9 and L2 is 1-1-1

    The result is 1-2-3-4-5-6-7-1-1-1-8-9

    Reply
    Cancel reply

    Leave a Reply

    Your email address will not be published. Required fields are marked*

    Comment *

    Name *

    Email *

    {{response}}
    {{response}}
    • Muhannad Shamasneh says:
      at

      you need to traverse L1 first with two pointers:
      pointer1 - one step from head.
      pointer2 - 3 steps from head.
      while (pointer2.next!=null){
      pointer2 = pointer2.next;
      pointer1 = pointer1.next;
      }
      // now you will have a pointer 1 pointing to the 3rd node from the last.
      temp = pointer1.next
      pointer1.next = L2;
      traversL2 to the end to get last element->
      LastElementOfL2.Next = temp;
      ...

      Reply
      Cancel reply

      Leave a Reply

      Your email address will not be published. Required fields are marked*

      Comment *

      Name *

      Email *

      {{response}}
      {{response}}
  • John says:
    at

    Very good

    Reply
    Cancel reply

    Leave a Reply

    Your email address will not be published. Required fields are marked*

    Comment *

    Name *

    Email *

    {{response}}
    {{response}}

You Might Like:

  • Top 20 MatLab Interview Questions & Answers (2021 Update)

    1) Explain what is MatLab? Where MatLab can be applicable? MatLab is a high-level programming

  • Top 50 Artificial Intelligence (AI) Interview Questions & Answers

    1)What is Artificial Intelligence? Artificial Intelligence is an area of computer science that emphasizes the

  • Top 14 System Analyst Interview Questions and Answers (2021)

    1) Mention what is the basic role of a computer system analyst? Provide assistance

  • Top 50 OOPs Interview Questions & Answers (2021 Update)

    Following are frequently asked Interview Questions for freshers as well as an experienced .net/ Java/Python

© Copyright - Career Guru99 2021