Sapient
Posted by sweetsmellofsuccess on June 30, 2008
Sapient had two technical tests.Both had questions to write programs.Even algorithm would do.They say any language c/c++/java etc.
In first technical test question was like there are 3 test centers say A B C and students can give their preference(1st pref 2nd pref n 3rd pref) where they want 2 give their test.But each center had limited seats only so if one center is filled students will have to be allotted their 2nd pref and so on.The question was to allocate students to different centers and it should work for many days as each student can say on which date he wants to take the test.
I wrote the program in C even though a ‘class’ approach would have been easier.Anyway the program is simple as it just contains lot of if else’s but remember to give enough care not to miss certain cases that may occur.Just think about all the possibilities and also remember to write some comments so that the one who corrects can understand and don’t give much importance to the date thing.
The time of test was 1 hour if my memory is correct.
Very few were selected for the next round and it had 2 questions but the time was the same.The questions were like
1. A Postal department receives postal letters from different companies. A postal mail has some weight and distance. Rates for each slab according to weight and distance was mentioned.
0-15 gm
15-50gm
50+ gm
0-50 KM
50-500 KM
500+ KM
Create a PostalMail class. which should have CalculateCost method. Also Postal Department has to generate Report for each company which contains count of letter for each slab and total cost of all mails which were sent by that company. If total amount exceeds Rs. 1000 then give 20% discount.
This generateReport method would take parameter as array/List of PostalMail class.
2. There was some string given AAAZBBBDDDDFF which is compressed as 3AZ3B4D2F. Write a method compress which takes uncompressed string and returns the compressed string.
The first question is similar to question in the previous round and second can be easily done with a loop.In case you need the answer just let me know.
Interview
Interview was a very friendly one.He even opened the door for me.Shaked hands with me and started off as if it was a chit chat.But soon he started asking questions about the problems that were solved in the first 2 rounds.He had the answer sheets of first two rounds.He asked questions from my program.Problems with it , enhancements that can be made etc.I think he was trying to find out my understanding of the problem.
Then slowly he moved to some core topics.Usual questions.Then java ,just the basics.1 question was like what is the output
for(int i=0;i<10;i++)
{
S.O.P(i);
}
S.O.P(i);
The answer is compilation error.If you difficulty finding why it is compilation error,just ask me and i will tell you.
I came to know that i got selected by that day night.