Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

List The Files In Current Directory Sorted By Size ?

Answer»

- LS -L | GREP ^- | SORT -NR

- ls -l | grep ^- | sort -nr

2.

What Is Stderr() In Perl?

Answer»

SPECIAL FILE handler to standard error in any package.

special file handler to standard error in any package.

3.

What Is The Difference Between For And Foreach?

Answer»

FUNCTIONALLY, there is no DIFFERENCE between them.

functionally, there is no difference between them.

4.

What Is The Difference Between Exec And System?

Answer»

exec RUNS the given process, SWITCHES to its name and never RETURNS while system forks off the given process, WAITS for its to COMPLETE and then return.

exec runs the given process, switches to its name and never returns while system forks off the given process, waits for its to complete and then return.

5.

What Is Cpan?

Answer»

CPAN is COMPREHENSIVE Perl Archive Network. its a repository CONTAINS thousands of Perl Modules, source and documentation, and all under GNU/GPL or SMILAR licence. Some linux distribution provide a TILL names 'cpan'; which you can INSTALL packages directly from cpan.

CPAN is comprehensive Perl Archive Network. its a repository contains thousands of Perl Modules, source and documentation, and all under GNU/GPL or smilar licence. Some linux distribution provide a till names 'cpan'; which you can install packages directly from cpan.

6.

What Does This Symbol Mean '->'?

Answer»

In Perl it is an infix dereference OPERATOR. for array subscript, or a hash key, or a SUBROUTINE, then this must be a reference. can ALSO be USED as METHOD invocation.

In Perl it is an infix dereference operator. for array subscript, or a hash key, or a subroutine, then this must be a reference. can also be used as method invocation.

7.

What Is A Datahash()

Answer»

in Win32::ODBC, DATAHASH() function is used to GET the data FETCHED through the SQL statement in a hash format.

in Win32::ODBC, DataHash() function is used to get the data fetched through the sql statement in a hash format.

8.

What Package You Use To Create A Windows Services?

Answer»

USE WIN32::OLE.

use Win32::OLE.

9.

How To Start Perl In Interactive Mode?

Answer»

PERL -E -d 1 PerlConsole.

perl -e -d 1 PerlConsole.

10.

What Are Scalar Data And Scalar Variables?

Answer»

Perl has a flexible concept of DATA types. Scalar means a single thing, like a NUMBER or STRING. So the Java concept of INT, float, double and string equals to Perl's scalar in concept and the numbers and strings are exchangeable. Scalar variable is a Perl variable that is used to store scalar data. It uses a dollar sign $ and followed by one or more aphanumeric characters or underscores. It is case SENSITIVE.

Perl has a flexible concept of data types. Scalar means a single thing, like a number or string. So the Java concept of int, float, double and string equals to Perl's scalar in concept and the numbers and strings are exchangeable. Scalar variable is a Perl variable that is used to store scalar data. It uses a dollar sign $ and followed by one or more aphanumeric characters or underscores. It is case sensitive.

11.

What Does Perl Do If You Try To Exploit The Execve(2) Race Involving Setuid Scripts?

Answer»

Sends mail to root and exits. It has been SAID that all programs advance to the POINT of being able to automatically read mail. While not quite at that point (WELL, without having a MODULE loaded), Perl does at LEAST automatically send it.

Sends mail to root and exits. It has been said that all programs advance to the point of being able to automatically read mail. While not quite at that point (well, without having a module loaded), Perl does at least automatically send it.

12.

How Do You Print Out The Next Line From A Filehandle With All Its Bytes Reversed?

Answer»

PRINT scalar reverse scalar Surprisingly ENOUGH, you have to put both the reverse and the into scalar CONTEXT separately for this to work.

print scalar reverse scalar Surprisingly enough, you have to put both the reverse and the into scalar context separately for this to work.

13.

What Does Read() Return At End Of File?

Answer»

A DEFINED (but FALSE) 0 VALUE is the proper indication of the end of file for read() and sysread().

A defined (but false) 0 value is the proper indication of the end of file for read() and sysread().

14.

How Do Find The Length Of An Array?

Answer»

$@ARRAY

$@array

15.

What Value Is Returned By A Lone 'return;' Statement?

Answer»

