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
logo
Events
Attend free live masterclass hosted by top tech professionals
New
Scaler
Explore Offerings by SCALER
/ Interview Guides / Linked List MCQ

Linked List MCQ

Last Updated: Jan 08, 2024
Certificate included
About the Speaker
What will you Learn?
Register Now

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 can be done with LinkedList?

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 space complexity needed to store a linked list of n nodes?

3. 

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

4. 

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

5. 

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

Learn via our Video Courses

6. 

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

7. 

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;
	}
}
Advance your career with   Mock Assessments Refine your coding skills with Mock Assessments
Real-world coding challenges for top company interviews
Real-world coding challenges for top companies
Real-Life Problems
Detailed reports
8. 

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);
}
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 != NULL) {
        sum += root -> val;
        root = root -> next;
    }
    cout << sum << endl;
}
10. 

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

11. 

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

12. 

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

13. 

Which of the following are applications of linked lists?

14. 

What is the space complexity for deleting a linked list?

15. 

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

16. 

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

17. 

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

18. 

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

19. 

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

20. 

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

21. 

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

22. 

Which of the following statements are true?

23. 

Which of the following statements are true?

24. 

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

25. 

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

26. 

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

27. 

A linked list node can be implemented using?

28. 

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

29. 

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?

30. 

How can we destroy a pointer in C++?

31. 

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

32. 

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

33. 

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

34. 

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

35. 

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

36. 

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

37. 

Polynomial addition is implemented using which data structure?

38. 

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

39. 

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

40. 

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

41. 

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

42. 

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

43. 

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

44. 

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;
}
45. 

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;
    }
46. 

What does the following code snippet do?

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

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;
}
48. 

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

49. 

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

50. 

What is the optimal time complexity to count the number of nodes in 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
Graduation Year *
Graduation Year *
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
2029
*Enter the expected year of graduation if you're student
Current Employer
Company Name
College you graduated from
College/University Name
Job Title
Job Title
Engineering Leadership
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
Security Leadership
Database Administrator
Data Analyst
Data Engineer
Non Coder
Other
Please verify your phone number
Edit
Resend OTP
By clicking on Start Test, I agree to be contacted by Scaler in the future.
Already have an account? Log in
Free Mock Assessment
Instructions from Interviewbit
Start Test