Topic: Technical Interview Questions

Post and discuss interview questions

Topic: Technical Interview Questions

2 (edited by dp 2013-08-29 16:46:57)

Re: Technical Interview Questions

Binary search tree interview questions / List of problems on binary search trees

1.    Level order traversal of a tree.
2.    Reverse level order traversal.
3.    Mirror image of a tree.
4.    Height of a binary search tree.
5.    Count the number of leaves in a binary search tree.
6.    Count the number of nodes in a binary search tree.
7.    Convert binary search tree to doubly linked list.
8.    You are given a binary search tree where 2 nodes of the tree are swapped. You need to correct the binary search tree.
9.    Given a binary tree. Check if the binary tree is complete or not.
10.    Convert binary tree to binary search tree.
11.    Check if a binary tree is a subtree of given binary tree.
12.    Given a node and a binary tree. Find the level of node in the given binary tree.
13.    Given a binary tree and a value k. Print all nodes which are at k distance from the root of binary tree.
14.    Find the width / diameter of a binary search tree.
15.    Inorder traversal with/without recursion
16.    Postorder traversal with/without recursion
17.    Preorder traversal with/without recursion.
18.    Find the largest and smallest node in a binary search tree.
19.    Find the 2nd largest node in a  binary search tree.
20.    Find common ancestor of 2 nodes in a binary search tree.

   
Basic tutorial on trees available at: goo.gl/OdfuAm

3

Re: Technical Interview Questions

List of linked list interview questions for freshers and experienced.

1.      Basic operations on singly/doubly linked list like insertion, deletion.
2.      Reverse a singly linked list.
3.      Recursively reverse a singly linked list.
4.      Reverse a doubly linked list.
5.      Given a linked list and a value k. Reverse every k nodes in the linked list.
6.      Given a linked list and a value k. Reverse every alternate k nodes in the linked list.
7.      Merge 2 sorted linked list.
8.      Detect loop in a singly linked list.
9.      Find the node in a singly linked list with loop, where the loop begins
10.    Find the middle node in a singly linked list.
11.    Find kth node from the end in a singly linked list.
12.    Swap kth node from the beginning and kth node from the end of a singly linked list.
13.    Delete duplicate nodes in an unsorted singly linked list in O(n). Do not use extra space or sort the elements.
14.    Sort the given singly linked list. – A most commonly asked linked list interview question.
15.    A linked list contains 0s, 1s and 2s. Sort the linked list.
16.    Implement union and intersection of 2 linked list
17.    Given a linked list containing integers. Modify the linked list such that all even nodes come before odd nodes.
18.    Given 2 linked list which somehow got intersected. Find the intersection point of the given 2 linked lists.
19.    Given only the node to be deleted in a singly linked list. Program the logic to delete the node.
20.    Implement stack using linked list.
21.    Implement queue using linked list.
22.    Polynomial addition using 2 linked list.
23.    Find the node at the beginning of the loop in a circular linked list.
24.    Given a linked list and a value k. Partition the linked list such that all nodes to the right of node k is less than k and all nodes to the right of node k is greater than the value k.
25.    Given a linked list containing a string. Check if the string is a palindrome or not. Do not use extra space.

Basic tutorial on linked list can be found here: http://goo.gl/d5VM8A