Hi quest ,  welcome  |  sign in  |  registered now  |  need help ?

Advanced UNIX Interview Questions and Answers

Written By RAM on Tuesday, May 31, 2011 | 9:54 AM


1. How do you find which processes are using a particular file?
By using lsof command in UNIX. It wills list down PID of all the process which is using a particular file.

2. How do you find which remote hosts are connecting to your host on a particular port say 10123?
By using netstat command execute netstat -a | grep "port" and it will list the entire host which is connected to this host on port 10123.

3. What is nohup in UNIX?

4. What is ephemeral port in UNIX?
Ephemeral ports are port used by Operating system for client sockets. There is a specific range on which OS can open any port specified by ephemeral port range.

5. If one process is inserting data into your MySQL database? How will you check how many rows inserted into every second?
Purpose of this Unix Command Interview is asking about "watch" command in UNIX which is repeatedly execute command provided with specified delay.

6. There is a file Unix_Test.txt which contains words Unix, how will you replace all Unix to UNIX?
You can answer this Unix Command Interview question by using SED command in UNIX for example you can execute sed s/Unix/UNIX/g fileName.

7. You have a tab separated file which contains Name, Address and Phone Number, list down all Phone Number without there name and Addresses?
To answer this Unix Command Interview question you can either you AWK or CUT command here. CUT use tab as default separator so you can use
cut -f3 filename.

8. Your application home directory is full? How will you find which directory is taking how much space?
By using disk usage (DU) command in Unix for example du –sh . | grep G  will list down all the directory which has GIGS in Size.

9. How do you find for how many days your Server is up?
By using uptime command in UNIX

10. You have an IP address in your network how will you find hostname and vice versa?
This is a standard UNIX command interview question asked by everybody and I guess everybody knows its answer as well.
By using nslookup command in UNIX, you can read more about networking command in UNIX here
9:54 AM | 0 comments

Intermediate UNIX Interview Questions Answers


1. What is difference between ps -ef and ps -auxwww?
This is indeed a good Unix Interview Command Question and I have faced this issue while ago where one culprit process was not visible by execute ps –ef command and we are wondering which process is holding the file.
ps -ef will omit process with very long command line while ps -auxwww will list those process as well.

2. How do you find how many cpu are in your system and there details?
By looking into file /etc/cpuinfo for example you can use below command:
cat /proc/cpuinfo

3. What is difference between HardLink and SoftLink in UNIX?
I have discussed this Unix Command Interview questions  in my blog post difference between Soft link and Hard link in Unix

4. What is Zombie process in UNIX? How do you find Zombie process in UNIX?
When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls 'wait()'; In the interval between the child terminating and the parent calling 'wait()', the child is said to be a 'zombie' (If you do 'ps', the child will have a 'Z' in its status field to indicate this.)
Zombie : The process is dead but have not been removed from the process table.

5. What is "chmod" command? What do you understand by this line “r-- -w- --x?

6. There is a file some where in your system which contains word "UnixCommandInterviewQuestions” How will find that file in Unix?
By using find command in UNIX for details see here 10 example of using find command in Unix

7. In a file word UNIX is appearing many times? How will you count number?
grep -c "Unix" filename

8. How do you set environment variable which will be accessible form sub shell?
By using export   for example export count=1 will be available on all sub shell.

9. How do you check if a particular process is listening on a particular port on remote host?
By using telnet command for example “telnet hostname port”, if it able to successfully connect then some process is listening on that port. To read more about telnet read networking command in UNIX

10. How do you find whether your system is 32 bit or 64 bit ?
Either by using "uname -a" command or by using "arch" command.
9:53 AM | 1 comments

Beginners UNIX Interview Questions Answers


1. Write command to list all the links from a directory?
In this UNIX command interview questions interviewer is generally checking whether user knows basic use of "ls" "grep" and regular expression etc
You can write command like:
ls -lrt | grep "^l"


