Sei sulla pagina 1di 23

SONATA PAPER & INTERVIEW - 22 MAY 2008 - MACHILIPATNAM

Rated : +65 , -3

Hi Friends

This is Rakesh pursuing IIIrd BTech from D.M.S S.V.H College of Engineering, Machilipatnam in CSE Stream. First of
all I would like to thank this site and all the students who had kept previous papers of Sonata which was indeed very
helpful for me. I advice all of you to refer previous papers as a few bits will be repeated. I am here to share my
experiences while attending the Sonata selection process. Sonata came to GEC on 22nd May, 2008. Around 450
students from 4 different colleges attended the selection process, and 7 students were selected. We reported at
8:00AM and the selection process started at 9:00AM. The selection process involves 5 Rounds.

First Round: APTITUDE ROUND

In this round they have given 50 questions which you have to answer in 12 minutes. In this round the most
important thing is speed and accuracy. You should not waste even a second after you are given the paper. Some are
multiple choice questions and some are fill in the blank type. You will be given an answer sheet where you have to
mark your answer for multiple choice questions and write the answer for fill in the blank type questions. 4 Sets of
papers (All are of equal depth) will be given to the students. So students adjacent to each other will receive a
different question paper which consists of different questions.

The question paper demands knowledge in
1. General Mathematics (Like calculating costs of items from given data say 1 pen this much 220 pens how much?
identifying the odd one, Simple calculations etc.)
2. English : Words often confused(Why because they will give two words and ask us to identify the relation between
them whether they are synonyms, antonyms or no relation etc), Idioms and Phrases(They will give a sentence and
ask you to choose the meaning of the sentence from the given four options.).

3. Analytical: Syllogism based questions (Simple ones), Coding etc. Bits like Hyderabad: Andhra Pradesh then they
will give four options; we have to select one option which is similar in nature as above given statement. Here the
relation between the two words is Hyderabad is capital city of Andhra Pradesh.

First you have to identify the easy bits and answer them. Then you should concentrate on others. There will be
around 25 bits which u can solve in 4-5 minutes (Very easy ones). Do them accurately, 65% of the job is done. Then
concentrate on bits which you know how to solve and finally tick something for the bits that you dont know how to
solve as there is no negative marking. Out of 450 students 60 were selected in Ist round of written test.

SECOND ROUND: Technical Written (C/C++)
30 bits will be given and you have to answer them in 30 minutes. All are of multiple choice type .Our paper covered
bits from different areas in C and C++. I remembered only a few bits which I am posting it here.
Bits like:
A bit on how a c program is executed. Refer Yashavanth Kanethkars let us C text book in which the whole process is
clearly given X.c-> -> X.exe. In the question you will be asked to tick the correct sequence of execution.
A bit on macros #define cube(x) x*x*x. You have to replace this code and follow the order of execution
Eg:#define cube(x) x*x*x
main()
{
int a;
a=6/cube(6)*6;
printf(
a=%da);
}
What is the output of the above program?
Ans:216. (6/6*6*6*6 -> 1*6*6*6 ->216). Here order of precedence should be considered. Just substitute that
macro instead of cube(6) as 6*6*6 but dont directly substitute 216 in the statement. Refer Yashavanth Kanethkars
Test Ur C skills. U can find a lot of bits of this kind.

3)strstr is a function belonging to which header file
<String.h>

4)A bit on priority of operators. You will be given four choices with different priorites from which you have to select
the statement with correct priority.
Ans)
Arithmetic operators>Relational Operatoirs>Logical Operators>Assignment Operators.

5) A bit on switch case which is little tricky.
Please refer Test your c skills by yashavanth Kanethkars text chapter 2: Control Structures.

6) A few bits on pointers. Same refer Test your C skills.

7) Difference between malloc() and calloc() statements.

8) A bit on Command line arguments.Its very easy one.He has a given a command line argument and asked us to
give the no.of arguments passed. (Refer test your c skills.)
myprog 1 2
main(int argc, char *argv[])
{
.

..
}
How many arguments are passed to main.
1)2 2)3 3)10 4)8.
Ans.Opt2. myprogram,1,2 are the three arguments that are passed to main.

9) A bit on scope and life time of variables (Refer Let us C by yashavanth kanetkar text book chapter: Storage classes
in c for better understanding).

10)A bit on array int array[5]={1,2,3};
Then what is a[4]
Ans:0
Why because a[0]=1,a[1]=2,a[2]=3 The remaining are automatically taken as 0.So a[3],a[4] are taken as 0.

11)A bit on for loop. You should clearly understand the syntax and semantic of for loop to solve that bit.

12)Which of the following occupies less memory (Consider the platform as Windows.So char-1 byte, int 2 bytes,
float -4 bytes)
1)some structure will be given struct a{int a,b;float c;};
2)union b{int a,b;float c;}
3)char a[10];
4)int a,b,c,d;
Ans:

Opt1 occupies (2*2+4)=8 bytes
Option 2 occupies only 4 bytes as Union allocates memory for the largest data type in its members. In this case
memory for float c is allocated.
Option 3 occupies 10 bytes.
Option 4 occupies 8 bytes.
Opt 2. Is the answer.

13)A bit on enum.

