ajit
BAN USERI am good at data structures and algorithms, but now I am trying to get better in these areas. I'd love to work in these areas.
I haven't prepared my resume yet. Meanwhile brief things about me.
Academics: Masters in computer applications with 8.9 gpa out of 10.
Technical skills: c,c++,java,javascript,mysql,oracle sql.
Awards:
Received performance of highest order during training period of tcs.
- 6 Answers Resume confusion
Hi, I want to apply for Amazon, India. I have prepared a one page resume for that. When I show this to my friend who is already working in amazon, said resume should have more content and asked me to enlarge it to atleast three pages. He said that he also did the same when he was applying. can anyone tell me is it mandatory to have a resume of 3 pages?
- ajit August 14, 2013| Flag | PURGE - 4 Answers Need info
I am working in a service oriented company. Now I want to try for big techies like amazon. Can anyone tell me what is the career growth in these companies. In my comapny(present where I am working), an employ carrer is like asst system engineer-->associate SE-->SE-->Team lead-->project lead etc. Will it be different in amazon and google?
- ajit March 23, 2013| Flag | PURGE - 0 Answers Need some advice
I have completed my masters in computer applications with good gpa. Later I joined a company. It's been 4months since I joined and I was awarded one of the high performers award. But I am not satisfied since it is a services company and doesn't have much scope to improve technical knowledge. I want to try for big techies like google or microsoft. But I stuck since i got just 4 months of experience and I am no more a fresher. I am good at data structures and getting good at algorithms. Any career advice is highly appreciated.
- ajit October 27, 2012| Flag | PURGE
take a map to store index values from 1 to 5.
int returnIndex(int n){
int x=0,countLeft=0;
for(int i=1;i<=n;i++){
if(countLeft==0){
x++;
if(x>5) {x-=2;countLeft=1;}
}else{
x--;
if(x<1) {x+=2;countLeft=0; }
}
}
return x;
}
print value maped to xth index in Map. time complexity-o(n).
//str is given string and word is string to be replaced with.
public void replaceStringPattern(char[] str,char[] word){
int count=0,length=str.length,lengthOfWord=word.length;
//count how many times pattern is repeated.
for(int i=0;i<length-2;i++){
if(str[i]=='B' && str[i+1]=='C') count++;
}
//new size of string so that replaced string can fit into str.
newLength=length+count*(lengthOfWord-2);
str[newLength]='\0';
//replacing pattern from back.
for(int i=length-1;i>=1;i--){
if(str[i]=='C' && str[i-1]=='B'){
int k=lengthOfWord-1;
while(k>=0){
s[newLengh-1]=word[k];
k--;
newLength--;
}
i--;
}
else{
s[newLength-1]=s[i];
newLength--;
}
}
}
findWord(int[][] data,char[] word){
int k=0;//position of character in checking word.
for(int i=0;i<4;i++){
for(int j=0;j<4;j++){
if(data[i][j]==word[k]){
if(checkWord(i,j,k++,data,words){
System.out.println("word exists");
break;
}
}
}
}
}
public boolean checkWord(int i,int j,int k,int[][] data,char[] word){
if(k==words.length) return true;
char letter=words[k];
if(j!=3 && data[i][j+1]==letter) return checkWord(i,j++,k++,data,word);
if(i!=3 && data[i+1][j]==letter) return checkWord(i++,j,k++,data,word);
if(i!=3 && j!=3 && data[i+1][j+1]==letter) return checkWord(i++,j++,k++,data,word);
if(i!=0 && data[i-1][j]==letter) return checkWord(i--,j,k++,data,word);
if(j!=0 && data[i][j-1]==letter) return checkWord(i,j--,k++,data,word);
if(i!=0 && j!=0 && data[i-1][j-1]==letter) return checkWord(i--,j--,k++,data,word);
if(i!=3 && j!=0 && data[i+1][j-1]==letter) return checkWord(i++,j--,k++,data,word);
if(i!=0 && j!=3 && data[i-1][j+1]==letter) return checkWord(i--,j++,k++,data,word);
}
time complexiy is O(N*M*K) in worst case, where N is number of rows, M is number of columns and K is length of word for which we are searching. Please let me know for improvements since I used brute force technique here
If it is a sorted one,
findMissingNumbers(int[] array,int n){
int k=0;
for(int i=1;i<=n;i++){
if(array[k]!=i) System.out.println(i);
else k++;
}
}
It is of linear time only. If the missing number is one instead of two then by modifying binary search we can find it in logarithmic time. But I am certain that I am missing something here. If it was the the same question as I thought, It would've solved a long time back. can anyone let me know if I didn't get the question properly.
I too tried something on it. Please let me know for impvements. My thought of doing it is as follows:
1. Assume list is {A,B,C,D,E} and i=0,j=1 initially. Since only one celebrity or none exists, start with first two elements in list.
2. If knows() returns true, change i,j to j,j+1 else i,j+1.
3. Once j reaches last position, it means either i or j can be celebrities. So check which one is celebrity using normal for loop. It returns position of celebrity in list. It visits each element for 2 times hence O(2N)=O(N).
public int findCelebrity(char[] arr,i,j){
if(j==arr.length-1){
if(knows(i,j){
for(int k=0;k<n;k++){
if(knows(j,k)) return -1; //no celebrity
}
return j; //position of celebrity
}else{
for(int k=0;k<n;k++){
if(knows(i,k)) return -1; //no celebrity
}
return i; //position of celebrity
}
}
if(knows(i,j) return findCelebrity(arr,j,j++);
else return findCelebrity(arr,i,j++);
}
I think we can arrange all nodes in a circular single linked list. While traversing, in send(id,val), each time add previous value to val(just like we calculate sum for array of numbers) and in next node retrieve it using receive method. at the end val contains total sum. Now again reiterate list. this time val contains only total sum that occurred at last node in list. In this way all nodes can know sum of others. since traversing a list take O(n), time complexity is O(n)+O(n)=O(n). Any suggestions for improvement is appreciated.
- ajit February 20, 2013
can any one from India suggest me what to do on this?
- ajit August 23, 2013