Phone interview 1 hour:
Interviewer introduced himself
Me introduced myself
a. my internships/working experience
b. why Bloomberg
Coding problems:
3.1 Given a binary tree, determine if it is a valid binary search tree (BST). (https://leetcode.com/problems/validate-binary-search-tree/)
I wrote my solution in C++. It was simple dfs with borders checking. Code was about 10 lines, so I wrote it pretty fast. Then I proposed to test it by myself and checked my algo step-by-step.
3.2 Given two unsorted arrays of integers. Check if there is at least one pair of numbers from both arrays such that their sum will be target
Input:
arr1 = {1, 2, -1, 2, 5}
arr2 = {12, 55, -24, 3, 8, 0}
target = 8
Output:
true
Explanation:
5 + 3 = 8, valid answer because both numbers from different arrays
8 + 0 = 8, but its invalid answer because both numbers from one arrayI found this problem similar to two-sum(https://leetcode.com/problems/two-sum/), so I proposed 3 different solutions(brute force, bin search + sorting, hashmap), explained approaches and time/memory complexity, and different time/memory optimizations for the last two approaches.
The interviewer asked me to implement a hashmap solution, I coded it and that was all.
The interviewer is very friendly and chatty. This was one of my first phone interviews and I am very pleased that it went so smoothly.
Feedback: passed to the next interview.