Practice
Resources
Contests
Online IDE
New
Free Mock
Events New Scaler
Practice
Improve your coding skills with our resources
Contests
Compete in popular contests with top coders
Events
Attend free live masterclass hosted by top tech professionals
New
Scaler
Explore Offerings by SCALER
/ Interview Guides / Linked List MCQ

Last Updated: Nov 10, 2023
Certificate included
What will you Learn?

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

1.

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

Create a free personalised study plan Create a FREE custom study plan
Get into your dream companies with expert guidance
Get into your dream companies with expert..
Real-Life Problems
Prep for Target Roles
Custom Plan Duration
Flexible Plans
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?

## Learn via our Video Courses

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?

Real-world coding challenges for top company interviews
Real-world coding challenges for top companies
Real-Life Problems
Detailed reports
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) {
/*
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 != 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 -> next == NULL) {
}
ListNode* curr = head -> next;
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) {
int count = 1;
while(front != NULL) {
cout << front -> data << " " << head -> data << endl;
if(count <= x) {
front = front -> next;
}
else {
front = front -> next;
}
count++;
}
}``````
27.

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

``````void solve (ListNode* head) {
cout << head -> data << " ";
}
}``````
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?

Excel at your interview with Masterclasses Know More
Certificate included
What will you Learn?
Free Mock Assessment
Fill up the details for personalised experience.
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
*Enter the expected year of graduation if you're student
Current Employer
Company Name
College/University Name
Job Title
Job Title
Software Development Engineer (Backend)
Software Development Engineer (Frontend)
Software Development Engineer (Full Stack)
Data Scientist
Android Engineer
iOS Engineer
Devops Engineer
Support Engineer
Research Engineer
Engineering Intern
QA Engineer
Co-founder
SDET
Product Manager
Product Designer
Backend Architect
Program Manager
Release Engineer