Interview questions

System Administrator interview questions – page 6

2,099 questions. Tap “Show answer” to check yourself.

  1. How would you store 1 million phone numbers?

  2. Find the distance of a node from the root in a binary tree.Print error message if node doesn't exist. Extend the problem to distance of any node to any other node that is below it.

  3. Write a program to find depth of binary search tree without using recursion.

  4. Given a single linked list, there is a possibility of pointer corruption, modify the data structure to ensure that the data is not lost.

  5. Given preorder traversal of a Binary Search Tree. From the given options you have to select which one can possibly be the inorder traversal of the tree.

  6. Written-Qn-2) Write complete working code (only the function) to traverse a binary tree in ZigZag order.

  7. Find if one string is a rotation of another eg str1="abcdef" str2="defabc" return true

  8. You have more than 3 million entries of phone numbers. You have to create a phone book just like the one we have on the new phones these days. You type the name, and the numbers that match the letters you typed shows up on your phone.

  9. Write a C code to find Leftmost right cousin at the same level.

  10. Find all the patterns once which are present in the character array given. A pattern is a sub-array containg 2 or more chars. Ex: i/p: aabcdadabc o/p: ab, abc, bc, da

  11. How would you remove alternate nodes of a given linked list?

  12. How to implement circular queue using array? what is the time complexity of enqueue and dequeue operations?

  13. Offered a binary tree verify whether it is a binary search tree or not?

  14. How to delete the duplicates in a Binary Tree?

  15. Given a sorted array, find the element whose value is equal to the index, i.e., arr[x] = x. solve it in O(Logn) time.

  16. How do u find the largest repeating string and the number of times it repeats in a given string efficiently offcourse !?

  17. Given a BST, write a program to find kth largest node.

  18. Implement the function : node * add(node *l1, node *l2). The lists L1 and L2 are linked lists where each node of the linked list contains a single hexadecimal digit, represented as a char. The whole list thus represents a hexadecimal number. We ha...

  19. Given an array with list of numbers. For each element in the array, find out it's next subsequent smaller element in the array , and replace the element with it's next subsequent smaller value in the new array. Ex : input - [4, 7, 9, 8, 6, 5...

  20. Pointer 'F' to head of singly Linked List is given. How to reverse first two nodes of LL?

  21. Given: 2 Unsorted single linked list Todo: Fastest and optimized way to merge and make a single sorted list with these 2 unsorted single linked list.

  22. Given a Binary Tree, find the max size sub-tree which is a Binary Search Tree. Optimize for space & Time

  23. Find common parent of two leaf nodes in a tree (The tree is not a BST and can have duplicates)

  24. Given two strings s1 and s2, s1 has some characters at the end which are same as some of s2's starting characters, so you have to concatenate the strings so that the repeated portion occurs only once.

  25. Given some positive numbers output the numbers in decreasing order of frequency..in case of a tie print the number which occurs first

  26. Given two arrays, one is 1D array and other is 2D array. U need to find out whether 2D array contains the subset of 1D array. The elements of 1D array not neccessary present in the same row it can be either on the up or down but should be continu...

  27. Find the lease common ancestor of two given nodes ( pointers ) in a tree. Before jumping to any conclusion .. its a k-ary tree. Not a BST Write the code. Test cases. And improve it too.

  28. Given a Binary Search Tree, write a function that returns the kth smallest element without using any static/global variable. You cant pass the value k to any function also.

  29. Given an IP address as input, validate the IP address.

  30. Structure of a node in a binary tree is

Companies that ask System Administrator questions