GeekInterview.com
Answered Questions

Find possible number of combinations

Asked By: sweetysmarty | Asked On: Apr 19th, 2010

There are a, b techers and c,d doctors. Find the possible no. Of combinations that should not be repeated more than once?

Answered by: Abinaya Roshini on: Jan 17th, 2011

24 number of possibilities

Answered by: manishkraasawat on: Jul 7th, 2010

There are 15 possible combination
4C1+ 4C2 + 4C3+ 4C4= 15

One value missed is ACD in the above given 14 combinations.

Program termination

Asked By: sweetysmarty | Asked On: Apr 19th, 2010

If a program is terminated at the middle of execution in UNIX, what will happen to the program?

Answered by: UncaAlby on: May 16th, 2010

Nothing, actually. The OS will halt program execution, retrieve whatever resources the program was using, close whatever files it had open, and go back to doing everything else an OS does. If there is...

Join two csv text files

Asked By: bubgem27 | Asked On: Apr 18th, 2010

Write a shell script to join two csv text files based on value of some columns?

Answered by: abdas on: Jun 26th, 2011

cat file1 file2 >  file3

Answered by: nkumar85 on: May 18th, 2010

Bash does not support this kind of feature, you can do this in PERL, because PERL supports all feature which are needed to work with CSV worksheets.

Stored procedure

Asked By: tallman010 | Asked On: Apr 8th, 2010

Which version of MySQL does not support stored procedure?

Answered by: UncaAlby on: Apr 18th, 2010

Stored procedures were introduced as a new feature in version 5.0.

Calculate and print the amount of money paid to each worker

Asked By: jovan | Asked On: Mar 31st, 2010

A carpenter is paid a contract fee of $2000 for 3 days work. He hires 3 workers who work for 3 days at $75 a day. Calculate and print the amount of money paid to each worker, the total paid to each worker,the total paid to all workers and the amount the carpenter is lEFT with.

Answered by: Abinaya Roshini on: Jan 17th, 2011

The amount paid to each worker is 75 per day, total paid for each worker is 225, total paid for all workers is 675, the money left for carpenter is 1325.

Answered by: levteck on: Sep 13th, 2010

each worker get 3 times $75 for a total of $225 after three days
3 workers were hired so total of all workers would cost  $675
the total contract was $2000 minus total labor cost $675  then $1325 remains to the carpenter.

A company gives out bonuses

Asked By: jovan | Asked On: Mar 31st, 2010

A company gives out bonuses based on the amount of income generated by their sales representatives per month. Once the income generated is greater than or equal to $10,000 a bonus of 20% is given. If the income generated is greater than or equal to $8000 but less than $10,000 a bonus of 15% is given....

Answered by: Abinaya Roshini on: Jan 17th, 2011

For sales representative gaining income above or equal to 10000 the bonus will be 2000 and above,if income range between 8000 to 10000 the bonus will be a range of 1200 to1500,if income equal to or above 5000 the bonus will be 150 and above

Answered by: yuviii on: Apr 24th, 2010

Let x be the income generated.
if x>=10,000 then bonus is 2000Rs therefore the income left is 8,000.
if x>=8,000 and <10,000 then bonus is 1,200Rs therefore the income left is 6,800.
if x>=5000 then bonus is 150Rs therefore the income left is 4,850.

Pipes are laid by an oil company

Asked By: jovan | Asked On: Mar 31st, 2010

Pipes are laid by an oil company. If the company has to lay down 3km of pipes and each pipe is 25 meters long, calculate and print the number of pipes needed to cober the distance

Answered by: Gulshan Chawla on: Feb 27th, 2011

120 pipes

Answered by: gkunarapu on: Feb 21st, 2011

120 pipes

Solaris server backup

Asked By: pradeep chakravarty | Asked On: Mar 4th, 2010

How to take backup from solaris server?

Answered by: vivek on: Dec 17th, 2012

boot -s
fsck /dev/rdks/c1t0d0s0
#ufsdump 0uf /dev/rmt/0 /dev/rdsk/c1t0d0s0
for restore
#ufsrestore /dev/rmt/0 /

Answered by: osmond on: Sep 14th, 2012

The arp command is used to manage entries in the ARP cache. To display the entries in the ARP cache, use the a option,

Migrate file systems

Asked By: pradeep chakravarty | Asked On: Mar 4th, 2010

How to migrate file systems from one server to another server in solaris?

Answered by: UncaAlby on: Apr 20th, 2010

