Walmart Labs Interview Report
- 0of 0 votes
AnswersPrint all permutations of a string and give the complexity of the algorithm.
- killdos October 11, 2015 in United States| Report Duplicate | Flag | PURGE
Walmart Labs Java Developer - 0of 0 votes
AnswersGiven a tree (incolmplete and/or unbalanced), how would you write it to disk so it can be moved to another machine and recreated?
- killdos October 11, 2015 in United States| Report Duplicate | Flag | PURGE
Walmart Labs Java Developer - 0of 0 votes
AnswersFind the value of (x, y) in Pascal's triangle. I wrote code to construct the Pascal's triangle upto the required (x, y). Then interviewer asked me to change code so that I dont have to calculate the whole triangle but only the necessary parts.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
For example, in order to calculate f(4, 1) which is 4, we only need to calculate f(3, 0) and f(3, 1). And for f(3, 1) we need to calculate f(2, 0) and f(2, 1) and so on. After getting the hint, I wrote the recursive code and then he asked my for complexity of the code.
- killdos October 11, 2015 in United Statesint pascals(int x, int y){ if(x == 0 or x == y) return 1; return(pascals(x - 1, y) + pascals (x- 1, y - 1); }
| Report Duplicate | Flag | PURGE
Walmart Labs Java Developer - 0of 0 votes
AnswersImplement pow(x, y) which should return x^y. Both iterative and recursive.
- killdos October 11, 2015 in United States| Report Duplicate | Flag | PURGE
Walmart Labs Java Developer