Interview questions

Sde interview questions – page 2

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

  1. What exactly happens when you add someone as your friend ?

  2. Explain more about hadoop and how it is used ?

  3. How do u implement timeline/newsfeed ?

  4. How do u implement status updates ?

  5. How does fb store likes/dislikes ?

  6. Given a hashmap M which is a mapping of characters to arrays of substitute characters, and an input string S, return an array of all possible mutations of S (where any character in S can be substituted with one of its substitutes in M, if it exists). What is the time complexity? What is the space complexity? Can you optimize either? Example input: M = { f: [F, 4], b: [B, 8] } S = fab Expected output: [fab, Fab, 4ab, faB, FaB, 4aB, fa8, Fa8, 4a8]

  7. Brain storming:How does facebook implement graph search

  8. How does facebook chat work

  9. Given a list of integer numbers, a list of symbols [+,-,*,/] and a target number N, provide an expression which evaluates to N or return False if that is not possible. e.g. let the list of numbers be [1,5,5] and the target number is 9, one possible solution could be 5+5-1

  10. Given an expression (in single variable) like 4x+13(x-(4x+x/3)) = 9, evaluate x The expression is a string and the variable is always x

  11. How will you describe iOS manual memory management for a new developer in few words?

  12. Write a program to print the powerset. E.g. given this set {1,2,3}, it will print {},{1},{2},{3},{1,2},{1,3}, {2,3}, {1,2,3}

  13. Convert a string of Roman numerals to an integer in O(n) time

  14. Given a set of 2D points, some integer k, find the k points closest to the origin, (0,0)

  15. given a 2D array of 0 and 1. where each row is sorted. find the row with maximum no of 1 in minimum time complexcity

  16. Tournament tree puzzle and write code for that

  17. Find the 2 maximum elements in array in O(n+log(n)) comparison

  18. Celebrity Problem puzzle and write code for that

  19. Find a equilibrium index in array

  20. find the minimum no of jumps required to reach the end of array.where element at each index represent how many max moves you will take in right

  21. Given an array which is alternatively sorted. What will be the time complexity to find out an element in it. e.g. 14,3,16,6,22,7,24,11,27

  22. What is the difference between the two declarations? int p=*(int*)i; int p=*(int*)&i;

  23. Given an unsorted array of size 5. How many minimum comparisons are needed to find the median? then he extended it for size n

  24. given 3 sorted arrays, array a, b, c. find all pairs where a[i] + b[j] = c[k] note : a, b , c are sorted arrays

  25. There are 9 identical Marbels out of which 1 is heavy. find out that Marbel

  26. Name any 1 microsoft product that you have been using and suggest 5 improvements in it alongwith priority assignments p1...p5

  27. A square picture is cut into 16 squares and they are shuffled. Write a program to rearrange the 16 squares to get the original big square

  28. Given an array A[n] such that A[i+1] = A[i]+1 OR A[i]-1, and a number k, find out whether k is present in A[n] or not, in most efficient way?

  29. Solution for solving problems generated by virtual functions

  30. Optimized fibonacci program

Companies that ask Sde questions