Dec 25, 2008

J Company's

Anbu:

Section I - Aptitude - 30 mins - 20 questions...

Note: Must read XI & XII maths & R.s.Agrawal's "Quantitative Aptitude"

1) A bag contains 4 red, 5 blue & 3 white balls. 4 balls are chosen at random. What's the probability that 2 r red, 1 blue & 1 white?

(Ans: (4C2 * 5C1 * 3C1)/12C4 )

2) Similar to previous one

3) A bag contains 4 red, 5 blue & 3 white balls. Another bag contains 5 red, 6 blue & 4 white balls. One of the bags is chosen at random & 2 balls r drawn from it. What's the prob. that one of the balls is red & the other white?

4) Problem on Chain rule of R.S.Agrawal...(The nos. r not correct) 3 men can dig a pit 150 m long, 200 m wide, 250 m deep in 12 days working 8 hrs a day. How many hrs a day should 5 men work to dig a pit 300 m wide, 250 m long, 150 m deep in 7 days?

5) Speed of a stream is 1.5 km/hr. It takes twice as long upstream as compared to downstream. Find the speed of the boat in still water.
(Ans: 4.5 km/hr)

6) y= 2^2^x. Find dy/dx.
(Ans. y.2^x.(loge 2)^2 not sure)

7) a.2^a = dy/dx where x=log 256 & y=2^x. Find a.
(Ans. 2. I assumed log was to base 2. So, x=8)

8,9) Problems on Trigonometry... I didn't try them. Just guessed at random.

10) A curve is given by x = at, y = at^3. Find the slope of tangent at t=1.
(Ans. Find dy/dx from dy/dt & dx/dt)

11) A line has x-intercept of 2. It is parallel to line joining (-1,1) & (3,2). Find the equation of the line.

12,13) Problems from Pipes & Cisterns , Time & Work chapters of R.S. Agrawal.



Section 2 - Technical (Fully C) - 30 mins - 20 questions...

Note: Must read Kerningham & Ritchie and Test ur C skills(TUCS).

1) Explanation for a complicated declaration. Refer TUCS.

2) Which of the foll. is not true abt a recursive fn?
(Ans. It can't have a return value)

3) Which of the foll. is not true abt an automatic variable?
(Ans. It is similar to a global variable)

4,5) A recursive fn was defined. O/p for an invocation with a particular value asked... Believe me, it was really very easy...

6) machine.engine.bolt = 5 ; is a valid stt in a C program. Which of the foll. is true?
(Ans. engine is a member of structure machine & bolt is a member of structure engine)

7) union a {
int x; char y;
} a1 = {'A'}, a2={2};
void main() {
printf("%d,%d",a1.x,a2.x);
}
What's the o/p?
(Ans. 65,2 Note that 'A' is treated as int.Check with sizeof('A'). A union can be initialized only by a value of the type of its first member)

8,9) Go through pointers, arrays chapters of TUCS.

10)
void main () {
int x;
fclose(stdout);
x=printf("Hello");
printf("%d",x);
}
What's the o/p?

11) Similar to previous one based on return value of printf & fclose(stdout). Something like...

void main() {
int x;
x=printf("Hello");
fclose(stdout);
x+=printf("%d",x);
printf("%d",x);
}
What's the o/p?

12) Study the action of freopen() fn. A code on the lines of the foll. one was given...

void main() {
char c; FILE *fp;
fclose(stdin);
freopen(__FILE__,...); // Not sure abt the order & type of args.
fp=fopen(__FILE__,"r");
while( c=getc(fp) && ( c=getch()) != EOF ) // Not sure abt EOF
//checking
printf("%c",c);
}

(Ans. I chose the option that said that the pgm prints half the contents of the source file)

13) Study the action of fdopen() fn.

14) A fn for finding compound interest was given. But in it a static variable was initialised to a local variable which will give a compilation error. So, I chose the option "none of the above". If u r sure that the question is wrong, write ur comment in answer sheet by the side of the question no. If shortlisted, ur explanation for the comments will be asked....

Section - 3 - Problem Solving - 20 mins..

Develop an algorithm & appropriate data structure for the foll. problem

Note: the algo may be in C/pseudocode/ English