The UNDEFINED value in scalar context, and the empty list value () in list context. This WAY functions that WISH to return failure can just use a simple return without worrying about the context in which they were called.

The undefined value in scalar context, and the empty list value () in list context. This way functions that wish to return failure can just use a simple return without worrying about the context in which they were called.

16.

How To Concatinate Strings In Perl?

Answer»

through . OPERATOR

through . operator

17.

What Is The Tk Module?

Answer»

it PROVIDES a GUI INTERFACE.

it provides a GUI interface.

18.

What Is It Meants By '$_'?

Answer»

it is a DEFAULT variable which holds AUTOMATICALLY, a list of ARGUEMENTS passed to the SUBROUTINE WITHIN parenthesis.

it is a default variable which holds automatically, a list of arguements passed to the subroutine within parenthesis.

19.

What Are The Arguements We Normally Use For Perl Interpreter

Answer»

-e for Execute, -c to compile, -d to call the debugger on the FILE specified, -T for traint MODE for security/input checking -W for SHOW all warning mode (or -w to show LESS warning)

-e for Execute, -c to compile, -d to call the debugger on the file specified, -T for traint mode for security/input checking -W for show all warning mode (or -w to show less warning)

20.

How To Code In Perl To Implement The Tail Function In Unix?

Answer»

You have to maintain a structure to store the LINE number and the size of the file at that time eg. 1-10bytes, 2-18bytes.. you have a COUNTER to increase the number of lines to find out the number of lines in the file. once you are through the file, you will know the size of the file at any nth line, use 'sysseek' to move the file pointer BACK to that position (last 10) and then start READING till the end.

You have to maintain a structure to store the line number and the size of the file at that time eg. 1-10bytes, 2-18bytes.. you have a counter to increase the number of lines to find out the number of lines in the file. once you are through the file, you will know the size of the file at any nth line, use 'sysseek' to move the file pointer back to that position (last 10) and then start reading till the end.

21.

What Is Grep Used For In Perl?

Answer»

Grep is used with regular expression to check if a parituclar VALUE exist in an array. it returns 0 if the value does not exists, 1 OTHERWISE.

Grep is used with regular expression to check if a parituclar value exist in an array. it returns 0 if the value does not exists, 1 otherwise.

22.

What Is Vts?

Answer»

Sun Validation TEST Suite -> TESTS and validates Sun HARDWARE by verifying the configuration and functionality of hardware CONTROLLERS, DEVICES

Sun Validation Test Suite -> tests and validates Sun hardware by verifying the configuration and functionality of hardware controllers, devices

23.

How Do You View Shared Memory Statistics?

Answer»

swap -l -> displays swap usage
prstat -> examines all active PROCESSES on the SYSTEM and reports statistics based
on the selected output mode and sort ORDER
vmstat -> reports information about processes, memory, paging, BLOCK IO, traps,
and cpu activity
PMAP -> lists the virtual memory mappings underlying the given process

swap -l -> displays swap usage
prstat -> examines all active processes on the system and reports statistics based
on the selected output mode and sort order
vmstat -> reports information about processes, memory, paging, block IO, traps,
and cpu activity
pmap -> lists the virtual memory mappings underlying the given process

24.

How To Create A Package?

Answer»

pkgmk -o -R / -d /TMP -F PROTOTYPE

pkgmk -o -r / -d /tmp -f Prototype

25.

What Is Lom

Answer»

Short for LAN on motherboard. The term refers to a chip or chipset capable of NETWORK connections that has been EMBEDDED directly on the motherboard of a desktop, workstation or SERVER. INSTEAD of requiring a separate network INTERFACE card to access a local-area network, such as Ethernet, the circuits are attached to the motherboard. An advantage of a LOM system is an extra available PCI slot that is not being used by the network adapter.

Short for LAN on motherboard. The term refers to a chip or chipset capable of network connections that has been embedded directly on the motherboard of a desktop, workstation or server. Instead of requiring a separate network interface card to access a local-area network, such as Ethernet, the circuits are attached to the motherboard. An advantage of a LOM system is an extra available PCI slot that is not being used by the network adapter.

26.

What Is Jumpstart?

Answer»

The Jumpstart feature is an AUTOMATIC INSTALLATION process available in the Solaris operating environment. It ALLOWS system administrators to CATEGORIZE MACHINES on their network and automatically install systems based on the category to which a system belongs.