14)main()
{
int n=3;
If(n=5)
printf (Hyderabad);
else
printf(Vijayawada); //Of course it is not exactly given as Hyderabad and Vijayawada bit something else
. which I didnt remember
}
What is the output of the program?
1) Hyderabad 2) Vijayawada 3) Error ..
Ans) Opt 1 Why because we used n=5 here which is a non Zero value i.e. TRUE, Hence if (TRUE) then First
statement will be executed. Hence Hyderabad is printed.

15)There is a bit like this
main()
{
int a=10,b=0,c=5
If ( a && b || c)
printf(This is X);
else
printf(This is Y);
}

Output:
This is X.
Since a&&b yields False. But False || True. Hence the whole statement becomes true.
(a=10 is a non zero value and hence true,b is 0 and hence false,c is 5 which is a non zero value and hence is true.
T&&F=F and F||T=T. Hence the statement becomes true.)

16)
main()
{
int a=10,b=11,c;
c=a&b;
printf(The value of c is %d,c);
}
What is the output:
1)10 2)20 3)0 4)ERROR.
Ans.Opt.1

Since The operator used above is a bit wise operator. Hence we have to convert a and b into bits (Binary format).
a=10-------->1010
b=11-------->1011
And
a&b--------->1010. The value is 10.

Every bit that I have presented here is not given as it is in the exam, but with little changes, I have covered the
exact concept. These are all the bits that I remembered in c. But if you refer Test your c skills. Its like a cake walk for
you to solve them.
C++:
A bit on Inheritance concept.
A bit on Access specifiers concept.
A bit on order of creation of Constructors for objects. Always objects are created from base class to derived class.
A bit on Destructors.
A bit on virtual functions.

I dont remember the way bits are given in c++, But if you go through the theory in above topics you can easily solve
the bits. To solve these bits you need clear understanding of above concepts like Inheritance, Access specifiers,
Constructors, Destructors, Virtual functions. C++ bits are relatively very easier than c. To practice c++ bits please
refer Test your c++ skills by yashavanth Kanethkar.

Next is General English:
Its very easy.30 Questions will be given and u have to solve them in 20 minutes.
Fill in the blanks (like prepositions, articles) etc will be given.
Fill in the blank with appropriate word will be given.

We will be given two letters containing some blanks in the middle and you need to fill those blanks with some
sentences that match the situation. Our first letter is - a person will write a letter to his friend quoting the reasons
(My brother recently met with an accident and hence I was unable to make it to the party and so on) for which he
was unable to attend his Birth day party. The other letter is This friend will write to this person saying how he has
celebrated his birthday. In this conversation You will be given some blanks and u have to fill in those blanks .Eg:1)
Hope your brother will ___________. Ans is recover soon. Eg2) Convey my _________ Ans is regards to your
parents. The answer may be anything that is apt in that place. Like this we were given some 10 fill in the blanks.

5 bits will be given of the following type:
Eg1: In front of Office room you will find this:
Leave your footwear outside 2) Walk slowly 3) No parking
Choose the right option.
Ans: Opt1.

There is letter writing: Write an e-mail to your superior requesting him to grant leave for two days because of your
personal reasons. Refer some formal letters in net. You will get an Idea on them. Its very easy.
Paragraph writing: You must write at least 10 lines on one topic from the given 5 topics (choice 1/5). The topics are
1) Integrity in workspace 2)5 qualities an employee should have. I remembered only these two topics.
For English, you dont need any kind of preparation if you are good at basics. This is all about second round.18 people
cleared this round.

Third Round: Group Discussion
18 members are divided in to two batches. Each batch has 9 members. Almost 20 minutes of time is given to each
team. Everybody is given a chance to conclude their own views. They will provide you a paper to note down your
points in the first 1 minute. Just write 1 word related to every point so that you can put all your points while you are
speaking without forgetting anything .Its very easy round if you are good at communicating. Be clear and to the
point. Dont deviate from the topic. Never feel nervous. HR will give be judging the team. Never look at the Judge
while you are in the GD. Always maintain eye contact with team members. Always try to initiate the discussion,
otherwise somebody may tell points which you thought of saying. But dont worry if u dont get a chance to initiate,
Iam the seventh member to speak but still got selected. The only thing is you should give your points in a clear way.
If everybody is talking continuously and not giving you chance, then simply raise your hand and say Friends
everybody should be given a chance to speak. Now its my time to share my views. If you are cool you can get a lot
of points in your mind, otherwise you will forget what you know. Speak confidently with a smiling face. Thats it. If
you have these points in mind you can get through this round.
After GD 10 members were selected for Interview. Iam the only student from our college.

Fourth Round: Technical Interview
This is the most deciding round of the whole process. They want people who are technically sound. Now I am not only
going to give the questions that are asked to me but also the technical interview experiences of almost all of our
selected ten candidates that I came to know with a little Interaction with them. I am the last candidate to be
interviewed. I take this opportunity to thank Hari Krishna, Neher, Ravi Kiran, Meher Deepthi, and Supraja for sharing
their interview experiences with me.
If you are from Non IT branch, It is enough to have knowledge in c,c++,os and all your core subjects. But students
from computer science background need to be thorough with all our subjects (cse related).

