Paper Type Test Date

: Technical - Other : 11 April 2008

SAPIENT PAPER ON 11TH APRIL,2008
Hi friends, Here I m making for u available all the technical questions that are asked in the written of Sapient . The problems that are given below were asked in either of the two technical written of sapient. Thoroughly go through all these programs ….. make them by your own that will be much better because the technical interview is maximum based on the 2nd written paper i.e. u must be clear with the concepts and especially the logic behind the solution for the program made by u. Instructions: Write appropriate comments for your code wherever required. Focus on the approach & demonstrate problem comprehension & logic. Assume anything required & clearly indicate your assumptions. Note: Don‟t write any input functions such as main(). Program1. Reservation there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is taken that he may get all in row. If seats are not available in row then the arrangement is so that person group get nearby seats. The following class is given public class seat { char name; int seat; boolean is Seatempty } 1.Draw require class diagram and object diagram. 2. Write function seatallot (int noofperson) to allocate seat with seat number printed for the each name. Program 2. Stringreplace The forum is going on and administrator find that some people use abusing or bad language in discussion.so he decided that when he uses such language it was replaced with beap. question: 1. draw class diagram,and use appropriate data structure. 2. write function replacestring() 1) Write a program for the problem: the array of integers indicating the marks of the students is given, U have to calculate the percentile of the students according to this rule: the percentile of a student is the %of no of student having marks less then him. For eg: suppose Student Marks A 12 B 60 C 80 D 71 E 30

(25 minutes) 5) . The officer and clients must be registered to the system which will give them unique email ids. The denagram of a word is the letters of word arranged in sequential order. (20 minutes) 4) You need to create a class diagram or data model for the given requirements. Find out that error. 3 have marks less then him) percentile of A = 0/5*100 = 0%. we have to solve it and give the comments. And room has unique room id. 2) The code was given for a problem and u has to identify the logical error in it. That was simple. There was some logical error in that due to which it was not working properly. Also write a function to replace all odd occurrence of '?' to ' . Please create a class diagram or data model which helps him in developing a new software for it. The code was to merge the Danagrams of 2 words. The requirement is as follows:In a village there are only few families and there were only one newspaper/magazine agent. The agent plans to buy a computer and proceed. Also it has some rooms to be used for meetings between client and officers. Input :235126 . 6) Write a program to find the occurrence of characters '!'. they should be able to do it at any day of the month. Every family is getting at least one newspaper or magazine. ' . 7) There was a given program to insert a value at the proper position in a doubly linked list. there are lot of news paper and magazine available and every month a new magazine or newspaper it introduced. Don‟t write code. One officer is responsible for each room. Suppose if a family wants to cancel the subscription. (wrong) Desired output : fourteen hundred thousand. A meeting will be arranged only when the officer and client are free and room is also free. '$' '?' '. The program compiles without errors and runs. merging of Danamagram is to merge the danagrams of 2 or more words such that the highest no of occurance are coming for each alphabet. eg merging of aabhinv and abbhhixz is aabbhhinvxz. Design a class diagram or data model for this problem:A company has some clients and some officers. but the desired output is not got. for example Input: 456 Output : four hundred and fifty six (correct) Input :14000 Output : hundred and fourteen thousand.F 45 percentile of C = 5/5 *100 = 100 (out of 5 students 5 are having marks less then him) percentile of B = 3/5*100 = 60% (out of 5.' etc.' '. and there was a bug in it. There is no Syntax error but only the logical error. The family should be billed only for the days which they got the newspaper or Magazine. Arrange the meetings. It was easy. Do not write the code or Flowchart. Every month at the end the cost is calculated and collected. eg danagram of abhinav is aabhinv. 3)you have to write a program to calculate the sales price of the product for a given conditions. it is very simple. Java Program to convert the numeric to Words.

