I got the OA for Square for software engineer intern. What questions can I expect/how can I best prepare for it? Any tips would be appreciated.
Here are a few recent sample questions:
- Given an array of integers, change each element into the smallest value between the element itself and the two next to it.
- Given a matrix of integers，each entry represents a color, and a set of coordinates (array) called operations. For each coordinate in operation, check whether the 4 corner neighbors have the same color. If it reaches two then change that element and all its 4 corner neighbors to empty (0 value). Return the resulting matrix.
- Given an array of strings, calculate the largest number of pairs of strings where one string is the other’s suffix. If the two strings are equal that counts and each string has max 10 letters.
- Digit addition in this manner e.g. 10 + 19 = 29, 99 + 99 = 181
- Housing district with two input arrays. Array1’s elements tell you which indices has a house and array2 tells you whether the house at that index will be torn down. Return output that after tearing down the houses, how many housing segments are left (a row of houses).
Good luck, I hope this is helpful.
Thanks a lot!