Phone Interview Questions
class Solution {
private int D;
void init(int d) {
this.D = d;
void func(float item) {
// implement
}
}struct FilesFolders { vector<string> files; vector<string> folders; } FilesFolders FindAllFilesAndFolders(path) { // network call in google drive which fetches all files and folders inside this path. return FilesFolders; } // Implement Search method which return any path which has sub_string in it. string Search(string path, string sub_string) { } Expectation: -> Implement this Search method and give time complexity according to network latency for google drive. Solution -> A recurrence and focus on Time Complexity. Follow up -> New method: void get_async(string path, callback_funcβ¦) { // creates a new thread // Calls callback_func after 100ms or whenever operation done. callback_func(files, folders); return; } -> Now implement Search using new method get_async() along with time_complexities.int n - [0..n-1] digits in the array, int[]arr1 - [0, 1, 2] len 3 values will be valid and will use the digits in the range of 0 to n-1 int[]arr2 - [2, 3, 1] len 3 values will be valid and will use the digits in the range of 0 to n-1 arr1 and arr2 can contain duplicate values and also all values can be equal. arr1:[0, 1, 2] arr2:[0, 1, 2] int t - will be used to calculate upper and lower bound for each digit in the array. `0<=t<=n`.int solve(int n, int t, int[]arr1, int[]arr2) { }n = 3 arr1[0, 1, 2] arr2[2, 0, 1] t = 1
Last updated