The Jumpstart feature is an automatic installation process available in the Solaris operating environment. It allows system administrators to categorize machines on their network and automatically install systems based on the category to which a system belongs.

27.

How Do You Boot From A Network With Jumpstart?

Answer»

BOOT NET - INSTALL

boot net - install

28.

What Is /etc/system For?

Answer»

/etc/system is a KERNAL FILE of SOLARIS OS.

/etc/system is a kernal file of Solaris OS.

29.

How Do You Boot From Cd-rom?

Answer»

BOOTING FORM CD-ROM can be done by the COMMAND
OK >boot cdrom

Booting form CD-ROM can be done by the command
ok >boot cdrom

30.

What Is Obp And How Do You Access It?

Answer»

OBP is called as OPEN Boot PROM. This OBP can be accessiable THRU OK> prompt

OBP is called as Open Boot PROM. This OBP can be accessiable thru ok> prompt

31.

What Does Ndd Do?

Answer»

ndd COMMAND will hardcore the speed of the network INTERFACE card.

ndd command will hardcore the speed of the network interface card.

32.

What Does Init 5 And Init 0 Do?

Answer»

init 5 will SHUTDOWN and Power-off the server.

init 0 will BRING the server to the ok> prompt (Fourth MONITOR)

init 5 will shutdown and Power-off the server.

init 0 will bring the server to the ok> prompt (Fourth monitor)

33.

What Is Rpc? Why Do I Need It?

Answer»

RPC:A call to a procedure in a different ADDRESS SPACE. In a traditional procedure call, the CALLING procedure and the called procedure are in the same address space on one machine. In a REMOTE procedure call, the calling procedure INVOKES a procedure in a different address space and usually on a different machine.

RPC:A call to a procedure in a different address space. In a traditional procedure call, the calling procedure and the called procedure are in the same address space on one machine. In a remote procedure call, the calling procedure invokes a procedure in a different address space and usually on a different machine.

34.

What Is Super?

Answer»

SUPER REFERS to CURRENT PACKAGE ANCESTOR.

Super refers to current package ancestor.

35.

What Does The Word '&myvariable' Mean? What Does The Symbol '&' Means? What's Purpose Of It?

Answer»

&myvariable is CALLING a sub-routine.

& is USED to IDENTIFY a sub-routine.

&myvariable is calling a sub-routine.

& is used to identify a sub-routine.

36.

Perl Regular Expressions Are Greedy" What Does This Mean?

Answer»

Perl REGULAR EXPRESSIONS NORMALLY match the longest string possible. that is what is CALLED as "greedy match"

Perl regular expressions normally match the longest string possible. that is what is called as "greedy match"

37.

Advantages Of C Over Perl?

Answer»

In REALITY PERL INTERPRETER is WRITTEN in C. So what all advantages C have are also possesed by PERL. Otherwise C is faster than PERL, because PERL is an INTERPRETED language.

In reality PERL interpreter is written in C. So what all advantages C have are also possesed by PERL. Otherwise C is faster than PERL, because PERL is an interpreted language.

38.

What Is The Use Of "stderr()"?

Answer»

STDERR:
The SPECIAL FILEHANDLE for STANDARD error in any PACKAGE.

STDERR:
The special filehandle for standard error in any package.

39.

Help In Perl?

Answer»

perldoc -F PRINT

perldoc -f print

40.

How We Can Navigate The Xml Documents?

Answer»

You can use SAX if what you require is SIMPLE accesing of the xml structure. You can go for DOM if you need node handling capabilities like INSERTING a node, MODIFYING a node, deleteing node and stuff like that.

You can use SAX if what you require is simple accesing of the xml structure. You can go for DOM if you need node handling capabilities like inserting a node, modifying a node, deleteing node and stuff like that.

41.

Why Do You Program In Perl?

Answer»

Perl is easy, FAST and its FUN to CODE in perl.
Perl is rich with various packages, N/w PROGRAMMING is very easy and there are lot more ADVANTAGES to say.

Perl is easy, fast and its fun to code in perl.
Perl is rich with various packages, N/w programming is very easy and there are lot more advantages to say.

42.

How To Implement Stack In Perl?

Answer»