2. Create a read-only file in your home directory?
This is a simple UNIX command interview questions where you need to create a file and change its parameter to read-only by using chmod command you can also change your umask to create read only file.
touch file
chmod 400 file

3. How will you find which operating system your system is running on in UNIX?
By using command "uname -a" in UNIX

4. How will you run a process in background? How will you bring that into foreground and how will you kill that process?
For running a process in background use "&" in command line. For bringing it back in foreground use command "fg jobid" and for getting job id you use command "jobs", for killing that process find PID and use kill -9 PID command. This is indeed a good Unix Command interview questions because many of programmer not familiar with background process in UNIX.

5. How do you know if a remote host is alive or not?
You can check these by using either ping or telnet command in UNIX. This question is most asked in various Unix command Interview because its most basic networking test anybody wants to do it.

6. How do you see command line history in UNIX?
Very useful indeed, use history command along with grep to find any relevant command you have already executed. Purpose of this Unix Command Interview Questions is probably to check how familiar candidate is from available tools in UNIX operation system.

7. How do you copy file from one host to other?
Many options but you can say by using "scp" command. You can also use rsync command to answer this UNIX interview question or even sftp would be ok.

8. How do you find which process is taking how much CPU?
By using "top" command in UNIX, there could be multiple follow-up UNIX command interview questions based upon response of this because “TOP” command has various interactive options to sort result based upon various parameter.

9. How do you check how much space left in current drive ?
By using "df" command in UNIX. For example "df -h ." will list how full your current drive is. This is part of anyone day to day activity so I think this Unix Interview question will be to check anyone who claims to working in UNIX but not really working on it.

10. What is the difference between Swapping and Paging?
Swapping:
Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems.
Paging:
Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory. It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly.
9:52 AM | 0 comments

INFOSYS INTERVIEW PUZZLES WITH ANSWERS


INFOSYS INTERVIEW PUZZLES WITH ANSWERS

 I HAVE COLLECTED THESE QUESTIONS AND ANSWERS FROM THE MAILS IN THE GROUP ONLY. FOR 3-4 QUESTIONS ONLY I HAVE FOUND THE ANSWER WITH THE HELP OF MY TEACHERS. SO KEEP IN MIND THAT THESE ANSWERS MAY NOT BE 100% CORRECT. TRY TO SOLVE IT YOURSELF.

1. You are given two candles of equal size, which can burn 1 hour each. You have to measure 90 minutes with these candles. (There is no scale or clock). Also u r given a lighter.

Ans: 1. First light up the two ends of the 1st candle. When it will burn out light up one end of the second candle.   (30+60=90)


2. Try the similar problem to measure 45 minutes.

Ans: First light-up the two ends of the 1st candle and one end of the 2nd candle.
When the 1st candle will burn out ,then light up the both ends of the 2nd  candle (15+30=45)

3. You r given a thermometer. What can u do by this without measuring the temperature?

Ans: if u put thermometer into a tree it won't grow anymore, will just die off

4. How it is possible to place four points that are equidistance from each other?
OR
U r a landscape designer and your boss asked u to design a landscape such that you should place 4 trees equidistance from each other.
(Distance from each tree to the other must be same)

Ans: Only 3 points can be equidistant from each other. But if u place points in the shape of a pyramid then its possible

5. You are given a cake; one of its corner is broken. How will u cut the rest into Two equal parts?

Ans: Slice the cake


6. How will you recognize the magnet & magnetic material & non-magnetic material?

Ans: Drag one piece of material over another. There is no attractive force in the middle portion of the magnet. OR
Get a piece of thread and tie up with the one bar and check for poles. If it iron bar then it moves freely and if it is magnetic bar then it fix in one direction according to poles.


7. If one tyre of a car suddenly gets stolen.... and after sometime u find the tyre
without the screws how will u make ur journey complete?

 Ans: Open 3 screws, 1 from each tyre and fix the tyre.


8. How can u measure a room height using a thermometer?

Ans: temp varies with height. but its dependent on various other factors like
humidity, wind etc.