The cost to the company of an employee is the sum of his salary plus the cost to the company of all the people led by him. 10 min : Then told me to correct the mistake I had done in 2nd round answer paper. Write appropriate comments for your code wherever required. 10 min :About My project 10 min :curriculum /academic subjects . 2. Just logical error. 2: Generate an ordered sequence of 4 unique alphabets. Focus on the approach & demonstrate problem comprehension & logic. 10 min: Debugging q1 . BNMA Technical interview: 50 minutes technical interview . The program is in java . Qs. Given is the following structure : Employee Data members: Name Salary isBoss nameOfBoss Methods: getSalary getName a) Define the class/structure b) Write a function get Cost To Company() to calculate the cost to the company of an employee whose name is passed as a parameter to the function get Cost To Company() public float get Cost To Company (String name) Note: Don’t write any input functions such as main() & assume that the data structures have already been defined. KRXZ Unordered : DCBA. Assume anything required & clearly indicate your assumptions.1: A company has many employees & each employee is led by only 1 person except for the CEO (who has no boss). BCHU. 10 min :Extra activity – like IEEE membership / achievements / seminars / paper presentation / competitions etc. 3.and don‟t have any syntax error. . Qs. Eg.(15 minutes) Additional 2 programs to search an element immediately gr8r then all present in an array without sorting and a modified version of it to handle all error conditions Instructions: 1.They had given me one program for debugging.output : hundred and two hundred and thirty five thousand hundred and one hundred and twenty six (wrong) I am not much clear about the question but frame it out. where an ordered sequence is one which is arranged in ascending alphabetic order. Ordered : ABCD.

They also ask about summer training and other projects which you have done. Written Watch out all the previous problems of sapient and try to solve them implementing your own logic. so read the questions carefully. Operating Systems. Say each and every word with confidence and show him your determination. Interview You should be strong with C/C++ concepts. Problems were regarding compression and post-mails. You should be completely clear with your logic and concept as during interview you will be grilled over it mainly. Mind that those guys are too technically strong and they scan your paper within 1 min. Logic will remain same but there will be slight variations. They can ask any question from these subjects as a CSE/IT student should be aware with these topics always. So don‟t lie with them and be honest. data structures. In second round written examination was not an elimination round.2008 Today I am a proud member of Sapient after getting rejected from 4 companies like TCS. Now days they have started giving new problems. ACCENTURE and IFLEX. and are aware about your codes shortcomings and mistakes where you have done. INFOSYS. DBMS. OOP‟s concepts. Prepare at least two solutions of all problems and read carefully question paper as they always use to make some changes in problems. Software Engineering. . He also asked about pointers to my friends and in much detail. He asked me about quick-sort. Write comments properly and show some cuttings in your sheet too as it was asked during interview why there is very little cutting in your paper. fool) with # or with other letter. Problem was about abusive words and train reservation. Questions: Round1: 1) Abusive Words A message was given in which we have to replace abusive words like (stupid. Also you should be completely thorough with each and every word of your Resume. normalization. Whole drive was divided in two steps. introduce my project. In second round again we were required to code two problems within an hour. Results were announced after a week and second round was conducted after 11 days of results which was again divided in two parts. They took interview of all the students who cleared the first round.Paper Type Test Date : Whole Testpaper : 9 April 2008 SAPIENT PAPER ON 9TH APRIL. of # depends on conditions like it can be equal to the length of the word like stupid is to be replaced with ###### but in my question an abusive word has to be replaced by ### (3 #) only. He will ask you what do you understand from the problem given in the written examination and how you proceeded. I have written the questions of both rounds below. The word is listed in some look up table in Max_list_word. In first round we had to code two questions within an hour. Data Structures. Don't copy answers from net and other sources as they are fed up with those answers and want new logic or if same logic is used. No. then a new way of implementing that problem. After that interviews were held which lasted from half an hour to an hour generally.