Tech Questions:
Question: What all did you learnt in your Engineering? (Common question to everybody.)
Physics: Some problems on Kinematics.
Eg: If a stone and a stop watch are given to you and asked to find the height of the tower, how will you find.
Ans. Leave the stone from the top of the tower and calculate the time taken to reach ground.
S=ut+ (1/2)at2
For a freely falling body, initial velocity u=0,t=time taken to reach ground(That u found using stop watch.) and
acceleration a=g(For a freely falling body).
This way u can find height (S).
A few more problems like this which you can solve easily. Be thorough with all the formulae in Kinematics.[other
equations are v2-u2=2as, v=u+at.]

Chemistry: Some questions on periodic table. Just refer Periodic table and identify the characteristics of elements.
(Dont go in depth.)
What are reversible and irreversible reactions? Give an example.
Dont get panic. Even if u doesnt remember it is not a big problem. Say u doesnt remember. Or Say Sorry. They
will just see your confidence while answering these questions.

Mathematics: Some questions on permutations and combinations, Probability.
Engineering Drawing:
What is orthogonal view?
What is Isometric view?

EDC: What are semiconductors? What are p-type semiconductors and what are n-type semiconductors?
Why Germanium and silicon are used in semiconductors? What is valency of silicon?

DLD: Truth tables of NAND, NOR, EX-OR, AND, OR.
Gates for NAND, NOR, EX-OR, AND, OR.
If possible go through all the basic definitions in Basic
Electronics.(capacitor,Inductor,Current,Voltage,Resistance,Transformer,Transistor etc.).

C Language: What do you know about C language? I spent almost 10-15 minutes in answering this question.
Write any sorting algorithm?
You may be asked to write any sorting algorithm. (Insertion Sort, Selection Sort, Bubble Sort, Shell sort, Quick Sort
etc.).What is the best sorting algorithm and why?
Write a searching technique in c?
What are the differences between Header files and Library functions?
Library functions consist of executable code where as Header files just consist of Declarations.
Write a program to concatenate two strings without using built in functions. (It is better if u prepare to write code
using pointers for all library functions in strings. Like strcat, strcpy, strrev, strcmp etc).
What is portability?
What is difference between c and c++.
Did you write any program in c which you felt proud of????
Try to write any application. Dont say simple programs like palindrome, abundant nos, perfect no, deficient no, even
or odd, prime no, Armstrong no, strong no. etc if you are from computers background.
Write a program to print the prime numbers between 1 to 100. (The code must be efficient.)
I used two loops.Print 2 first.Dont check the condition for even numbers(as 2 is the only even prime ).Check only for
odd numbers.Hint: for(i=3;i<=99;i+=2)
for(j=2;j<=i/2;j++).

DBMS: What is DBMS?
What is Normalization? Why is Normalization done? What are different Normal Forms and explain each.
Small queries in sql.(Go through the basics in SQL.)

Software Engineering: What is Software Engineering?
What is SDLC (Software Development Life Cycle)? And what are the stages in it.
Explain each stage.
What are different process models? Which is the best process model and why?
What is static testing and what is dynamic testing?

Java: What are the differences between c++ and Java?
Where is Java most useful?
What is JVM?
What is platform dependency?
What are scripting languages? Be thorough with definitions in them (html? xml? etc).

UNIX commands: If you are from computer science background, you must be thorough with UNIX commands.
One of my friends were asked commands in UNIX, She was able to answer only a few commands but still got
selected. Dont get panic when you are unable to answer in some area. It is better to know UNIX commands.

Computer Organization: Explain memory management?

Operating Systems: Be thorough with all the basic definitions
What is OS?
What is a deadlock?
What is a Semaphore?
What is paging?
What are different scheduling algorithms? Explain?
What is cache memory?
What is virtual memory?
What is a thread?
What is multithreading, multitasking?
Differences between Windows and Linux?

Projects: If you have done any projects. They will ask you to explain.
They will ask the reasons for which you have chosen this platform(c,c++,.net or java) to do the project.

HR Round:
Why should we recruit you? (Common question asked to everybody)
Tell me about yourself?
Tell me about your family background?
If you are from non IT branch-Then they will ask you why do you want to join in a software company.?Be careful
while answering this question. Dont say that salaries are high.
You can say like this-- As software field requires people who are more innovative and who are good problem solvers
and who can accustom to changes, Iam sure that Iam having all these qualities and can easily learn the required
technical skills for being a software Engineer.(One way of answering the question).

One thing I would like to mention is dont try to bluff the interviewer. When You dont know something, Say sincerely
sorry. Be cool throughout the interview. Make some study on the company before attending the interview. Listen
carefully to the power point presentation given by the HR during the pre placement talk in your college. Note down
the points as you cant remember all the points till the interview. These points will help you to answer some HR
questions. Dont put what you dont know in your resume. Be thorough with your resume.
Hope this paper will help all the students who are attending for Sonata Software Limited. I take this opportunity to
thank my parents, who gave me a lot of encouragement throughout my life. I also thank faculty and my friends who
are always there behind my success. Finally I am grateful to GOD for his blessings. All the best and see you all at
Sonata Software Limited.


SONATA PATTERN & INTERVIEW - 02 JUN 2007
Rated : +6 , -1
Hi Friends

First round: Aptitude questions
50 questions in 12 minutes, try as many as possible with speed and accuracy.. they are easy but
10-15 questions may time taking. So make ur time to answer good number of questions accurately.
Don't think that all are objective questions, for some questions you have write answers there.
This is the main elimination round. We have written above 700 students and 96 were selected for next round.