9. What is the height of room if after entering the room with a watch ur head
strikes a hanging bulb?

Ans: Oscillate the hanging bulb. Calculate the time period for one complete
oscillation by Simple Harmonic Motion (SHM) of the handing bulb. Put it in the
formula T=2 * 3.14 * (L/G)^1/2
L will be the length of the hanging thread.
Add the L with ur height to get the height of the room.
OR

Ans: Drop it from the room and find the time at which it strikes the floor. Using physics formula  s = (at^2)/2 (IM NOT SURE ABOUT THIS ONE)



10. Color of bear.... if it falls from 1m height in 1s.

 Ans: We get 'g' perfect 10 which is only in poles...hence polar bear...color White


11. How will you measure height of building when you are at the top of the building? And if you have stone with you.

Ans: Drop the stone and find the time taken for the stone to reach the ground. find height using the formula
s = a + gt ( s = height, a= initial velocity=0, g=9.8m/s, t = time taken)



12. How wud u catch and receive a ball in same direction? (Dropping is from north And receiving from bottom not accepted, as it is 2 directions)

Ans: ?



13. 25 statements given. Some tell truth, some false and some alternators. Find out the true statements.

Ans: ?



14. Can u make 120 with 5 zeros?

Ans: Factorial (factorial (0)+factorial (0)+factorial (0)+factorial (0)+factorial (0)) = 120



15.There are three people A, B, C. Liars are of same type and Truth speaking people are of same type. Find out who is speaking truth and who is speaking false from the following statements:
a)       A says: B is a liar.
b)       B says: A and C are of same type.

Ans: lets assume A is speaking truth. It means B is a liar then it means A and C are not of same type.


16.5 swimmers A, B, C, E, F and many conditions of their positions like there are Two b/w A & F, B doesn't win etc the question was to find who was b/w like E & D?

 Ans: ?



17. in a race u drove 1st lap with 40kmph and in the second lap at what speed u must drive so that ur average speed must be 80kmph.

 Ans: its impossible! if u drove the first lap in 40 kmph, its impossible that the
average speed of both the laps is 80kmph.
for eg. consider one lap distance = 80km.
time req. to cover 1 lap = 80km/40kmph = 2 hrs.

 if the avg. speed is 80kmph, then the total time would have taken = 160kms/80kmph = 2 hrs.
same is the case with any other distance u consider. so the avg to be 80kmph is impossible


18. You have to draw 3 concentric circles with a line passing thru their center without lifting hand.

Ans: Start the line complete one circle move inside circles along the line and then draw second circle. Like wise rest.


19. A rectangular paper is there. At a corner a rectangular size paper is taken from it. Now you have to cut the remaining paper into two equal halves.

Ans: try it on the paper. You must fold the part that has complete paper and select Half of it and then fold the part that cut and selects half of it and then cut along the folding. (I DONT UNDERSTAND THIS ONE!!)


20. Value of (x-a)(x-b). . . . (x-z)

Ans: 0 as there's X-X term


21. There are 9 coins. 8 are of 1 gm and 1 is of 2 grams. How will you find out the heavier coin in minimum number of weighing and how many weighing it will need?
Ans: 2 weighing ( Divide the number of coins into 3 parts at each weighing)

9:48 AM | 1 comments

Typical interview questions about stress situation


Typical interview questions
While you cannot pre-empt all the questions you will be asked in a job interview, there are a number of areas which you are likely to be asked about.
Being interviewed you get a chance to prove yourself. That is why it is necessary to be well prepared. Preparation increases your chances of being selected.

I. Typical interview questions about stress situation

