ThoughtWorks-interview experience

Got a call from a consultant,

I am sharing my interview experience for the same with you.

  1. Telephonic [30 mins]
    1. Current Project, and how PMS work internally.
    2. The difference between quick sort and merge sort.
    3. Which sorting did java use internally?
    4. When to user Interface, and Abstract classes.
    5. How to make class Immutable, and if immutable class contain a list, how to handle it.
  2. Coding[With Laptop coding]
    1. Write a program to full fill following problem: two(times(three())) or nested cases also.All the operator should be there.[logic was important].Click Here to get the complete code of this problem
  3. Coding[With Laptop coding]
    1. Write a code to compute the cost of the checkout cart, have many items with quantity, the group of items can have the special price. Every item has there individual price.[Focus on domain design]
  4. F2F Interview
    1. Current project design, architecture, your role.
    2. Difference btw soap and rest service.
    3. Domain design for a ROOM.
    4. Multi-thread simple question,
    5. DB designing simple.
  5. F2F Interview
    1. this was more of a discussion rather than the interview, more related to culture and personality.They will try to understand who you are, what are your goals.Are you  right person or not for ThoughtWorks
  6. F2F Interview
    1. It was related to the 3 pillars that ThoughtWorks build on, and try will try to understand your point of view on various social issues
  7. Aptitude Test
    1. There are around 50 questions, you  have to complete as much as question in 12 min
  8. Logical Test
    1. There are 13 question which have to completed in 1 hour.
A major focus will be given to Domain Design, how the class is created and how the will interact.
OOPS, concepts are important.Name of the classes matter.
If really want to crack Thoughtworks, please check few books.

Given an array, find all the subsets

int arr[] = {1,2,3,4,5};
int level= 0;

for (int i = 0; i < arr.length; i++) {
System.out.println(arr[i]);
subset(arr[i]+””,i+1,arr);

}
}

private void subset(String i, int level,int[] arr) {

for (int j = level; j < arr.length; j++) {
System.out.println(i+””+arr[j]);
subset(i+””+arr[j],j+1,arr);

}

Find the all the lexical pair from the given array of strings.

lexical pairs

 

Vector<String> v = new Vector<String>();
Set<String> s = new HashSet<String>();
v.add(“Resistance”);
v.add(“Ancestries”);
v.add(“Gainly”);
v.add(“Laying”);
v.add(“test”);
v.add(“troop”);
v.add(“Amit”);
v.add(“Mait”);
v.add(“Self”);
v.add(“Taim”);
Boolean lexical = false,found = false;
System.out.println(“case 2”);

int lenght = v.size(),count = 0;

for (int i = 0; i < v.size(); i++) {
String source = v.get(i);

source = source.toLowerCase();
char[] sourceWord = source.toCharArray();
Arrays.sort(sourceWord);
source = new String(sourceWord);
//System.out.println(“source “+source);
count =0;
for (int j = i+1; j < v.size(); j++) {

String target = v.get(j);
target = target.toLowerCase();
char[] targetWord = target.toCharArray();
Arrays.sort(targetWord);
target = new String(targetWord);

if(source.equals(target)){
lexical = true;

System.out.print(v.get(i)+” “);
System.out.println(v.get(j));
continue;
// v.remove(v.get(j));

}

}
if(count>0)
System.out.println(“”);
}

if(!lexical){
System.out.println(“No such pairs”);
}

Given a matrix with each cell containing each number of candies, and a constraint that you can move only right or down, from the top left corner to the bottom right corner, find the path that gets you maximum candies.

Note: This result will print the all the possible path cost , you can fetch the path with maximum candies.

 

int matrix[][] = {{0,5,7},{7,9,1},{2,7,11}};
int rows = matrix.length,column = matrix[0].length;
System.out.println(“rows : “+rows );
System.out.println(“columns : “+column);
int TotalSum = 0,sum=0;

FindTheTotalSum(0,0,sum,rows,column,matrix);

}

private void FindTheTotalSum(int i, int j, int sum,int rows,int column,int[][] arr) {

if((i==column-1)&&(j==rows-1)){
System.out.println(sum+” sum of the path”);
}
sum = sum + arr[j][i];
if(i<column-1){
FindTheTotalSum(i+1, j, sum, rows, column,arr);
}
if(j<rows-1){
FindTheTotalSum(i, j+1, sum, rows, column,arr);
}

}