Second round: It was technical and English written exams for us
First technical round in CC++ questions... 30 questions in 30 minutes
we have to be thorough with C very much. that is in every concept like pointers, structures, files...

Next we have English exam it is easy.. testing in prepositions, and we have write a small essay about a topic given by
them... and an email. the test duration was 20 minutes.

Group discussion: Here fulfill your part by making your contribution with quality.

Interviews: first was technical interview and HR round.
I have called for interview at begumpet office, Hyd on 7th june. For me technical was mainly with C basics, (i am from
ECE stream)
ex: program to reverse a number....
HR was cool going for me and i am selected for a good company.

SONATA PATTERN & INTERVIEW - 07 FEB 2007
Rated : +4 , -0
Hi Friends

Total 50 questions in 12 minutes all r easy except 5 to 10 questions like

Last month of year???

10!=? etc
but few question r on time distance, workwedge etc
only speed is required with accuracy

next written is Technical based on C/C++
very easy questions like
#define sqrt1(x*x)
main()
{
int a=5,b;
b=sqrt1(a+2);
printf("%d",b);
}
functions of string.h
like strstr belongs to string.h or not

English paper
few easy paragraphs
word matching etc

Tech interview depends on ur resume
dont make ur resume heavy if u r not prepared

HR
prepare this question sharply
What do u know abt SONATA????
describe urself
what do u think abt IT industries??

then a Merittrac paper which contains general English, Mathematics, LR, C question, C++ question
total duration 1 hr 45 min
but this written is approx formality
so dont be worry
SONATA SOFTWARE PAPER
Rated : +14 , -4
* Find the antonym of autumn
(a) Spring (b) Winter (c) Summer (d) None of the above

* Select the odd one
(a) January (b) February (c) Wednesday (d) November

* Select the antonym of capture from the following
(a) attack (b) Release (c) condemn (d) None of the above

* One skirt requires 3.75 yards of cloth. How many skirts you can make from 45 yards?
Ans: 12 skirts

* One skirt requires 3.75 yards of cloth. How many skirts you can make from 45 yards?
Ans: 12 skirts

* How can you make a square from two triangles?

* Is the meaning of Client and Customer,
(a) same (b) contradictory (c) no relation

* Is the meaning of It's and Its,
(a) same (b) contradictory (c) no relation

* Is the meaning of Canvas and Canvass,
(a) same (b) contradictory (c) no relation

* Is the meaning of Ingenious and Ingenuous,
(a) same (b) contradictory (c) no relation

* Is the meaning of Credible and Credulous,
(a) same (b) contradictory (c) no relation

* Select the odd one out.
(a) 1/4 (b) 1/3 (c) 1/6 (d) 1/18

* Select the least from the following.
(a) 0.99 (b) 1 (c) 81 (d) 0.333

* Find the next number in the series. 1, 0.5, 0.25, 0.125
Ans: 0.0625

* One dollar is saved in one month. Then how much dollar is saved in one day?
Ans: 1/30 =0.0333$

* Y catches 5 times more fishes than X. If total number of fishes caught by X and Y is 48, then number of fishes
caught by X?
Ans: 8

* Y catches 5 times more fishes than X. If total number of fishes caught by X and Y is 42, then number of fishes
caught by X? Ans: 7

* If a train covers 600m in 0.5 seconds, how long it will cover in 10 seconds?
Ans: 3000m = 3km

* The girl's age is twice that of boy, if the boy is four years old. After four years the age of the girl is Ans: 12 years

* Sister's age is twice than that of the brother. If the brother's age is six, what is the sister's age after two years?
Ans: 14 Yrs.

* Two lemons cost 10 cents. Then one and a half dozen cost
Ans: 90 cents

* A clock is late by 1 minute 27 seconds in a month. Then how much will it be late in 1 day?
Ans: 2.9 seconds

* Which of the following figures together will make a triangle?
Ans: a,b,c,d

* Make a square by drawing only one line
Ans: line 2-5, square 2-3-4-5-2

* Which of the following is the odd one? crew, constellation, companion, league, participants.
Ans: companion

* Opposite of Remote?
(a) Far (b) Near (c) Huge (d) Village

* Statement A: All great men are ridiculous;
Statement B: I am ridiculous ;
Inference : I am a great man;
(a) True (b) False (c) Not clear

* Statement: Normal children are active;
Inference: All children are active;
(a) True (b) False (c) Uncertain

* Next number in the series 1, 1/2, 1/4, 1/8 ?
Ans: 1/16

* In 6 seconds a light flashes once. In one hour how many times it will flash?
Ans: 601 times

* At 20% discount, a cycle is sold at a selling price of 2500 Rs. What is the actual price?
Ans: Rs. 3125

* Statement A: A & B have same age;
Statement B: B is younger than C;
Inference : A is younger than C;
(a) True (b) False (c) Uncertain

* All chickens lay eggs (True/False)
Ans: False

* A invests $12000, B invests $8000, C invests $6000 and they got a profit of $1200. How much share A got more
than B and C?
Ans: 2/13 and 3/13
SONATA SOFTWARE PAPER - 2004
Rated : +5 , -2
1) Point out error, if any, in the following program
main()
{
int i=1;
switch(i)
{
case 1:
printf("
Radioactive cats have 18 half-lives");
break;
case 1*2+4:
printf("
Bottle for rent -inquire within");
break;
}
}
Ans. No error. Constant expression like 1*2+4 are acceptable in cases of a switch.

2) Point out the error, if any, in the following program
main()
{
int a=10,b;
a>= 5 ? b=100 : b=200;
printf("
%d",b);
}
Ans. lvalue required in function main(). The second assignment should be written in parenthesis as follows:
a>= 5 ? b=100 : (b=200);

3) In the following code, in which order the functions would be called?
a= f1(23,14)*f2(12/4)+f3();
a) f1, f2, f3 b) f3, f2, f1 c) The order may vary from compiler to compiler d) None of the above