1. Which transaction is not good for your colleagues whom also faced the stress at the same time?
2. How do you handle stress? What is the best thin or work you do when you are stressed
3. Okay, if that’s the best answer you can give me. Then what about this question…?
4. What kinds of people do you find it difficult to work with?
5. What are some of the things that you find difficult to do?
6. Do you consider standing in a line as stressed work?
7. I don’t really feel like your answering the question. Could you please clarify / could you please start again?”
8. How do you handle rejection?
9. Why do you think it will conduce stress?
10. What is the worst thing when you faced with stress?
11. Why did you switch to political science? Is it because you couldn’t handle engineering? Why did you do so poorly on this test?
12. What is the worst thing that you have heard about our company?
13. Why are manhole covers round?
14. Define stress and when do you get stressed out?
15. Are you able to work under stress?
16. Please give us an example about you work with a team that faced stress from your experience?
9:46 AM | 0 comments

ACCENTURE PATTERN & INTERVIEW


I got selected in Accenture on 18th December, at JIIT, Noida .

Accenture took a total of 314 students from around 800 who appeared in the written test.

There are a few things to remember about Accenture.

1) Written: Written paper is damm easy and consists mainly of questions that are contributed in this site.
--just after declaring the results for written immediately they start the GD then immediately some form filling work and then the interviews.

2) GD: Accenture people dont eliminate most people in GD just keep your basics right and try to speak in GD thats it.

3) Then comes the tech interview in which questions are from your project and your technical areas of interest.
--Your HR or Tech. interview may come any time (like first HR or first TECh.) as both the interviews are going on simultaneously.

4) At last there is the HR round. My HR round was like this:-
  Q-Tell me about urself (this is the most sureshot question of Accenture)
  Q-how are you ecofriendly.(this question was raised as I told in about myself that I was ecofriendly)
  Q-Why is there a year gap between 12th and B.Tech. (this is also a very common question of accenture as they are very particular about year gap, so prepare it nicely and if the gap is 2 years then prepare even more seriously)
  Q-Why didn you prepare for Engg entrance while in 11 and 12 stds? (this was raised as I told I was preparing for Engg tests)
  Q-Why Accenture? (through this question they mainly want to check if you have seen the PPT seriously or not so don forget noting down main points from PPT)
  Q-Other than Accenture name 3 IT companies.
  Q-Can you go anywhere for workin in Accenture? (This is also a very common question in Accenture and show that you can work anywhere for the company)

So guys and gals this was all about Accenture and my experience about it. Believe in God and yourself too. You will get selected surely.
9:43 AM | 1 comments

INAUTIX INTERVIEW PATTERN


I-Nautix visited our campus SCOE, Pune on 3rd July 2008. Total around 350 students had given aptitude test out of which 100 were selected for GD. Then 50 were selected for interviews and finally 31 were shortlisted including me.

The pattern was as
Aptitude Test (50 marks)
Group Discussion
Interviews

Aptitude Test consists of
Analytical Section-20 Marks (Refer RS Agrawal QA It's enough)
English Section-10 Marks
Technical – 20 Marks

For Technical Refer Let us C, Let us C solutions as most of the problems were from these two books. Also as they told that there is no sectional cut-off. Hence core branch student can appear for first 30 questions.

Analytical

1. If A can fill a tank in 20min and B in 30 min, also C can empty the tank in 15 min then how much time will required to fill the tank completely.
a)176 min     b)167 min   c)165 min    d)none
ans 167

2. The sum of all the family members is 100. If the younger member is of 10 year's age then what will be the average age of the family at the time of his birth.
a)12.5      b)14       c)14.5     d)11.5
ans 12.5

Likewise simple problems on analytical reasoning.

RS Agrawal QA is more than enough for it

English Section was too easy some synonyms and antonyms were there but that's ok. And technical as I mentioned above basic C for Kanetkar's is sufficient

After Aptitude 100 people were selected for GD.

There were 10 groups of 10 persons each. Our batch got topic CO-EDUCATION.

The HR person was very cool and has taken a warm up interactive session before starting the GD.

Just keep your mind cool and take part on GD that's enough too clear it.

Also don't make it as a Debate which will have a treat to the Group.

Finally 53 were selected from GD.

The Other GD topic were
1) LOVE MARRIAGE v/s ARRANGE MARRIAGE
2) CONSIDER your self as a fruit
Etc.

