DuttaJ
BAN USER
- 0of 0 votes
AnswersXXXX.XXXXX.626XXX.12342
- DuttaJ in India
Find first occurance of numberic digits, i.e 12342| Report Duplicate | Flag | PURGE
Concur Technical Architect test - 0of 0 votes
AnswersDesign for a call center Data.
- DuttaJ in India
Example: A call center has Huge number of unique callers, calling anytime in a day and talking for various amount of duration.
1. Data base design.
2. Utility code to query Unique users history for a given year.
3. Draw a time series graph for the unique users 1 years behavior.| Report Duplicate | Flag | PURGE
Concur Technical Architect design - 0of 0 votes
AnswersHow to Design an Meeting scheduler
- DuttaJ in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm
Approach could be. complexity is O(n^2)
for a given element from ArrayB, find the closest bigger integer value from ArrayA and make it the corresponding element in ArrayA location.
if no bigger value found, take the minimum value from the remaining elements in ArrayA.
here in this case:
ArrayA 12 24 8 32
ArrayB 13 25 32 11
function getClosest
{
this will take input from ArrayB[index i] and find the closest maximum value from ArrayA
if not found any bigger value, return minimum from ArrayA.
}
First Iteration:
consider ArrayB[1]=13 , closest bigger value from ArrayA is 24,
ArrayA 24
ArrayB 13 25 32 11
second iteration
consider ArrayB[2]=25 , closest bigger value from ArrayA is 32,
ArrayA 24 32
ArrayB 13 25 32 11
third iteration
consider ArrayB[3]=32 ,min value from ArrayA is 8, since remaining values in arrayA 8 and 12
ArrayA 24 32 8
ArrayB 13 25 32 11
Fourth iteration
consider ArrayB[4]=11 , closest bigger value from ArrayA is 32,
ArrayA 24 32 8 12
ArrayB 13 25 32 11
package com.demo;
import java.util.Scanner;
public class ArrayFrequency{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int temp=0;
int count=0;
System.out.println("please enter a no of elements.");
int number = sc.nextInt();
int[] array=new int[number];
for(int i=0;i<number;i++){
array[i]=0;
}
int n ;
while(count<number){
System.out.println("Enter element->.");
n = sc.nextInt();
if(n<0 && n>10 ){
System.out.println("please enter a valid numer.");
break;
}
array[n]++;
count++;
}
for(int i=0;i<number;i++){
System.out.print(array[i]);
System.out.print("");
}
}
}
1. Do level order traversing.
- DuttaJ March 23, 20172. if(root==null) return;
else
for each level in the tree
a. maintain a queue. (like BFS)
b. Insert using add(element);
c. for a given level compare first() and count-1() until q.size() for that level., if needed elements can be moved to an auxiliary memory and compared.
d. during pop() operation, the child nodes has to be inserted in the queue.