Welcome to Interviewbit, help us create the best experience for you!

Currently, You are a:

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your career...

Current Company *
Enter company name
Experience *

You're all set!

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

Linked List MCQ

LinkedList is a linear data structure like arrays. In a Linked List each element is actually a separate object linked to the next element using a reference stored in a pointer.

A Linked List is composed of nodes, which are connected to the next node, using memory references or addresses. A Linked List node usually contains 2 properties stored in it. They are:

  1. The value to be stored in the current node.
  2. The reference or address of the next node, or NULL if it is the last node.

Linked Lists are of 2 types usually:

  1. Singly Linked Lists: They are the standard linked list, where the value of the current node and the reference of the next node is only stored. The reference stored in the last node of the list is NULL.
  2. Doubly Linked Lists: This type of linked list stores all the information of the Singly Linked Lists, along with the reference or memory address of the previous node too if it exists, else NULL.

Useful Resources

Linked List MCQs

1. 

Which of the following information is stored in a doubly-linked list’s nodes?

2. 

What is the optimal time complexity to count the number of nodes in a linked list?

3. 

What will be the output of the following code snippet for the list 1->2->3->4->5->6?

void solve(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start->data);
if(start->next != NULL )
solve(start->next->next);
printf("%d ", start->data);
}
4. 

Which of the following are applications of linked lists?

5. 

Insertion of an element at the middle of a linked list requires the modification of how many pointers?

6. 

Insertion of an element at the ends of a linked list requires the modification of how many pointers?

7. 

In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element will be?

8. 

Which of the following algorithms is not feasible to implement in a linked list?

9. 

What will be the value of “sum” after the following code snippet terminates?

void solve(ListNode* root) {
    /*
    The LinkedList is defined as:
    root-> val = value of the node
    root-> next = address of next element from the node 
    The List is 1 -> 2 -> 3 -> 4 -> 5
    */
    int sum = 0;
    while(root -> next != NULL) {
        sum += root -> val;
        root = root -> next;
    }
    cout << sum << endl;
}
10. 

Which of the following can be done with LinkedList?

11. 

What is the time complexity to insert an element to the front of a LinkedList(head pointer given)?

12. 

What is the time complexity to insert an element to the rear of a LinkedList(head pointer given)?

13. 

A linked list node can be implemented using?

14. 

Which type of linked list stores the address of the head node in the next pointer of the last node?

15. 

Polynomial addition can be implemented using which of the following datastructure?

16. 

What does the following code snippet do?

ListNode* solve(ListNode* head) {
        ListNode* prev = NULL;
        if(head == NULL) {
            return head;
        }
        if(head -> next == NULL) {
            return head;
        }
        ListNode* curr = head -> next;
        while(head != NULL) {
            head -> next = prev;
            prev = head;
            head = curr;
            if(curr != NULL) {
                curr = curr -> next;
            }
        }
        return prev;
    }
17. 

What is the time complexity of a program to reverse a linked list?

18. 

Concatenation of 2 linked list will take a time complexity of?

19. 

In which type of linked lists traversals can be performed in both directions?

20. 

Which of the following algorithm is the optimal way to find the middle element of the linked list?

21. 

A linked list in which none of the nodes contains a NULL pointer is?

22. 

Which of the following statements are true?

23. 

What is the optimal complexity we can achieve when removing duplicates from an unsorted linked list?

24. 

What is the optimal complexity we can achieve when removing duplicates from an sorted linked list?

25. 

Which of the following sorting algorithms can be applied to linked lists?

26. 

What does the following code snippet do?

ListNode* solve(ListNode* head, int x) {
	ListNode* front = head;
	int count = 1;
	while(front != NULL) {
		cout << front -> data << " " << head -> data << endl;
		if(count <= x) {
			front = front -> next;
		}
		else {
			head = head -> next;
			front = front -> next;
		}
		count++;
	}
	return head;
}
27. 

What will be the output of the following code snippet for 1->2->3->4->5?

void solve (ListNode* head) {
    while(head != NULL) {
		cout << head -> data << " ";
		head = head -> next;
	}
}
28. 

The type of pointer used to point to the address of the next element in a linked list?

29. 

What does the following code snippet do?

int solve (ListNode* list) {
    ListNode* fast = list;
	ListNode* slow = list;
	while(fast -> next != NULL && fast -> next -> next != NULL) {
		fast = fast -> next -> next;
		slow = slow -> next;
	}
	return slow -> data;
}
30. 

Which of the following is optimal to find an element at kth position at the linked list?

31. 

What does the following code snippet do?

void solve(ListNode* node) {
    node = node -> next;
}
32. 

What is the time complexity of adding 2 numbers as a linked list?

33. 

Which of the following problems can be solved using 2 pointers on linked list?

34. 

Which of the following is similar about singly and doubly linked list?

35. 

Rotating a linked list by some places clockwise will take a time complexity of?

36. 

Rotating a linked list by some places clockwise will take a space complexity of?

37. 

The time complexity of enqueue operation of a queue implemented by a singly linked list is?

38. 

The time complexity of dequeue operation of a queue implemented by a singly linked list is?

39. 

Which data structure is used in a compiler for managing information about variables and their attributes?

40. 

Polynomial addition is implemented using which data structure?

41. 

In a circular linked list insertion of a record requires the modification of?

42. 

Consider the following code snippet:

struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;

How can we create a new node?

43. 

How can we destroy a pointer in C++?

44. 

Which of the following statements are true?

45. 

What is the space complexity for deleting a linked list?

46. 

What is the space complexity needed to store a linked list of n nodes?

47. 

Which of the following linked list operation takes O(1) time?

48. 

What are the information stored by linked lists which are used to implement binary trees?

49. 

Which of the following variations of linked lists can we use to search a sorted list in better than amortized O(n) complexity?

50. 

Which of the following sorting algorithms is preferred to sort a linked list?

Get Placed at Top Product Companies with Scaler Know More 
Get Placed at Top Product Companies with Scaler Know More 
Get Placed at Top Product Companies with Scaler
Sat transparent 640a34d454880bf68e3bfdf33f2389f2214043f59ad18b4c7f7b114e834fb257.svg

Point markers b3add1cc88e4996b2df6e0aedb9f0d1b65fa73c51b7ada8fbee3895a2aa11802.svg Personalised feedback report with solutions
Point markers b3add1cc88e4996b2df6e0aedb9f0d1b65fa73c51b7ada8fbee3895a2aa11802.svg Real life Interview Questions
Point markers b3add1cc88e4996b2df6e0aedb9f0d1b65fa73c51b7ada8fbee3895a2aa11802.svg Identify exact topics to improve

Your feedback is important to help us improve.
Free Mock Assessment
Help us know you better for the best experience
Current Employer *
Enter company name
College you graduated from *
Enter university name
Phone Number *
OTP will be sent to this number for verification
+1
+1
Change Number
Edit
Resend OTP
By Continuing I agree to be contacted by Scaler in the future.
Already have an account? Log in