Generally they ask the group for suggesting them a topic, so decide the topic in advance with your group.

Now we were just said to wait as our interview process was to start immediately.

My no. came I went into the room.
As soon as I Entered the HR person introduced himself and then he had given program to solve
I have solved that within 10mins.
After that I explained him the logic.

Then my HR interview started with the basic Questions like
Tell me about yourself, family background, etc.

The HR person was very cool and it was one of simplest interviews to clear.

Finally after waiting for sometime we got the results 31 were finally selected including me. I want to thank god, my parents and all my friends who had helped me around.
9:38 AM | 1 comments

AMAZON PLACEMENT PAPER


Written Test has 2 Sections: A, B.
 
In Section A there were 20 Questions:
Time: 30 min
Small Answer Type
Multiple choice

Aptitude

1. Two tables emp (empid, name, deptid, sal) and dept(deptid, deptname) are there. Write a query which displays empname, corresponding deptname also display those employee names who do not belong to any dept.

2. Display the employees whose salary is less than average salary.

3. What is the output of the program
main()
{
int c=5;
printf("%d\n%d\n%d",c,c<<2,c>> 2);
}

4. main()
{
int a[8][10],c=0,i,j;
 for(i=0;i<10;
i++) for(j=0;
j<8;j++) a[j][i]=c++;
printf("%d",a[3][6]);
}

5.What is the wrong in this program
main()
{
char *p,*q;
p=(char *)malloc(25);
q=(char*) malloc(25);
strcpy(p,"amazon" );
strcpy(q,"hyd");
strcat(p,q);
printf("%s",p);
}

6. Write prefix and post fix notation for (a+b)*c-(d+e)^(f-g)

7. What is the output of the program
main()
{
int i=5;
printf("%d",fun(fun(fun(fun( fun(i))))));
}
void fun (int i)
{ if(i%2) return (i+(7*4)-(5/2)+(2*2));
else return (i+(17/5)-(34/15)+(5/2));
}

8. When it is always true boolean fun
(node *p)
{
return ((p==null)||(p->next==null)|| (p->info<=p->next->info)&&( fun(p->next)));
}
a) when list is empty or has one node
b) when the ele are sorted in non decreasing order
c) when the ele are sorted in non increasing order

9. What is x here (x&&!(x&(x-1))==1)
a) x is always a prime
b) x is a power of 2
c) x is even d)x is odd

10. What is the difference between deep copy and shallow copy

11. In java what is the difference between sleep() and wait().

12. What happens when the parent process of a child process exits before the child ?

13. There are three persons A, B, C. A shots the target 6 times out of 7 shots. B shots 4 out of 5 shots. Then what is the probability of hitting the target twice when 2 persons are selected at random.

14. What is valid in cpp char *cp; const char *cpp; 1) cpp=cp; 2) cp=cpp;

15. Write program to swap 2 variables without using extra memory.

16. Write a shell command to find all Java files present in nested directories.

17. There are 6 pairs of black socks and 6 pairs of white socks. What is the probability to pick a pair of black or white socks when 2 socks are selected randomly in darkness.

18. A string of alphanumeric is there. Find a string that starts with b and ends with 3 characters.

Section B (we have to write programs) time:30 min
1. There is a sorted array which is of very large size. In that all except one no. are repeated once. How to find that non repeated no.
2. There are 2 linked lists. Those 2 lists are meeting at a point. How to find that meeting point.
9:35 AM | 1 comments

Average Word Problems

Written By RAM on Saturday, May 14, 2011 | 1:30 PM


Average Word Problems


There are three main types of average problems commonly encountered in school algebra: Average (Arithmetic Mean), Weighted Average and Average Speed.

Average (Arithmetic Mean)

The average (arithmetic mean) uses the formula:
mean formula
The formula can also be written as
mean formula 2