4) What would be the output of the following program?
main()
{
int i=4;
switch(i)
{
default:
printf("
A mouse is an elephant built by the Japanese");
case 1:
printf(" Breeding rabbits is a hair raising experience");
break;
case 2:
printf("
Friction is a drag");
break;
case 3:
printf("
If practice make perfect, then nobody's perfect");
}
}
a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a hare raising experience c) All of the
above d) None of the above

5) What is the output of the following program?
#define SQR(x) (x*x)
main()
{
int a,b=3;
a= SQR(b+2);
printf("%d",a);
}
a) 25 b) 11 c) error d) garbage value

6) In which line of the following, an error would be reported?
1. #define CIRCUM(R) (3.14*R*R);
2. main()
3. {
4. float r=1.0,c;
5. c= CIRCUM(r);
6. printf("
%f",c);
7. if(CIRCUM(r))==6.28)
8. printf("
Gobbledygook");
9. }
a) line 1 b) line 5 c) line 6 d) line 7

7) What is the type of the variable b in the following declaration?
#define FLOATPTR float*
FLOATPTR a,b;
a) float b) float pointer c) int d) int pointer

8) In the following code;
#include<stdio.h>
main()
{
FILE *fp;
fp= fopen("trial","r");
}
fp points to:
a) The first character in the file. b) A structure which contains a "char" pointer which points to the first character in
the file. c) The name of the file. d) None of the above.

9) We should not read after a write to a file without an intervening call to fflush(), fseek() or rewind() < TRUE/FALSE>
Ans. True

10) If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output?
main(int argc, char *argv[])
{
int i;
for(i=0;i<argc;i++)
printf("%s",argv[i]);
}
a) 1 2 3 b) C:MYPROG.EXE 1 2 3 c) MYP d) None of the above

11) If the following program (myprog) is run from the command line as myprog 1 2 3, What would be the output?
main(int argc, char *argv[])
{
int i,j=0;
for(i=0;i<argc;i++)
j=j+ atoi(argv[i]);
printf("%d",j);
}
a) 1 2 3 b) 6 c) error d) "123"

12) If the following program (myprog) is run from the command line as myprog monday tuesday wednesday thursday,
What would be the output?
main(int argc, char *argv[])
{
while(--argc >0)
printf("%s",*++argv);
}
a) myprog monday tuesday wednesday thursday b) monday tuesday wednesday thursday c) myprog tuesday
thursday d) None of the above

13) In the following code, is p2 an integer or an integer pointer?
typedef int* ptr
ptr p1,p2;
Ans. Integer pointer

14) Point out the error in the following program
main()
{
const int x;
x=128;
printf("%d",x);
}
Ans. x should have been initialized where it is declared.

15) What would be the output of the following program?
main()
{
int y=128;
const int x=y;
printf("%d",x);
}
a) 128 b) Garbage value c) Error d) 0

16) What is the difference between the following declarations?
const char *s;
char const *s;
Ans. No difference

17) What would be the output of the following program?
main()
{
char near * near *ptr1;
char near * far *ptr2;
char near * huge *ptr3;
printf("%d %d %d",sizeof(ptr1),sizeof(ptr2),sizeof(ptr3));
}
a) 1 1 1 b) 1 2 4 c) 2 4 4 d) 4 4 4

18) If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be
the output?
main(int argc, char*argv[])
{
printf("%c",**++argv);
}
a) m b) f c) myprog d) friday

19) If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be
the output?
main(int argc, char *argv[])
{
printf("%c",*++argv[1]);
}
a) r b) f c) m d) y

20) If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be
the output?
main(int argc, char *argv[])
{
while(sizeofargv)
printf("%s",argv[--sizeofargv]);
}
a) myprog friday tuesday sunday b) myprog friday tuesday c) sunday tuesday friday myprog d) sunday tuesday
friday

21) Point out the error in the following program
main()
{
int a=10;
void f();
a=f();
printf("
%d",a);
}
void f()
{
printf("
Hi");
}
Ans. The program is trying to collect the value of a "void" function into an integer variable.

22) In the following program how would you print 50 using p?
main()
{
int a[]={10, 20, 30, 40, 50};
char *p;
p= (char*) a;
}
Ans. printf("
%d",*((int*)p+4));

23) Would the following program compile?
main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("
%u%u",j,k);
}
a) Yes b) No, the format is incorrect
c) No, the arithmetic operation is not permitted on void pointers
d) No, the arithmetic operation is not permitted on pointers

24) According to ANSI specifications which is the correct way of declaring main() when it receives command line
arguments?
a) main(int argc, char *argv[]) b) main(argc,argv) int argc; char *argv[];
c) main() {int argc; char *argv[]; } d) None of the above

25) What error would the following function give on compilation?
f(int a, int b)
{
int a;
a=20;
return a;
}
a) missing parenthesis in the return statement b) The function should be declared as int f(int a, int b) c)
redeclaration of a d) None of the above