1000 then 20% discount is offered to the company. Conditions are: Weight<15 gm and Distance<100 km then cost=Rs. 1/km >500 km = Rs. Also customer should be allocated seats in a row or nearby seats if not possible. you have to write the program to get the cost of postmail per company depending upon its destination and weight. 5 Additional cost of mail should be calculated according to the following slab Weight 15-50 gm = Rs. if compressed string is like 2A3DY(3!%#^*2@)A2S then all these non alphanumeric characters should be cleaned off.2)Train Reservation There are 67 seats in a train in which there are rows of five seats and last row contain only two seats. If compressed string contains letters other than alphabets or digits i. 2/km (Here charges are factious to just give you an idea of the question) If the cost of the mails exceed Rs. int seat.e. Round2: 1) Compression of a string Take any string and we have to compress it so it can be passed over a congested network easily. Given: getdistance() is function which gives you the distance between two cities. But in my question compressed string should be 2A2S2GTH2MEG. boolean isSeatempty } Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name. Also last 2 seats are to be allocated first if reservation for 2 seats is demanded. Very simple program just use if and else loop. So again read the problem carefully. if postal weight is this then u have to pay this amount. If string is AASSGGTHMMEG then compressed string will be A2S2G2THM2EG. The following class is given public class seat { char name. 2/gm >50 gm = Rs. 3.5/gm Distance 100-500 km = Rs. . We have to make functions: Compress() Clean() ) Post mail Question Conditions are given like if you cover some distance you have to pay this amount. Thus five to six conditions are given. A person can allocate maximum 5 seats on his name.

Ex like: 1st preferernce EC-B 2nd preference EC-A 3rd preference EC-C There are two classes Class candidate { 1st preference 2nd preference 3rd preference Exam_date } Class Avail_seat { Seat_avail_in_A Seat_avail_in_B Seat_avail_in_C } Allocate the seat as per 1st preference. then allocate 2nd preference. Mysore There was two rounds. candidate can choose online these exam centers with preference. . Mails with weight less than 15 gm and distance less than 100 km are : Mails with weight 15-50 gm are: Mails with distance 100-500 km are: Mails with weight greater than 50 gm are: Mails with distance greater than 500 km are: Total cost due to mails to company: Paper Type Test Date : Whole Testpaper : 11 August 2007 SAPIENT PAPER ON 11th AUGUST AT MYSORE The test was on 11th Aug 2007. sharing…!! Problem(1 hour duration) There are three ICFAI exam centers.Report has to be generated per company displaying there mail details for a single day. 1) Code a problem 2) Tech Interview . (You can avoid the main and not important codes).this was after a week in Bangalore JSS college I hope you will find help from this info. WAP to implement the concept. if not available. in Vidya Vardhaka College of Engineering.