If it's not a bootable file system, it's pretty straightforward.I'm assuming that by "migrate" you mean to completely remove a disk from one machine to put into another.  If...

Solaris patching

Asked By: pradeep chakravarty | Asked On: Mar 4th, 2010

What is patching in solaris?

Answered by: UncaAlby on: Apr 20th, 2010

Patching is the process whereby you repair bugs or add new features in the system.  Sun keeps a repository of patches based on the hardware and release level, and you should review that repositor...

Decommission solaris server

Asked By: pradeep chakravarty | Asked On: Mar 4th, 2010

How to decommission a solaris server?

Answered by: shamithlal on: Jun 22nd, 2010

That was a cool answer to unplug...What if that was a server with NIS/Storage connected.For a decom, you should first check for the active services on the server.something likeps -aef | grep -i ypfor ...

Answered by: UncaAlby on: Apr 20th, 2010

Unplug it.

Database backup

Asked By: srihari_d | Asked On: Mar 2nd, 2010

How will you take database backup when there is no space in file system?

Answered by: luisgranados on: May 20th, 2011

I would dump the database to a removable storage device.

Answered by: rahul20j on: Nov 10th, 2010

Try to take dump on external device...

MotiVATe yourself

Asked By: ajaygoyal27 | Asked On: Feb 1st, 2010

What motiVATes you to put forth your greatest effort? Describe a situation in which you did so.

Answered by: moonshekar on: Jan 9th, 2011

Someone says it can't be done, that when i get motivated to do it at any cost.
You always get a sense of satisfaction that you could complete a task that was considered imposible by someone.
This would always make you confident

Answered by: saritha1406 on: Oct 13th, 2010

Never accept your failure in life.
Everything is possible when we put effort in that.

Srand() and rand() functions

Asked By: shiv29 | Asked On: Jan 18th, 2010

Explain srand() and rand() functions

Answered by: UncaAlby on: Apr 20th, 2010

rand() uses what is known as a "multiplicative congruential" method for generating pseudo-random numbers between 0 and 32767.  (The exact maximum can be system dependent.)It will start ...

Grep

Asked By: nayakss | Asked On: Dec 11th, 2008

How to use logical and in grep?

Answered by: UncaAlby on: Dec 12th, 2008

By logical "and" I presume you mean that you wish to see lines that contain both "expressionOne" AND "expressionTwo".Just pipe the standard output of one "grep"...

Uid and gid

Asked By: super_sixes | Asked On: Sep 26th, 2008

What does uid and gid signify?

Answered by: swetha_0505 on: Oct 26th, 2009

To find a user's UID or GID in Unix, use the id command. To find a specific user's UID, at the Unix prompt, enter: id -u username Replace username with the appropriate user's username. To find ...

Answered by: Vijaymorey on: Apr 28th, 2009

