Andi
BAN USER- 0of 0 votes
Answerswrite insert method to insert a node into sorted circular linked list (Sorted based on int value). insert method takes 2 arguments, one is value to be inserted and other is reff to any random node in the sorted circular linked list
- Andi in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
Answersfind longest palindrome in a given string, expecting time complexity must be less than O(n^2).
- Andi in United States| Report Duplicate | Flag | PURGE
Amazon - 0of 0 votes
Answerswrite a function to check given string matches with given pattern
- Andi in India
Condition: only one wildcard used in the pattern, that is '*', but can be used in the pattern more than once.
Example:
pattern: *abc*def*.doc*
str: adsfabcxyzdefgh.docx
fucntion signature is like: boolean isMatching(String str, String pattern);| Report Duplicate | Flag | PURGE
Microsoft - 0of 0 votes
AnswersWrite a method to which will download a file from remote server
- Andi in India
conditions are: if remote server not responding then should go into resume. Once it up it should start download file from where it got resumed.| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 0of 0 votes
AnswersHow can I give new implementation to methods in String.
- Andi in India
For example: I need to give new implementation to concat method, which concats two string and convert to uppercase.
I answered that, i create new custom class and create a method concat and implement it as the way interviewer want, but he asked that he want to do for all the methods in String, so writing new implementation for a methods is not a feasible solution.| Report Duplicate | Flag | PURGE
Goldman Sachs Applications Developer - 0of 0 votes
Answerclass A {
- Andi in India
public void method1();
public void method2();
public void method99();
public void method100();
}
Another factory class returning object of class A, how to implement logging mechanism, which should log entry and exit of each method call in class A.| Report Duplicate | Flag | PURGE
BT Software Engineer / Developer Application / UI Design - 0of 0 votes
AnswersHow many squares are in chess board?
- Andi in India| Report Duplicate | Flag | PURGE
BT Software Engineer / Developer - 0of 0 votes
AnswersGiven n length path (assume array with 0's and 1's), each step either a rock or acid bucket (0 is acid and 1 is rock), need to find the jumping pattern of the from to cross the given path. Conditions are:
- Andi in India
lets consider, curretly frog jumping at speed s, at each step
it can maintain same speed (s)
or increase by one step (s=s+1) or
decrease by one step (s=s-1);
find the jumping sequence for the given input.| Report Duplicate | Flag | PURGE
iLabs Software Engineer / Developer Algorithm - 0of 0 votes
Answersfind ginen BT is BST or not?
- Andi in India| Report Duplicate | Flag | PURGE
Directi Algorithm
private static int findMissing(int[]arr, int s, int e){
if((e-s)==1) return ((arr[s]+1)!=arr[s+1])?(arr[s]+1):-1;
int m = (s+e)/2;
int expVal = arr[s]+(m-s);
if(expVal<arr[m])
return findMissing(arr,0,m);
else
return findMissing(arr, m, e);
}
public static int findMissing(int[] arr){
if(arr.length==0) return -1;
if(arr.length==1) return arr[0]+1;
return findMissing(arr, 0, arr.length-1);
}
I guess it will fail, because
- Andi December 17, 2012input: {2,5,3,4,6,1}
output:
2->5
5->6
3->4
4->6
How 6 can be right child for both 5 and 4?