I coded like this Class candidate { 1st preference 2nd preference 3rd preference Exam_date Public : Int Get_first_preference() { (char) Return 1st preference. so a syntax error…!! { . Int get_seat_C() } Other than the above classes. /* so one seat will reduce from the total seat available in the ecam center A */ } void set_seat_B() void set_seat_C() int get_seat_A() { Will return the seat available in the EC. } \ Int Get_second_preference() Int Get_THIRD_preference() Date GET_DATE() { } } Class Avail_seat { Seat_avail_in_A Seat_avail_in_B Seat_avail_in_C Public : void set_seat_A() { Seat_avail_in_A = Seat_avail_in_A – 1 . which is Class alloc_seat : inheritence candidate /* I used inheritance in my program also. I took one more class.A } Int get_seat_B().

which I did in first round .” } } Above code is only for a particular day. } elseIf(Get_first_preference() = „B‟) else If(Get_first_preference() = „C‟) If(seat_allocated == NULL) /* If seat is not selected */ If(Get_second_preference() = „A‟) If(Get_second_preference() = „B‟) If(Get_second_preference() = „C‟) If(seat_allocated == null) If(Get_third_preference() = „A‟) If(Get_third_preference() = „B‟) If(Get_third_preference() = „C‟) Else Cout<< “Seat is not available on this date.. understanding capacity of a problem and also analyzing and solving capacity. 1) How you feel to study again(I was worked for one year) 2) Tell me about your self 3) Define the first round problem briefly 4) Did you implement fully? 5) I was asked to explain the program. They will check your confidence.char seat_allocated. These are the questions. To do it for all dates which is in calendar…?? Check it out Tech Interview (Pure technical. They least bother about HR questions. around 1 hour duration) This was on another day in Bangalore JSS college. Seat_allocated = A . /* So the EC-A seat will will be deducted by one. public : void seat_allocated(candidate_list[]) /* This is the main function they are explicitly asked */ } void alloc_seat :: seat_allocated(candidate_list[]) { /* program flow if date is the required date { If(Get_first_preference() = „A‟) { If(get_seat > 0) Set_preference().

Paper Type Test Date : Candidate Experiences : 19 October 2006 SAPIENT PAPER ON 19th OCTOBER hi frenz.6 L pa for first 6 month and then after 4. Then Sapient will be yours. and be good in C/C++.. This will be increment depends on your performance.! Finally I got selected in Sapient with 3. each row contains 5 chairs. 2) if a input string contain some restricted words(list was given) then instead of those words "***" sud b printed. OOPs concepts. it's abt sapient paper. if a person wants more than 1 seat those sud be reserved cosicutively.a. .& if seats r not available then a msg sud b print"required no. Explain static global structure Implement virtual function Do you want to ask any thing? Requirement of fresher‟s in Sapient About the internship Will you work up to 12 night? Will you work in testing? Feedback was given on the spot interview panel Be very confident.6) 7) 8) 9) a) b) 10) 11) 12) Asked to complete what I missed in first round(Date).2+ L p. it consist of two programs which sud be devloped using c++ \ java only 1) thr is a train which have 67 chairs in forms of rows. of seats r not available" at last print the passengers name with thr chair nos.or a beep sound sud b produced.

A postal mail has some weight and distance. which i did easily. This generateReport method whould take parameter as array/List of PostalMail class. If total amount exceeds Rs. Rates for each slab according to weight and distance was mentioned. Q2. Asked me lot of questions about my project. 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. which shud have CalculateCost method. Why their written exam is different form other giant IT comapny exams. If u make any mistake during in written then they will ask u to correct in interview. HR & Tech Interview combined. 0-15 gm 15-50gm 50+ gm 0-50 KM 50-500 KM 500+ KM Create a PostalMail class. 1. Team Member skills. Asked some basic HR questions. He asked me is your program capable of handling null and newline characters. Hope this will help u. Then he asked me if u have any questions. Then he asked me to explain scenario of the questions given in written exam and to correct the mistakes i did in paper. write a method compress which takes uncompressed string and returns the compressed string. Written test which contain two questions -1 Hour 2. Round 1. Also during the n/w transmission of compressed string some invalid chars get embedded such as 3A$B^5#F Write a method to remove these invalid chars. He gave me some sample strings to compress. He started with asking about myself. Both the questions were easy but do them with great care and read the questions carefully because only these question will decide wether u r thru or not.1 Hour There was two questions in written test. Such as Team Leading. I already have an offer for other giant Indian IT comapany. He asked me why u want to leave such a big company. what is team size here. I asked him about what type of projects do they take. Round 2: Interview The interviewer was a cool guy. 1000 then give 20% discount. . how do they capture client requirements and how much time it takes. A Postal department receives postal letters from different companies. There were two rounds. What skills they look out for in a candidate.Paper Type Test Date : Whole Testpaper : 21 April 2006 SAPIENT PAPER ON 21st APRIL 2006 I went thru the interview on 21 Apr 2006 and got selected. There was some string given AAAZBBBDDDDFF which is compressed as 3AZ3B4D2F. Written Q1.

like IEEE membership / achievements / seminars / paper presentation / competitions etc.in any language . 10 min:Debugging q1 . The program is in java . if postal weight is this then u have to pay this amount . Those who cleared this test hav technical interview round Technical interview : 50 minutes technical interview .Duration 1hr .mail / sort / print / the result .Paper Type : Whole Testpaper Test Location : MUMBAI SAPIENT PAPER AT MUMBAI Sapient test 2nd round :Oberoi . Thus five to six conditions are given . This is also technical round . Very simple program just use if and else loop . Just logical error. 10 min : Extra activity .and don‟t hav any syntax error.mails Some conditions are given like if you cover some distance you have to pay this amount .They had given me one program for debugging. Name : Post . you have to write the program to get the distance of post . You have to write two programs . Program 2 Name : compress and decompress the string . 10 min : Then told me to correct the mistake I had done in 2nd round answer paper. 10 min : About My project 10 min : curriculum /academic subjects . .preferably c++ and java. Given : getdistance() is function which gives you the distance between two cities.Mumbai. Program 1. One string is given like : aaabbbbbcddddeeee You hav to compress the string like a3b5c1d4e4 And it may happen while transferring the compress string some non alphanumeric characters can add in compressed string so compressed string can become a@3b%5c*1d$4e4 like this you have to remove this extra characters.

. Those who cleared this round set for business interview.5 min: Feedback .

Sign up to vote on this title
UsefulNot useful