You are on page 1of 5

Application Details

I applied through college or university


2014.
Interview Details

interviewed at ThoughtWorks in September

29-sep-2014
It was an awesome experience.
I had gone through nearly 8 rounds
1.short code round (20-30 mins)
a.accept a week day like wednesday and a number like 2 then display sum as frida
y and subtraction as monday
b. display all odd numbers whose sum of digits is 7
2.logical round(1.15mins)
it is all about flow chart which u can get in net first two problems may change
3.pair programming round(1.30 mins)
a thoughtworker will be guiding u on the problem
problem statement
down vote favorite
An airlines company has several planes of the same type.Each plane has a seating
capacity of 24 X 3 rows and 8 seats in each row split has shown.
1 [a] [b] [c] [d] [e] [f] [g] [h]
2 [a] [b] [c] [d] [e] [f] [g] [h]
3 [a] [b] [c] [d] [e] [f] [g] [h]
If 4 people book-allocate 4 seats in middle row.Else 2 on the right and 2 on
the left.
if 3 people book- id middle section is empty,allocate there continuously.Els
e go to next row middle section.
if 2 people book-allocate the edge seats.
if 1 person has booked -then allocate whatever free seat available.
eginput 4
output-1c 1d 1e 1f
input-3
output- 2c 2d 2e
input-2
output-1a 1b
4.technical 1(1hr)
which is your favourite subject and practical questions on it,real world impleme
ntation,
how u could map ur knowledge to application level.no definitions only class diag
ram ,piece of code
what is dangling pointer ?
what is inheritance?implementation...
polymorphism ,function overloading,operator overloading
data abstraction,data hiding
how c++ different from c

when u save ur program how it stores to memry ..context switching


pointer to pointer etc
friend function
few dbms queries on join operation aggregation ,count
5.technical2(1.30mins)
most difficult round
4 subjects which u like other than c,c++ java
i said
os
dbms
networks
ada
what is semaphores
mutex
process scheduling
paging
page faults
deadlocks 4 conditions how to resolve
program to swap the words in string
eg hai hello cool
o/p cool hello hai
i used src and destn strings and did it later he askd me to do without using one
more menory space only within src string
if u have x1 y1 ,x2 y2, x3 y3 numbers
eg x values 1 5 7
y values 2 3 0
get minimal sum of xy
ie 7*0+5*2+1*3=13
when type some website how it is treated by browser to go to server
class diagram for banking system for some statement
osi layers
queries in dbms
normalization 1NF 2NF so on
about project
websites u daily visit
they opened dat particular site and asked few questions on it
and few mor questions
6.leadership round(30 mins)
tell me about yourself
family
why thoughtworks
if ur manager is not training u properly wt wld u do
what is the suggestion fr rejected candidates
fav actor

how many elements in periodic table


wt is cosec2theta
abt hobbies
tell me a short poem nw which u had written
7.values round(45mins)
how ur life values matches to company values
discussion abt society ur opinion hw do u care fr society ur contribution
8.aptitude(12mins)
50questions
increaing order of difficulty i solved 25
try as much as u can
sugesstions:dont panic be confident abt ur answers
technical rounds wil b bit difficult they try to pressurize u bt handle the situ
ations well
all d best
--------------------------------------------------------------------------------Reverse words in a given string
Example: Let the input string be i like this program very much . The function shoul
d change the string to much very program this like i
Algorithm:
1) Reverse the individual words, we get the below string.
"i ekil siht margorp yrev hcum"
2) Reverse the whole string from start to end and you get the desired output.
"much very program this like i"
#include<stdio.h>
/* function prototype for utility function to
reverse a string from begin to end */
void reverse(char *begin, char *end);
/*Function to reverse words*/
void reverseWords(char *s)
{
char *word_begin = s;
char *temp = s; /* temp is for word boundry */
/*STEP 1 of the above algorithm */
while( *temp )
{
temp++;
if (*temp == '\0')
{
reverse(word_begin, temp-1);
}
else if(*temp == ' ')
{

reverse(word_begin, temp-1);
word_begin = temp+1;
}
} /* End of while */
/*STEP 2 of the above algorithm */
reverse(s, temp-1);
}
/* UTILITY FUNCTIONS */
/*Function to reverse any sequence starting with pointer
begin and ending with pointer end */
void reverse(char *begin, char *end)
{
char temp;
while (begin < end)
{
temp = *begin;
*begin++ = *end;
*end-- = temp;
}
}
/* Driver function to test above functions */
int main()
{
char s[] = "i like this program very much";
char *temp = s;
reverseWords(s);
printf("%s", s);
getchar();
return 0;
}
The above code doesn t handle the cases when the string starts with space. The fol
lowing version handles this specific case and doesn t make unnecessary calls to re
verse function in the case of multiple space in between. Thanks to rka143 for pr
oviding this version.
void reverseWords(char *s)
{
char *word_begin = NULL;
char *temp = s; /* temp is for word boundry */
/*STEP 1 of the above algorithm */
while( *temp )
{
/*This condition is to make sure that the string start with
valid character (not space) only*/
if (( word_begin == NULL ) && (*temp != ' ') )
{
word_begin=temp;
}
if(word_begin && ((*(temp+1) == ' ') || (*(temp+1) == '\0')))
{
reverse(word_begin, temp);
word_begin = NULL;
}
temp++;
} /* End of while */

/*STEP 2 of the above algorithm */


reverse(s, temp-1);
}
Time Complexity: O(n)
Please write comments if you find any bug in above code/algorithm, or find other
ways to solve the same problem.
we can also do it like this!!!!!!111
#include<stdio.h>
#include<string.h>
int main(){
char *str = " programming j k klc dfd df";
int len = strlen(str);
int i,j,k;
for(i=len-1;i>=0;i--){
j=i;
while(str[i]!=' ' && i>=0){
i--;
}
k=i;
while(k<=j){
k++;
printf("%c",str[k]);
}
}
}
--------------------------------------------------------------------------------------------------

You might also like