26) Point out the error in the following program
main()
{
const char *fun();
*fun()='A';
}
const char *fun()
{
return "Hello";
}
Ans. fun() returns to a "const char" pointer which cannot be modified

27) What would be the output of the following program?
main()
{
const int x=5;
int *ptrx;
ptrx=&x;
*ptrx=10;
printf("%d",x);
}
a) 5 b) 10 c) Error d) Garbage value

28) A switch statement cannot include
a) constants as arguments b) constant expression as arguments c) string as an argument d) None of the
above

29) How long the following program will run?
main()
{
printf("
Sonata Software");
main();
}
a) infinite loop b) until the stack overflows c) All of the above d) None of the above

30) On combining the following statements, you will get char*p; p=malloc(100);
a) char *p= malloc(100) b) p= (char*)malloc(100)
c) All of the above d) None of the above

31) What is the output of the following program?
main()
{
int n=5;
printf("
n=%*d",n,n);
}
a) n=5 b) n=5 c) n= 5 d) error

Hi Friends

SONATA:

1st round was aptitude: 50 q in 12 minutes, elimination round.
Selected 10 out of around 30 ppl

2nd Round was 30 q 30 min. ..choice of paper bw C, C++, Oracle..

And guess what..ALL 30 C Questions were from TEST YOUR C SKILLS!!

Today (Monday), 18th August I recieved a call at 3:50 to be at their Basavangudi Office at 5:00 for GD..Dashed
there/...!!!

GD was ok with batch of 10
then there was an english grammar paper..ok..They said ythey'll inform further by tomorrow,. If selected!

SONATA PLACEMENT PAPER (TECHNICAL)
Rated : +4 , -0

PAPER: SONATA PLACEMENT PAPER (TECHNICAL)

1. Full form of TTL and CMOS

2. Which is a good conductor (Extrinsic or Intrinsic)

3. What are the different types of capacitors (Electrolytic, dielectric...etc)

4. Select a passive component from the following (four choices were there)

5. Minimum no. of lines required for communication using RS232 (Ans:i think its 2)

6. To convert 1's complement to 2's complement and vice versa

7. During which time we use 'size of' command. (ans: runtime)

8. Out of four choice we have to identify which is a macro.

9. There was one pointer _expression related question.

10. To find post fix _expression.

11. What type of operating system is unix (ans: pre-emptive,[not sure])

a)pre-emptive b)non-preemptive c)batch

12. Defnition of turing machine.

13. Where we use DFD(Data flow design)

a)structural languages b)object oriented languages c)UML d)all of the above

14. Name the error which occurs when we write on a page

a) segment fault b)permission fault c) page fault

15. A question based on the representation of an array in C. An array whose elements are fn pointers which returns a
character

16. Point out error, if any, in the following program

main()
{ int i=1; switch(i)
{ case 1: printf("
Radioactive cats have 18 half-lives");
break;
case 1*2+4:
printf("
Bottle for rent -inquire within"); break; }
Ans. No error. Constant expression like 1*2+4 are acceptable in cases of a switch.

17. Point out the error, if any, in the following program main()

{ int a=10,b; a>= 5 ? b=100 : b=200; printf("
%d",b); }

Ans. lvalue required in function main(). The second assignment should be

written in parenthesis as
follows:

a>= 5 ? b=100 : (b=200);

18. In the following code, in which order the functions would be called?
a= f1(23,14)*f2(12/4)+f3();
a) f1, f2, f3 b) f3, f2, f1
c) The order may vary from compiler to compiler d) None of the above

19. What would be the output of the following program?
main()
{ int i=4; switch(i)
{ default:
printf("
A mouse is an elephant built by the Japanese");
case 1:
printf(" Breeding rabbits is a hair raising experience");
break;
case 2:
printf("
Friction is a drag");
break;
case 3:
printf("
If practice make perfect, then nobody's perfect"); }
a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a
hare raising experience
c) All of the above d) None of the above

20. What is the output of the following program?
#define SQR(x) (x*x)
main()
{ int a,b=3; a= SQR(b+2); printf("%d",a); }

a) 25 b) 11 c) error d) garbage value

21. In which line of the following, an error would be reported?

1. #define CIRCUM(R) (3.14*R*R);
2. main()
3. {
4. float r=1.0,c;
5. c= CIRCUM(r);
6. printf("
%f",c);
7. if(CIRCUM(r))==6.28)
8. printf("
Gobbledygook");
9. }
a) line 1 b) line 5 c) line 6 d) line 7

22. What is the type of the variable b in the following declaration?

#define FLOATPTR float*

FLOATPTR a,b;

a) float b) float pointer c) int d) int pointer

23. In the following code;

#include

main()

{ FILE *fp; fp= fopen("trial","r"); }

fp points to:

a) The first character in the file.

b) A structure which contains a "char" pointer which points to the first

character in the file.

c) The name of the file. d) None of the above.

24. We should not read after a write to a file without an intervening call

to fflush(), fseek() or rewind()

< TRUE/FALSE>

Ans. True

25. If the program (myprog) is run from the command line as myprog 1 2 3 ,

What would be the output

SONATA CAMPUS PLACEMENT PAPER (APTITUDE)
Rated : +11 , -5

PAPER: SONATA CAMPUS PLACEMENT PAPER (APTITUDE)