Stack is LIFO (Last in First out), In perl that could be inplemented USING the PUSH() and shift() functions. push() adds the ELEMENT at the last of array and shift() REMOVES from the beginning of an array.

Stack is LIFO (Last in First out), In perl that could be inplemented using the push() and shift() functions. push() adds the element at the last of array and shift() removes from the beginning of an array.

43.

What's Your Favorite Module And Why?

Answer»

My FAVOURITE module is CGI.pm Bcoz it can handle almost all the tasks like
1. parsing the FORM input
2. printiing the headers
3. can handle COOKIES and sessions and much more

My Favourite module is CGI.pm Bcoz it can handle almost all the tasks like
1. parsing the form input
2. printiing the headers
3. can handle cookies and sessions and much more

44.

How Do You Open A File For Writing?

Answer»

OPEN FILEHANDLE, ">$FILENAME"

open FILEHANDLE, ">$FILENAME"

45.

How Would You Replace A Char In String And How Do You Store The Number Of Replacements?

Answer»

$str='Hello';
$CNT= ($str=~s/l/i/g);
PRINT $cnt;

$str='Hello';
$cnt= ($str=~s/l/i/g);
print $cnt;

46.

What Is Hash?

Answer»

HASH is an associative array where data is stored in
"key"->"value" pairs.
EG : fruits is a hash having their names and PRICE
%fruits = ("Apple", "60", "Banana", "20", "Peers", "40");

Hash is an associative array where data is stored in
"key"->"value" pairs.
Eg : fruits is a hash having their names and price
%fruits = ("Apple", "60", "Banana", "20", "Peers", "40");

47.

What Is The Difference Between Chop & Chomp Functions In Perl?

Answer»

chop is used to remove LAST character,CHOMP FUNCTION removes only line ENDINGS.

chop is used to remove last character,chomp function removes only line endings.

48.

How To Concatenate Strings With Perl?

Answer»

Method #1 - using PERL's DOT operator:
$NAME = 'checkbook';
$filename = "/tmp/" . $name . ".tmp";

Method #2 - using Perl's join function
$name = "checkbook";
$filename = join "", "/tmp/", $name, ".tmp";

Method #3 - usual way of concatenating strings
$filename = "/tmp/${name}.tmp";

Method #1 - using Perl's dot operator:
$name = 'checkbook';
$filename = "/tmp/" . $name . ".tmp";

Method #2 - using Perl's join function
$name = "checkbook";
$filename = join "", "/tmp/", $name, ".tmp";

Method #3 - usual way of concatenating strings
$filename = "/tmp/${name}.tmp";

49.

Which Of These Is A Difference Between C++ And Perl?

Answer»

Perl can have objects whose data cannot be accessed outside its class, but C++ cannot.
Perl can use closures with unreachable PRIVATE data as objects, and C++ doesn't SUPPORT closures. Furthermore, C++ does support pointer arithmetic via `int *ip = (int*)&object', allowing you do look all over the object. Perl doesn't have pointer arithmetic. It also doesn't allow `#define private PUBLIC' to change access rights to foreign objects. On the other HAND, once you start POKING around in /dev/mem, no one is safe.

Perl can have objects whose data cannot be accessed outside its class, but C++ cannot.
Perl can use closures with unreachable private data as objects, and C++ doesn't support closures. Furthermore, C++ does support pointer arithmetic via `int *ip = (int*)&object', allowing you do look all over the object. Perl doesn't have pointer arithmetic. It also doesn't allow `#define private public' to change access rights to foreign objects. On the other hand, once you start poking around in /dev/mem, no one is safe.

50.

Why Does Perl Not Have Overloaded Functions?

Answer»

Because you can inspect the ARGUMENT count, return context, and object types all by yourself.
In PERL, the number of arguments is trivially available to a function via the scalar sense of @_, the return context via want array(), and the types of the arguments via ref() if they're references and simple pattern matching LIKE /^d+$/ otherwise. In languages like C++ where you can't do this, you simply MUST resort to overloading of functions.

Because you can inspect the argument count, return context, and object types all by yourself.
In Perl, the number of arguments is trivially available to a function via the scalar sense of @_, the return context via want array(), and the types of the arguments via ref() if they're references and simple pattern matching like /^d+$/ otherwise. In languages like C++ where you can't do this, you simply must resort to overloading of functions.