Example:
The average (arithmetic mean) of a list of 6 numbers is 20. If we remove one of the numbers, the average of the remaining numbers is 15. What is the number that was removed?
Solution:
Step 1: The removed number could be obtained by difference between the sum of original 6 numbers and the sum of remaining 5 numbers i.e.
sum of original 6 numbers – sum of remaining 5 numbers
Step 2: Using the formula
mean formula 2
sum of original 6 numbers = 20 × 6 = 120
sum of remaining 5 numbers = 15 × 5 = 75
Step 3: Using the formula from step 1
Number removed = sum of original 6 numbers – sum of remaining 5 numbers
120 – 75 = 45
Answer: The number removed is 45.


Weighted Average

Another type of average problem involves the weighted average - which is the average of two or more terms that do not all have the same number of members. To find the weighted term, multiply each term by its weighting factor, which is the number of times each term occurs.
The formula for weighted average is:
weighted ave formula
Example:
A class of 25 students took a science test. 10 students had an average (arithmetic mean) score of 80. The other students had an average score of 60. What is the average score of the whole class?
Solution:
Step 1: To get the sum of weighted terms, multiply each average by the number of students that had that average and then sum them up.
80 × 10 + 60 × 15 = 800 + 900 = 1700
Step 2: Total number of terms = Total number of students = 25
Step 3: Using the formula
weighted ave example 1
Answer: The average score of the whole class is 68.
Be careful! You will get the wrong answer if you add the two average scores and divide the answer by two.

1:30 PM | 0 comments

Age Word Problems


Age Word Problems

Age problems are algebra word problems that deal with the ages of people currently, in the past or in the future.
If the problem involves a single person, then it is similar to an Integer Problem. Read the problem carefully to determine the relationship between the numbers. This is shown in the example involving a single person.
If the age problem involves the ages of two or more people then using a table would be a good idea. A table will help you to organize the information and to write the equations. This is shown in the age problems: examples involving more than one person.


Age Problems Involving A Single Person

Example 1:
Five years ago, John’s age was half of the age he will be in 8 years. How old is he now?
Solution:
Step 1: Let x be John’s age now. Look at the question and put the relevant expressions above it.
example 1

Step 2: Write out the equation.
equations step 2
Isolate variable x
equations
Answer: John is now 18 years old.


Age Problems Involving More Than One Person

Example 2:
John is twice as old as his friend Peter. Peter is 5 years older than Alice. In 5 years, John will be three times as old as Alice. How old is Peter now?
Solution:
Step 1: Set up a table.

age now
age in 5 yrs
John


Peter


Alice


Step 2: Fill in the table with information given in the question.
John is twice as old as his friend Peter. Peter is 5 years older than Alice. In 5 years, John will be three times as old as Alice. How old is Peter now?
Let x be Peter’s age now. Add 5 to get the ages in 5 yrs.

age now
age in 5 yrs
John
2x
2+ 5
Peter
x
+ 5
Alice
 5
x – 5 + 5
Write the new relationship in an equation using the ages in 5 yrs.
In 5 years, John will be three times as old as Alice.
2+ 5 = 3(x – 5 + 5)
2x + 5 = 3x
Isolate variable x
x = 5
Answer: Peter is now 5 years old.


Example 3:
John’s father is 5 times older than John and John is twice as old as his sister Alice. In two years time, the sum of their ages will be 58. How old is John now?
Solution:
Step 1: Set up a table.
age now
age in 2 yrs
John’s father


John


Alice


Step 2: Fill in the table with information given in the question.
John’s father is 5 times older than John and John is twice as old as his sister Alice. In two years time, the sum of their ages will be 58. How old is John now?
Let x be John’s age now. Add 2 to get the ages in 2 yrs.
age now
age in 2 yrs
John’s father
5x
5+ 2
John
x
+ 2
Alice
1/2 x
1/2 x + 2
Write the new relationship in an equation using the ages in 2 yrs.
In two years time, the sum of their ages will be 58.
equations 3
Answer: John is now 8 years old.

For More Details: http://www.onlinemathlearning.com/age-problems.html
1:21 PM | 0 comments

Followers

Popular Posts