Interview questions

Software Developer/ Programmer interview questions – page 7

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

  1. Given two sorted arrays A and B. i)Find the intersection of these arrays A and B. ii)If array A is small and array B is too large, then how would you do it?

  2. Convert sorted doubly link list ->BST

  3. Given all 26 characters, generate all strings of length 'n' which do not contain a given string as a substring.

  4. Given an integer array. e.g. 1,2,3,4,5 Compute array containing elements 120,60,40,30,24 (2*3*4*5,1*3*4*5, 1*2*4*5, 1*2*3*5, 1*2*3*4) So I gave simple solution using division operator. He said that what if there is a 0 as a...

  5. Given a double linked list and the node values range from 1 to 3.It may contain any number of nodes ,sort the list.

  6. Write A program for Decode the String Compressed Using Run Length Encoding (RLE) Algorithm

  7. Given a linked list, remove all the nodes which have a greater value on right side.

  8. How to confirm that whether or not a given string in form of pZq , where p is a string and q is reverse of p and Z is a single character in O(n).Remember ,You may only fetch the next character of the given string.

  9. Given an n-ary tree of resources arranged hierarchically. A process needs to lock a resource node in order to use it. But a node cannot be locked if any of its descendant or ancestor is locked. You are supposed to:

  10. Print Reverse of linked list (dont reverse it) with only constant space.

  11. Given post order traversal of a BST, construct the BST. Also specify the time and space complexity

  12. Find out first non-repeating character in a s tring

  13. Given an array of dimension n with very first l positions crammed with characters and a string s ,replace all the instances of % with this string s,offered that the lengh of the array is enough to deal with these substitutions.

  14. Given a linked list,find whether a loop exists in it or not,if yes then return a pointer to the start node of the loop?

  15. Given a string, print each character and its number of occurence in sequence. use BST and no recursion, no extra memory is allowed.

  16. We have two different production lines with different operations. One production line works 5 days a week and the other 7 days a week. The factory calendar is assigned to the plant for 5 days a week. This calendar is checked when MRP is run. How can we as

  17. You have mobile phone. In a mobile phone, you are required to find a suitable data structure to store the names and search and retrieve them very efficiently. We can assume that there is very limited memory as it is an embedded device. Also we nee...

  18. Write an optimized function to check whether to strings are anagram of each other.

  19. Anagram: Different words containing same letters. eg., ATE, TEA, EAT

  20. If F and L are the pointers to the first and last elements in a linked list, then which of the following operations is dependent on the length of the list? a. delete the first element in the list b. insert a new element as a first elem...

  21. Find the largest common subtree of two given BSTs/BTs

  22. Your are given a doubly linked list such that one link points to the immediate next node and other link points to some arbitrary nodes in the doubly linked list. Write a function to duplicate such doubly linked lists.

  23. Deletion Of Duplicates in a BST [Adobe] Given a Binary Search Tree with many duplicates. Assume that while building the BST , the equal values are inserted in the left sub-tree. You just have the root pointer of the tree. Give an algor...

  24. Given a Special BT in which Each Non Leaf Node Except Root Has at-least two children .Given Pre-order and Post-order of Tree Your Task is to design the tree From the Given Information..

  25. How to convert a given max heap to min heap?

  26. You are provided with a max heap of 'n' elements with a number 'x' and 'k'...You have to find whether 'k' elements in heap are greater than 'x' or not? Time Complexity should be O(k)

  27. You are given a maze filled with characters in which you can move either above or below or left or right. You have to search for words in this database

  28. You have to create a data structure for the following ... A MS paint like program is there and the user draws a closed curve object... ...a) Store the drawn object in ur data structure ...b) Later u have to draw this object aga...

  29. You are given a pointer to a node of a min heap. The value of this node changes. Write a function that fixes the min heap.

  30. The numbers are represented in linked-list with each node representing a digit of the number as follows: 123 == 1 2 3 NULL, 999 == 9 9 9 NULL

Companies that ask Software Developer/ Programmer questions