First file contains a list of words, not necessarily in alphabetical order. Each line has exactly one word & each word has exactly 3 letters. There is no repetition of words (though the letters may be repeated in a word). Contents of a second file r similar in format to that of the first. The words may be scrambled version of those in the first file (Eg. TAC is a scrambled form of CAT). Write a pgm that would o/p (to a third file) for each word in the 2nd file, the words in the 1st file that r scrambled (or proper) form of this word. The qroup of words associated with each word from 2nd file should be in alphabetical order in the o/p.

(My Ans... I suggested array of pointers to char to store words from file. Since searching had to be used frequently, I suggested sorting of the first file by quick sort so that binary search can be employed. Buffer the group of words associated with a word from 2nd file, sort them by quick sort & then o/p to 3rd file.... And think the permutation algo for urself)

Interview.......

Mostly technical..BUt for me it was almost HR....Mention some interesting & different hobbies.(I mentioned analyzing films....I said I liked Maniratnam's films & so I was asked why didn't "Iruvar" do well?)

Technical questions were mostly related to data structures...What data structure to use for dictionary(binary tree or B-tree)....sorting algo with o(n) complexity(Bucket sort)....Graph theory(Prim's & Kruskal's algo)....Definitely u will be asked to write some C fn. I was asked itoa...others atoi, strrev....

All the very Best...

Bye,
Anbu.


Prasanna
Here are a few questions that I had sent to
geethakrishna long back after getting placed. Hope you
find them useful.

One thing that is worth mentioning about my interview
is the first sentence the HR said to me after
entering. "Sorry for the delay. You are here because u
have done well in the written test. We want u to
perform at your best. So please relax and feel
comfortable". I was very surprised by these words and
in fact became more tense. The rest is history.

Bye,
Prasanna Srinivasan V

There were 3 sections.
1. Aptitude - Multiple choice. 20 questions 30
minutes
2. Programming language - Multiple choice 20
questions 30 min
3. Algorithm for a simple problem. 1 question. 20
min

Aptitude.

Questions on differentials. y = a power x. dy/dx = ?
Using this result there were 3 questions.
Questions on trigonometry. like tan x + sec x = 2 cos
x, cos x != 0. solution for x in the range of 0 to 2
pi.
Questions on men and work. Refer A.S Aggarval's
quantitative aptitude.

Overall easy questions only. Shd remember the basics
studied in 11th and 12th.

Programming Language section. Questions mostly on C
and a few C++ questions.
one q based on complex declaration. Refer K & R.
Some based on file operations. like
int main ()
{
int i;

fclose (stderr);
fclose (stdout);
fclose (stdin);
i = printf ("Hello World\n");
}
what is i's value after the execution of this program?
4 choices.

one based on __FILE__. (What shd be known is : The
current file name gets replaced in __FILE__'s place.)

Algorithm section.
Question is close to this.
There are two files. In the first file, some 3 letter
(lower case) english words are there in some order.
Each word in separate line. In the second file, there
are 3 letter (lower case) words are there but need not
be available in english vocabulary. Permutations of
some of the words in first file are available in
second file. Your task is to write an algorithm (in C
or english), for each word in second file, list all
the words that are it's permutations and are available
in first file in lexicographical order in the third
file.
For eg. if "tac" is there in second file, get all its
permutations, check whether they are in first file.
List the matching words in the third file.

Sorry da. I can't remember more.

Interview

Tell us about your self.
Why u r not interested in doing Higher studies in US?
Y not GATE? Be bold and confident in saying no if u
want a job.
Write the prototype of printf fn.
Write a macro to replace printf, u can use printf
while defining it.
What are the differences between macros and functions?
What are the data structures that u have studied?
Given a dictionary, what data structure u would use?
Write a program to search for a given word in ur
representation?
Write a C++ program to print "hello world" without any
statements. ( My friends later told that it shd have
been no stmts in main ())
Can constructors be private members in C++.
He asked me abt my projects.

Some of the questions asked to others are...
What is tail-recursion?
What data-structure is used for any code optimization
method. ( like dead code elimination, etc..)
How to identify a system to be little endian or big
endian?
How to find whether a system follows memory allignment
or not?
One ACM problem.
Simple puzzles.




No comments:

Post a Comment