first is coding round and later interview round, the interview was 3 rounds
coding round
Q1. You are given an array of n integers. You need to insert these elements into 2 binary search trees(BSTs), such that maximum(height(BST-1), height(BST-2)) could be minimized. Elements can be inserted into BST in any order. (Constraints - 1<=n<=10^5)
Q2. Each letter, a-z, is assigned values in the following way: a: 1, b: 2, …, z: 26. You are given string, S, consisting of lowercase English letters and an integer, K. Find the lexicographically minimal string, whose sum is equal to K. (O(n^2) will work)
interview questions were on trees and hashmap and linked list
1)what is a hashmap
2)asked about the question loop in a linked list
3)reverse level order traversal