Q1) Program Question:
Return multiple coordinates (index) that can form given target by multiplication.
Input: arr=[10, 8,4,2,30,15,2], target=20
Output: {0,2}
My Answer: o(2n) = o(n)
Public String returnMultiCorrd(int[] arr, int tar) {
Map mp = new HashMap();
for(int I=0; i<arr.legth; I++) {
if( tar % arr[I] == 0) {
mp.put(arr[i], i);
}
}
//mp [(10,0),(4,2), (2,3)]
Iterator<Entry<Integer, Integer>> it = Map.EntrySet().iterator();
int[] index = new int[2];
for(int I=0; i<arr.legth; I++) {
int ind = tar/arr[I];
if(mp.contains(ind) {
index[0] = arr[i];
index[1] = ind;
}
}
}Q2: Design Question:
Create your own Instagram with following features:
- createProfile
- upload image
- Download image(imgId)
- Follow person
Explain with entity, model, ER, class
We will have Central repo to have uploaded image: CDN
Q3) Profile based questions:
-What is ReactJs and NodeJS(Since My profile is not about react, i simply said I don't know)