1. Y catches 5 times more fishes than X. If total number of fishes caught by X and Y is 48, then number of fishes
caught by X?

Ans: 8

2. Y catches 5 times more fishes than X. If total number of fishes caught by X and Y is 42, then number of fishes
caught by X?

Ans: 7

3. If a train covers 600m in 0.5 seconds, how long it will cover in 10 seconds?

Ans: 3000m = 3km

4. The girl's age is twice that of boy, if the boy is four years old. After four years the age

of the girl is

Ans: 12 years

5. Sister's age is twice than that of the brother. If the brother's age is six, what is the sister's age after two years?

Ans: 14 Yrs.

6. Two lemons cost 10 cents. Then one and a half dozen cost

Ans: 90 cents

7. A clock is late by 1 minute 27 seconds in a month. Then how much will it be late in 1 day?

Ans: 2.9 seconds

8. Which of the following figures together will make a triangle?

Ans: a,b,c,d

9. Make a square by drawing only one line

Ans: line 2-5, square 2-3-4-5-2

10. Which of the following is the odd one? crew, constellation, companion, league, participants.

Ans: companion

11. Opposite of Remote?

(a) Far (b) Near (c) Huge (d) Village

12. Statement A: All great men are ridiculous;

Statement B: I am ridiculous ;

Inference : I am a great man;

(a) True (b) False (c) Not clear

13. Statement: Normal children are active;

Inference: All children are active;

(a) True (b) False (c) Uncertain

14. Next number in the series 1, 1/2, 1/4, 1/8 ?

Ans: 1/16

15. In 6 seconds a light flashes once. In one hour how many times it will flash?

Ans: 601 times

16. At 20% discount, a cycle is sold at a selling price of 2500 Rs. What is the actual price?

Ans: Rs. 3125

17. Statement A: A & B have same age;

Statement B: B is younger than C;

Inference : A is younger than C;

(a) True (b) False (c) Uncertain

18. All chickens lay eggs (True/False)

Ans: False

19. A invests $12000, B invests $8000, C invests $6000 and they got a profit of $1200. How much share A got more
than B and C?

Ans: 2/13 and 3/13

SONATA PLACEMENT PAPER (APTITUDE)
Rated : +11 , -5

PAPER: SONATA PLACEMENT PAPER (APTITUDE)

1. Last month of an year

(a) January (b) February (c) December (d) November

2. Select the odd one

(a) January (b) February (c) Wednesday (d) November

3. Select the antonym of capture from the following

(a) attack (b) Release (c) condemn (d) None of the above

4. Find the antonym of autumn

(a) Spring (b) Winter (c) Summer (d) None of the above

5. One skirt requires 3.75 yards of cloth. How many skirts you can make from 45 yards?

Ans: 12 skirts

6. How can you make a square from two triangles?

7. Is the meaning of Client and Customer,

(a) same (b) contradictory (c) no relation

8. Is the meaning of It's and Its,

(a) same (b) contradictory (c) no relation

9. Is the meaning of Canvas and Canvass,

(a) same (b) contradictory (c) no relation

10. Is the meaning of Ingenious and Ingenuous,

(a) same (b) contradictory (c) no relation

11. Is the meaning of Credible and Credulous,

(a) same (b) contradictory (c) no relation

12. Select the odd one out.

(a) 1/4 (b) 1/3 (c) 1/6 (d) 1/18

13. Select the least from the following.

(a) 0.99 (b) 1 (c) 81 (d) 0.333

14. Find the next number in the series. 1, 0.5, 0.25, 0.125

Ans: 0.0625

15. One dollar is saved in one month. Then how much dollar is saved in one day?

Ans: 1/30 =0.0333$

SONATA PLACEMENT PAPER ( TECHNICAL- C & C++)
Rated : +2 , -2

PAPER: SONATA PLACEMENT PAPER ( TECHNICAL- C & C++)

1. Point out error, if any, in the following program

main()
{
int i=1;
switch(i)
{
case 1:
printf("
Radioactive cats have 18 half-lives");
break;
case 1*2+4:
printf("
Bottle for rent -inquire within");
break;
}
}
Ans. No error. Constant expression like 1*2+4 are acceptable in cases of a switch.

2. Point out the error, if any, in the following program

main()
{
int a=10,b;
a>= 5 ? b=100 : b=200;
printf("
%d",b);
}
Ans. lvalue required in function main(). The second assignment should be written in parenthesis as follows:
a>= 5 ? b=100 : (b=200);

3. In the following code, in which order the functions would be called?

a= f1(23,14)*f2(12/4)+f3();
a) f1, f2, f3 b) f3, f2, f1
c) The order may vary from compiler to compiler d) None of the above

4. What would be the output of the following program?

main()
{
int i=4;
switch(i)
{
default:
printf("
A mouse is an elephant built by the Japanese");
case 1:
printf(" Breeding rabbits is a hair raising experience");
break;
case 2:
printf("
Friction is a drag");
break;
case 3:
printf("
If practice make perfect, then nobody's perfect");
}
}
a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a hare raising experience
c) All of the above d) None of the above

5. What is the output of the following program?

#define SQR(x) (x*x)
main()
{
int a,b=3;
a= SQR(b+2);
printf("%d",a);
}
a) 25 b) 11 c) error d) garbage value

