Saturday, October 15, 2016

LinkedList top interview questions

I am listing here selected interview questions for linked-list

Scope


  • Singly linked list 
  • Doubly linked list 
  • Unrolled linked list 
  • Skip List 
  • Linked Array List 
  • Memory efficient linked lists



Lateral Thinking points -

  1. Compare linked list with array using aspects on time and space . Which one to use in which situation ?
  2. Recursive or iterative solution
  3.  Linear/Binary Searching 
  4. Indexing using hash-table /map
  5. Two runner technique 
  6. Brute force using nested loops.
  7. Time , Space trade-off 
  8. Number of scans of linkedlist 
  9. Cost of saving next and or prev pointers 


Easy


  1. Implement linked list with operations like add , delete , put using index position also implement addFirst , addLast , deleteFirst , deleteLast.
  2. Implement stack using linkedlist.
  3. Implement queue using linkedlist .
  4. Reverse linkedlist .
  5. Traverse circular linked list .
  6. Remove duplicated from linkedlist.



Medium


  1. Find kth node from end .
  2. Find middle of linkedlist 
  3. Find cycles in linkedlist and find entry point of loop.
  4. Insert node in sorted linked list 
  5. find the merge point of two linkedlist which have different length.
  6. Merge two sorted linked lists.
  7. Implement Josephus Circle using linkedlist 
  8. Delete middle of linked list , you have access to middle element only.


Advanced


  1. Create linkedlist with O(1) access time.
  2. Reverse k blocks of linked list 
  3. Reverse each pair of linked list 
  4. Split circular linkedlist
  5. Sort linked list using insertion sort .
  6. Sort linked list using merge sort .
  7. Segregate linked list (data in link is integer) in two list of even and odd numbers.
  8. Add/Subtract/Multiply/Divide two linked list which represents number .
  9. Partition linked list around the pivot value .
  10. Check whether two linked lists are palindrome. 




Tough

  1. Implement CRUD on skiplist
  2. Implement CRUD on unrolled linked list 
  3. Implement CRUD on Linked-Array List 
  4. Implement LRU/MRU cache


No comments: