Interview questions

Software Developer interview questions – page 27

945 questions. Tap “Show answer” to check yourself.

  1. He asked me about my previous projects and how I approched them

  2. Given a linked list having next and random pointer(random pointer can point any where in the SLL node). Generate copy of this linked list

  3. Given a bt and a 2d matrix M. where M[i,j]=1 if i is ancessostor of j. Initially all elements of M is set to zero. Feed this matrix?

  4. Find next inorder predecessor in bst?

  5. Given integer n. Generate all possible paranthesis

  6. You are given deque(), enque(), isEmpty() function for queue, implement push(), pop(), min() functions of stack. O(1) time was required for min()

  7. Convert a binary tree to a DLL such that a next node for DLL is selected in a top down order in zig-zag manner. O(n) space was allowed, but not O(2n)

  8. Clone a linked list having an arbit pointer

  9. Given a string of alphabet of at most 5 characters. Write a function which returns a unique number for each string with O(1) space

  10. Explain working of virtual function

  11. There is pointer of base class pointing to derived class. Explain the working with respect to the pointer, if this pointer calls the virtual function of base class

  12. How does write head take a value from process buffer and writes on a particular address (Explanation of address bus and register needed)

  13. What is hashing. Implement domain search using hashing

  14. Given a BST find the number of pair of nodes which sum upto a given value. O(n) time, O(1) space

  15. Given a 2D plane and n points, find the line which passes through maximum number of lines

  16. If a/b is recurring like 10/3 print 10/3 as 3.(3), 16/6 as 2.(6)

  17. Explain caching, implement LRU caching

  18. Explain working of DNS, implement domain search in DNS

  19. Delete all nodes on a DLL whose data is a multiple of 5. O(n) time

  20. Given n-ary tree, print the nodes in level-order zig-zag manner. O(n) time

  21. 14. you have given a string of multiline. you have to print the maximum occupancy word in each line and if there is some capital letter in each line then print each capital letter occupancy and then small letter occupancy. ex given string is Abccddegdkshsl aghdoiuuaknclna AHBalowknxxbb ajhduiaklaLLL your o/p should be : A -1, d-3 a-3 A-1,H-1,B-1,x-2,b-2 L-3,a-3

  22. Find the next larger element in a BST, given key might not be in the BST. O(logn) time and O(1) space

  23. Given a linked list and some no n . you have to reverse the node of linked list in pair of n. consider all test cases for this

  24. Given a array where the difference between two consecutive element is one. Given a no find that no in array in minimum time complexity

  25. How to check singly linked list is palindrome or not

  26. Given a preorder of binary tree such that in tree each node have either 0 or no childern. and each leaf node is represented by N. construct a tree from this

  27. Given two string A and B . remove each character from string A which occur in B. if a occur 2 times in B remove 2 a from A

  28. find the median of input stream in minimum time complexcity.(Online algo)

  29. make copy of a linked list which has two pointer one point to next node and other one point to arbitrary node in linked list

  30. if u will access data from a social networking site such as Facebook . suggest some method to remove latency to access data

Companies that ask Software Developer questions