6. In which line of the following, an error would be reported?
1. #define CIRCUM(R) (3.14*R*R);
2. main()
3. {
4. float r=1.0,c;
5. c= CIRCUM(r);
6. printf("
%f",c);
7. if(CIRCUM(r))==6.28)
8. printf("
Gobbledygook");
9. }
a) line 1 b) line 5 c) line 6 d) line 7

7. What is the type of the variable b in the following declaration?

#define FLOATPTR float*
FLOATPTR a,b;
a) float b) float pointer c) int d) int pointer

8. In the following code;
#include<stdio.h>
main()
{
FILE *fp;
fp= fopen("trial","r");
}
fp points to:
a) The first character in the file.
b) A structure which contains a "char" pointer which points to the first character in the file.
c) The name of the file. d) None of the above.

9. We should not read after a write to a file without an intervening call to fflush(), fseek() or rewind() < TRUE/FALSE>
Ans. True

10. If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output?

main(int argc, char *argv[])
{
int i;
for(i=0;i<argc;i++)
printf("%s",argv[i]);
}
a) 1 2 3 b) C:MYPROG.EXE 1 2 3
c) MYP d) None of the above

11. If the following program (myprog) is run from the command line as myprog 1 2 3, What would be the output?

main(int argc, char *argv[])
{
int i,j=0;
for(i=0;i<argc;i++)
j=j+ atoi(argv[i]);
printf("%d",j);
}
a) 1 2 3 b) 6 c) error d) "123"

12. If the following program (myprog) is run from the command line as myprog monday tuesday wednesday
thursday? What would be the output?

main(int argc, char *argv[])
{
while(--argc >0)
printf("%s",*++argv);
}
a) myprog monday tuesday wednesday thursday b) monday tuesday wednesday thursday
c) myprog tuesday thursday d) None of the above

13. In the following code, is p2 an integer or an integer pointer?

typedef int* ptr
ptr p1,p2;
Ans. Integer pointer

14. Point out the error in the following program

main()
{
const int x;
x=128;
printf("%d",x);
}
Ans. x should have been initialized where it is declared.

15. What would be the output of the following program?

main()
{
int y=128;
const int x=y;
printf("%d",x);
}
a) 128 b) Garbage value c) Error d) 0

16. What is the difference between the following declarations?

const char *s;
char const *s;
Ans. No difference

17. What would be the output of the following program?

main()
{
char near * near *ptr1;
char near * far *ptr2;
char near * huge *ptr3;
printf("%d %d %d",sizeof(ptr1),sizeof(ptr2),sizeof(ptr3));
}
a) 1 1 1 b) 1 2 4 c) 2 4 4 d) 4 4 4

18. If the following program (myprog) is run from the command line as myprog friday tuesday sunday? What would be
the output?

main(int argc, char*argv[])
{
printf("%c",**++argv);
}
a) m b) f c) myprog d) friday

19. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be
the output?

main(int argc, char *argv[])
{
printf("%c",*++argv[1]);
}
a) r b) f c) m d) y

20. If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be
the output?

main(int argc, char *argv[])
{
while(sizeofargv)
printf("%s",argv[--sizeofargv]);
}
a) myprog friday tuesday sunday b) myprog friday tuesday
c) sunday tuesday friday myprog d) sunday tuesday friday

21.Point out the error in the following program

main()
{
int a=10;
void f();
a=f();
printf("
%d",a);
}
void f()
{
printf("
Hi");
}
Ans. The program is trying to collect the value of a "void" function into an integer variable.

22. In the following program how would you print 50 using p?

main()
{
int a[]={10, 20, 30, 40, 50};
char *p;
p= (char*) a;
}
Ans. printf("
%d",*((int*)p+4));

23. Would the following program compile?

main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("
%u%u",j,k);
}
a) Yes b) No, the format is incorrect
c) No, the arithmetic operation is not permitted on void pointers
d) No, the arithmetic operation is not permitted on pointers

24. According to ANSI specifications which is the correct way of declaring main() when it receives command line
arguments?

a) main(int argc, char *argv[]) b) main(argc,argv) int argc; char *argv[];
c) main() {int argc; char *argv[]; } d) None of the above

25. What error would the following function give on compilation?

f(int a, int b)
{
int a;
a=20;
return a;
}
a) missing parenthesis in the return statement b) The function should be declared as int f(int a, int b)
c) redeclaration of a d) None of the above

26. Point out the error in the following program

main()
{
const char *fun();
*fun()='A';
}
const char *fun()
{
return "Hello";
}
Ans. fun() returns to a "const char" pointer which cannot be modified

27. What would be the output of the following program?

main()
{
const int x=5;
int *ptrx;
ptrx=&x;
*ptrx=10;
printf("%d",x);
}
a) 5 b) 10 c) Error d) Garbage value

28. A switch statement cannot include

a) constants as arguments b) constant expression as arguments
c) string as an argument d) None of the above

29. How long the following program will run?

main()
{
printf("
Sonata Software");
main();
}
a) infinite loop b) until the stack overflows
c) All of the above d) None of the above

30. On combining the following statements, you will get char*p; p=malloc(100);

a) char *p= malloc(100) b) p= (char*)malloc(100)
c) All of the above d) None of the above

31. What is the output of the following program?

main()
{
int n=5;
printf("
n=%*d",n,n);
}
a) n=5 b) n=5 c) n= 5 d) error

Potrebbero piacerti anche