UID - User idGID - Group idWe can find out using sample command fire @ $ promoit "id" you will user id & group id.e. g step 1 : $ id ---> O/p get display immediately uid=232(vi...

Add not null column in a table

Asked By: mamtasahu | Asked On: Sep 5th, 2008

How we can add a notnull column in a table by using alter command (without using default command)?

Answered by: Tejas More on: Jul 7th, 2011

You can add a NOT NULL column to a table. This means that a constant expression, and not a null value, is placed in the column when the column is added. This also ensures that, for all existing rows, ...

Answered by: UncaAlby on: Oct 20th, 2008

First add the column as NULL. Then populate the column with non-null data. Then modify the column to NOT NULL. You may need to set dboption "select into" to True.

Log file information

Asked By: mamtasahu | Asked On: Sep 5th, 2008

How can we get information about log files in the database?

Answered by: UncaAlby on: Nov 3rd, 2008

That is a vendor-specific question.In Sybase, you can get log file information as follows:prompt$ isql1> sp_help {database} 2> goThat will list the devices used by the database, including log de...

What is something you would like to avoid in your job ? Why?

Asked By: deepanker_sumit | Asked On: Jul 19th, 2008

Answered by: nahomteshale on: May 9th, 2011

I would like to avoid micro management and avoid receiving in and out info. The manager should emphasize on the strategic one while the employee may concentrate on how to achieve the ultimate goal with minor guidelines.

Answered by: UncaAlby on: Apr 20th, 2010

I would like to avoid being micro-managed. I know what I'm doing, and I know how to do it. The manager should just tell me what needs to be done, when it's needed, and the constraints. After that, just let me carry the ball and get out of my way.

Rollback command

Asked By: svasu.dwh | Asked On: Apr 10th, 2008

What is rollback command in UNIX?

Answered by: UncaAlby on: Apr 20th, 2010

There is no "rollback" Unix command.The "lost+found" directory has no functionality analogous to the Windows "recycle bin".  This directory is where the "fsck&q...

Answered by: sham2sushil on: Dec 14th, 2009

we don't have any rollback command in unix.

But we have one folder "lost+Find" in the root area.

This is like windows recycle bin. Size of this folder is set by UNIX administrator.

If the os is just a collection PF programs and if it is executed by the processor just like any other program, is the os a process? If so, how is it controlled?

Asked By: Debajyoti Ghosh | Asked On: Nov 25th, 2007

?

Answered by: UncaAlby on: Nov 8th, 2008

Yes, it is executed by the hardware like any other program.  It controls itself.This is why you have the concept of a kernel, which would be the smallest possible piece of the operating system th...

Answered by: sk_seeker on: Dec 22nd, 2007

Execution contexts can be of two types: thread/process context OR an Interrupt context. What this means is that to execute code, one has to be in a thread context or a an Interrupt context. OS code or...

What is the UNIX command to wait for a specified number of seconds before exit

Asked By: arvind_kumarmca | Asked On: Oct 31st, 2007

Answered by: Rohit_Ash on: May 27th, 2009

This is easiest way:

sleep seconds

Answered by: UncaAlby on: Nov 7th, 2008

sleep specified number of seconds
exit

How to delete a word from a file using shell scripting???

Asked By: vinay.prasad | Asked On: Jun 28th, 2007

Answered by: UncaAlby on: Nov 7th, 2008

please note that my original answer ate the quote signs, which I'm going to try to make sure get through this time:sed 's/\<the\>//g'And in case that gets eaten also, it's a reve...

Answered by: UncaAlby on: Nov 7th, 2008

Be careful what you mean by the word, "word"A couple of people have answered with the "sed" command, which is good, but if you're looking for actually removing a "word&quo...

Using bourne shell : if you enter a b C d e f g.......................N after the command,how will you write a programme to reverse these positional parameters?

Asked By: Nehashri | Asked On: Feb 4th, 2007

Answered by: shilpa keesara on: Aug 7th, 2011

Using KSH while loop#!/bin/ksh
#Get the count of total number of arguments passed while executing this script
int i = $#; #total number of arguments passed#
names=$@; #list of actual arguments passed#
while [ ${i} -gt 0 ]
do
echo '${names[i]}';
i=`expr i - 1`;
done
exit 0;

Answered by: abdas on: Jul 26th, 2011

$ cat rev2
i=$#
echo "$@" > file_1

while [ $i -gt 0 ]
do
cut -f $i -d" " file_1 >> file_2
i=`echo $i-1|bc`
done

echo `cat file_2`;
rm -f file_1 file_2;

$ sh rev2 A B C D E
E D C B A

What are the steps to take files from UNIX server to windows?

Asked By: Dipti | Asked On: Jan 10th, 2007

Answered by: abrenar on: Nov 4th, 2009

Most UNIX servers are configured not to use FTP or TELNET for security purposes, and if you use FTP it has limited number of data can be transfered on one transaction hence I preferred using another w...

Answered by: UncaAlby on: Nov 8th, 2008

If you can't get Samba, or you're not the Admin so you can't install it anyway, then use FTP, as it's almost guaranteed to be installed and running on both machines.  The only han...

How do u open a read only file in UNIX?

Asked By: Interview Candidate | Asked On: Jul 5th, 2005

Answered by: Nice Thomas on: Jan 2nd, 2013

Using vi editor. Read only files can be opened without any issues

Answered by: SaintHax on: Oct 4th, 2012

Anything that opens a file, can open a read only file: cat, more, less, awk, pg, et all. The chmod command you put does not make a file read only, it makes it read/write for the user/owner.

What difference between cmp and diff commands?

Asked By: Interview Candidate | Asked On: Mar 6th, 2005

Cmp - compares two files byte by byte and displays the first mismatchdiff - tells the changes to be made to make the files identical

Answered by: UncaAlby on: May 16th, 2010

diff is used primarily for files in text format, for example, source code.  It is used to list all of the differences between two files.It is often used in source code control to get the changes ...

Answered by: wow_suraj on: May 7th, 2008

'cmp' and 'diff' both command are used to list the differences, the difference between both the command is that 'cmp' is used to find the difference between files whereas '...

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: