Wednesday, December 30, 2009

Red Hat Linux System Administration Pre-assessment Questionnaire

Red Hat Linux System Administration Pre-assessment Questionnaire
Topic #1: Supported Hardware

1) Which statement is false?
The master drive on the primary IDE controller is /dev/hda.
USB and PCMCIA devices are supported by Red Hat, but only USB is hot swappable.
Both SCSI and IDE are supported by Red Hat.
Do not know.

2) Block and character special devices, used to address hardware, do not display size in a long ls listing. Instead, they display
the amount of addressable space on the device
bus and device numbers
major and minor device numbers
Do not know.

3) Which statement is false?
The i686 and athlon kernels can map up to 4 GB of RAM, but using the bigmem kernel, more than 4 GB of RAM can be mapped if your hardware supports Physical Address Extentions (PAE).
Support for virtual CPUs using hyperthreading technology is only available when using smp or bigmem kernels.
Architectures supported by Red Hat Enterprise Linux products include IA-32, IA-64, Alpha, S/390, z-Series, pSeries, and Sparc.
Do not know.


Topic #2: Installation

1) When selecting packages to install,
you may make your selection by individual package or by package group; no further level of refinement is possible.
you may make your selection by individual package or by package group; if you choose the latter method, you can refine your choice by selected the related "Details" item.
the installer does not track how much disk space the requested installation will take.
Do not know.

2) Which statement about installation is false?
It is not possible to set up logical volume management at install time.
It is possible to set up additional non-privileged user accounts at install time.
Kickstart installations allows system administrators to install an operating system in a virtually hands-free manner, often requiring no human intervention, other than starting the kickstart process.
Do not know.

3) Setting up software RAID partitions
is not possible during the install.
is a simple one step process of designating a partition as a software RAID partition and declaring the mount point.
is a multi-step process: declare various partitions to be software RAID partitions and then RAID them together.
Do not know.

Topic #3: Creating and maintaining filesystems

1) What is the default filesystem type under the current version of Red Hat?
ext2, the second extended Linux filesystem.
ext3, the third extended Linux filesystem.
reiserfs, the Reiser filesystem.
Do not know.

2) How many partitions are allowed on an IDE drive?
63 total partitions are allowed, but this number is only possible if you use an extended partition, which will limit the number primary partitions to three.
15 total partitions are allowed.
Four primary partitions are allowed, plus an extended partition. Logical partitions reside within the extended partition. Up to 15 logical partitions are allowed.
Do not know.

3) Explain filesystem remounts.
remount is an option to mount command allowing the system administrator to change the options on a currently mounted filesystem; these changes will take effect immediately.
remount is a command that forces an unmount (umount) and a mount of a filesystem, typically an NFS filesystem, to clear a stale file handle.
remount is a process that occurs when changing runlevels, effectively reapplying options from the /etc/fstab file.
Do not know.

Topic #4: X Window System Administration

1) Which statement is true about the configuration of the X server?
The redhat-config-xfree86 command will not create an /etc/X11/XF86Config file.
You cannot create an /etc/X11/XF86Config file at install time.
The redhat-config-xfree86 command will probe your hardware to determine values for the /etc/X11/XF86Config file.
Do not know.

2) Which statement is true about the relationship between display managers and desktop environments?
To use the KDE desktop, you must use the kdm display manager.
Regardless of the display manager you use, you may start up either the KDE desktop or the GNOME desktop.
When you use switchdesk to select a desktop environment, you also select a display manager.
Do not know.

3) Which of the following statements about using the Xauthority security mechanism with ssh is false?
An MIT magic cookie must be manually created before the Xauthority mechanism can be used with ssh.
To use the Xauthority mechanism with ssh, log into the remote computer using ssh from an xterm-type application running on the X server system and run the application.
When using the Xauthority security mechanism through ssh, all data passing between the remote client and the local X server will be encrypted.
Do not know.


Topic #5: System initialization

1) Which item below best represents the boot sequence?
The BIOS loads the boot loader; the boot loader loads the kernel; the kernel runs the initial process.
The BIOS loads the kernel; the kernel loads the boot loader; the boot loader loads the initial process.
The BIOS loads the initial process; the initial process loads the boot loader; the boot loader loads the kernel.
Do not know.

2) On a default Red Hat system, what is the first program run by /sbin/init?
/etc/rc.d/rc.sysinit
/etc/rc.d/rc
/sbin/initdefault
Do not know.

3) How does runlevel S differ from runlevel 1?
There is no difference; they are exactly the same.
Runlevel 1 runs the /etc/rc.d/rc1.d scripts, but runlevel S does not.
Runlevel S runs rc.sysinit, but runlevel 1 does not.
Do not know.

Topic #6: User and group administration

1) How can a system administrator change the password of a non-privileged user?
If using shadow passwords, run shadow username. If using an integrated /etc/passwd file, run passwd username. Either version will prompt the superuser for the new password.
Run passwd username. This will prompt the superuser for the new password.
It is necessary to know the non-privileged user's password in order to change it. The system administrator can run passwd username. This will prompt the superuser for the user's current password and the new password.
Do not know.

2) The /etc/shadow file:
must be used to hold the encrypted password; the second field of the /etc/passwd file is no longer valid.
is optional; a system administrator can choose to use it or not.
is considered less secure than using an integrated /etc/passwd file.
Do not know.

3) What is the net effect of running the following commands:
usermod -G sysadmns digby
usermod -G websters digby
digby is a member of the websters group.
digby is a member of the sysadmns and websters groups.
digby's primary group (as specified in the /etc/passwd file) is websters.
Do not know.

Topic #7: Client-side network authentication

1) Which of the following is not a common network authentication scheme?
NIS
LDAP
autofs
Do not know.

2) What is the name of the tool that configures a network authentication scheme?
systemauth
userconfig
authconfig
Do not know.

3) Where is the NISDOMAIN variable set and stored?
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-interface, where interface is an interface name, such as eth0.
/var/yp/securenets
Do not know.

Topic #8: Network setup and troubleshooting

1) The configuration file for the first ethernet interface is:
/etc/sysconfig/ifcfg-eth0
/etc/sysconfig/ifcfg-eth1
/etc/sysconfig/network-scripts/ifcfg-eth0
Do not know.

2) Which command does not modify the configuration file for the first ethernet interface?
ifconfig
netconfig
redhat-config-network
Do not know.

3) Where can the default route be specified?
In the global network default file, /etc/sysconfig/network, only.
In the network interface configuration files only.
In either the global network default file, /etc/sysconfig/network, or the network interface configuration files.
Do not know.

Topic #9: Printing

1) Which printing subsystem is available under current versions of Red Hat:
printcap
CUPS
BSD
Do not know.

2) From the user's perspective, which printing user interfaces are available on Red Hat:
LPRng and CUPS
BSD and LPRng
BSD and System V
Do not know.

3) What is the name of a valid print daemon under Red Hat?
printd
cupsd
spoold
Do not know.

Topic #10: System Logging and Monitoring

1) Most daemon log messages get logged to:
/var/log/daemonname, where daemonname is the name of the daemon.
/var/log/messages
/var/log/dmesg
Do not know.

2) Which statement about system logging is false?
klogd logs kernel messages; syslogd logs some other log messages.
The system logging subsystem can send messages over the network to a log host.
The following line in the /etc/syslog.conf file means that no messages will be logged through the mail facility:
mail.* /var/log/maillog
Do not know.

3) The load average is a measure of how busy your CPU is. What does it measure?
The number of non-timer interrupts divided by the number of minutes over which the average is taken, divided by 1000 (or 1024, depending on the version of Linux or Unix being used).
The average number of processes in the process table over an increment of time.
The average number of processes in the runnable state over an increment of time.
Do not know.

Topic #11: System-wide task automation

1) How many fields does an entry in the /etc/crontab file have?
6: five time specifications and a command, the same number as users' crontab files.
7: five time specifications, a user under whose authority the command should be run, a command; this is one more than users' crontab files.
7: five time specifications, an email address to receive unredirected standard output and standard error, and a command; this is one more than users' crontab files.
Do not know.

2) By default, the /etc/crontab file is populated with:
A series of commands such as makewhatis, tmpwatch, and logrotate that perform system maintenance on a regular basis.
A series of runparts commands that, in turn, run a series of other commands, such as makewhatis, tmpwatch, and logrotate, that perform system maintenance on a regular basis.
By default, the file contains no commands, allowing individual system administrators to populate the file.
Do not know.

3) To prevent some users from using the at command:
add the users to the atdeny group in the /etc/group file.
put the usernames of those users in the /etc/at.deny file.
as there is no /etc/at.deny file, you must put the names of the users permitted to use the at command in the /etc/at.allow file.
Do not know.

Topic #12: RPM

1) What is not one of the functions of the rpm command?
Install software.
Query the database of installed software.
Optionally, interactively configure newly installed software packages, asking the system administrator a series of questions about the install, such as whether or not the files have been relocated to a different directory.
Do not know.

2) What is the difference between these two rpm commands?
rpm -Uhv mypkg.1.0-2.noarch.rpm
rpm -Fhv mypkg.1.0-2.noarch.rpm
The -U version of the command uninstalls the package, whereas the -F version will upgrade the package if a previous version is already installed.
Both will upgrade the mypkg package if it is already installed, but if the mypkg package is not installed, the -U version will install it, whereas the -F version will not.
The -U version will uninstall the package, whereas the -F version will do a test install, reporting any install errors without actually installing it.
Do not know.

3) In the query command below, what is being queried?
rpm -qp mypkg.1.0-0.noarch.rpm
The package file.
The RPM database on the current system.
Nothing. This is not a valid query.
Do not know.

Linux Questions (Redhat Linux Essentials)

Red Hat Enterprise Linux Essentials Pre-assessment Questionnaire
Topic #1: Basic Filesystem and File Commands

1) If the file newdir/file2 does not exist but the directory newdir does exist, what is the effect of the following command?
mv file1 newdir/file2
file1 will be moved to newdir and renamed file2.
file1 will be copied to newdir and named file2.
An error will be reported, as this is an invalid command.
Do not know.

2) What will this command return?
ls -F
A listing of items in the current directory unsorted.
A listing of items in the current directory with file type indicators after some files.
A listing of items in the current directory separated by commas on a single line instead of presented in columns.
Do not know.

3) Considering the command below, which of the following statements is true?
ln file1 file2
file2 will be symbolically linked to file1.
Regardless of the size of file1, file2 will have a size of 5 bytes.
file1 and file2 have the same inode number.
Do not know.


Topic #2: The Linux Filesystem Layout

1) What type of files are typically in the /etc directory?
Configuration files.
Miscellaneous files.
Standard Linux commands.
Do not know.

2) In what directory are email inboxes stored by default?
/var/spool/mail
The mail directory in the user's home directory.
/usr/mail
Do not know.

3) The /lib directory contains:
Libraries of documentation.
Configuration files.
Shared objects.
Do not know.

Topic #3: Permissions and Attributes

1) What command lists file permissions?
a. chmod
b. ls -l
c. perms
d. Do not know.

2) What are the numeric permissions on a file with permissions of -rwxr-x--- after you run the command:
chmod g+s file
a. 2750
b. 750
c. 751
d. Do not know.

3) What is the effect of the following command?
chattr +i file
a. Changes of any kind are forbidden; in effect, the file is immutable.
b. The file will be compressed when saved to the disk, but be uncompressed when read.
c. The file can only be opened in insert mode only: data can be added, but data in the file cannot be changed or removed.
d. Do not know.

Ans : a

Topic #4: Text Processing Tools

1) Which of the following is best suited for viewing text one page at a time?
a. cut
b. less
c. grep
d. Do not know.
Ans : b

2) Which of the following is best suited for extracting columns of text?
cut
less
grep
Do not know.

Ans : a

3) For the file reports.txt, which of the following commands would, ignoring case, extract every line containing the word "expense", the lines before and after each match, and print the relevant line numbers?
grep -i expense reports.txt
grep -A1 -B1 -n -i expense report.txt
grep --context=1 -N -i expense report.txt
Do not know.

Ans : b

Topic #5: The vi and vim Editors

1) When using the vi editor, which of the following is true?
In command mode, the capital letter "O" opens a line below the current line, placing you in insert mode.
In command mode, the lower case letter "a" places you in insert mode, appending after the cursor.
In command mode, "dd4" deletes four lines.
Do not know.

ans : b

2) When using the vi editor, in command mode, which of the following sequences will delete four words?
4xw
wwww
4dw
Do not know.

ans : c

3) In vim, you search for a string of characters and the characters are highlighted. How do you turn off the highlighting?
:set nohighlight
:set nohl
:nohl
Do not know.

ans :


Topic #6: System Configuration Tools

1) Which of the following might you use to configure the network?
redhat-config-network
system-config-network
ipconfig
Do not know.



2) Where is the configuration information for network interface eth0 stored?
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/eth0.conf
/etc/network/eth0.cfg
Do not know.

3) Which of the following commands could be used to configure a system's date and time?
datetime
date
timeconf
Do not know.


Topic #7: Standard Input and Output System

1) What will the following command do?
ls -l /etc > /tmp/etc.ls
Display a long listing of the /etc directory and the /tmp/etc.ls file.
Display a long listing of the /etc directory, redirecting the output into the /tmp/etc.ls file.
Report an error message, as this is a poorly constructed command.
Do not know.

ans : b

2) Which command below will merge the standard output and standard error of the ls command and then place the merged data into two separate files?
ls -lR /data > mylist1 > mylist2 2>&1
ls -lR /data 2>&1 | tee mylist1 > mylist2
ls -lR /data | tee mylist 1 > mylist2 2>&1
Do not know.

Ans : b

3) What happens to standard output and standard error when running the following command?
ls -lR /data 2>&1 > /tmp/output
stdout and stderr go to the /tmp/output file.
stdout goes to the /tmp/output file and stderr is displayed on the screen as standard output.
stderr goes to the /tmp/output file and stdout is displayed on the screen.
Do not know.

ans : b

Topic #8: Process Control

1) What command diplays a list of processes currently running on your system?
ps ax
proc -a
stat
Do not know.

2) For a job running in the foreground, how can you run it in the background?
This is not possible.
Suspend the job by typing Control-c and then place it in the background by sending kill -TSTP PID, where PID is the process ID number.
Suspend the job by typing Control-z and then place it in the background by executing the bg command.
Do not know.

3) In a process listing, what does a T indicate in the STAT column?
The process execution has been suspended.
The process is defunct.
The process has no resident pages.
Do not know.

Topic #9: Client-side Encrypted Communications

1) Which of the following will allow you to log into another computer using an encrypted tunnel?
telnet
ssh
rlogin
Do not know.

2) In order to allow an encrypted ftp connection to your box, which service or services must you provide?
sshd
vsftpd
both vsftpd (or some other FTP daemon) and sshd
Do not know.

3) You wish to automatically log into computer1 from computer2. To accomplish this, you place a key from computer2 in a file in the proper hidden directory of computer1. In which file do you place this key?
authorized_keys
known_hosts
id_dsa.pub
Do not know.


Topic #10: bash Command Line Shortcuts

1) Your present working directory contains the following files:

parrot

pelican

penguin

You type:
ls -l pa
and then hit the tab key. You are using the bash shell as your interactive shell. What happens?
"pa" will be expanded to "parrot".
Nothing.
"pa" will be expanded to "parrot" and then the ls command will be executed.
Do not know.

2) The following command returns a list of files. What best describes the files listed?
ls *.*
A list of all files in the present working directory.
A list of all non-hidden files in the present working directory.
A list of all files in the present working directory that have a dot in the name, but not as a first character.
Do not know.

3) What command will be run by this sequence?
!?cat
The most recent cat command.
The most recent command that has cat in the command name.
The most recent command that has cat somewhere on the command line.
Do not know.


Topic #11: Shell Scripting

1) In the following shell script, how many times will the date command run?
for i in a b; do date; done
0
1
2
Do not know.

2) Under what condition is hello echo'ed in the following shell script?
if [ -d newitem ]; then echo hello; fi
If newitem is a directory.
Always.
Never, as newitem is a non-zero length string.
Do not know.

3) In a shell script in a while/do loop, what does the continue statement do?
Pause for one second and then continue to execute.
Interrupt that particular time through the do loop and jump to the while statement to reevaluate the conditional statement.
Jump past the done statement and continue executing.
Do not know.


Topic #12: Task Automation

1) What is the proper way to call the at command to submit a job to run sometime in the future?
at

This will prompt you for the command you wish to run and the time you wish to run it.


at timespec

timespec is the time that you want the command to run. You will be prompted for the command that you wish to run.


at timespec command

This will run the command at the time timespec.


Do not know.

2) Considering this entry in a user's crontab file, how often will the command in this line run?
30 4 * * 3 mycmd
Hourly.
Weekly.
Hourly in the month of March.
Do not know.

3) Considering this entry in a user's crontab file, how often will the command in this line run?
*/5 * * * * mycmd
Every five minutes.
Five minutes past the hour every hour.
This will not run, as the format is invalid.
Do not know.

Wednesday, December 16, 2009

Some Linux Questions

Linux Questions :

1. Using bash, what will be the current working directory after these commands:

cd /
cd /tmp
ls /etc
cd $_

a. /
b. /tmp
c. /etc
d. /home

ans : c

2. "kudzu" is:

a. A pallete mixer
b. A sound mixer
c. The program that probes for new or missing hardware
d. a device driver for Mouse

and : c


3. The following messages are observed in a logfile:

Aug 11 10:14:58 linbox -- MARK --
Aug 11 10:34:58 linbox -- MARK --
Aug 11 10:54:58 linbox -- MARK --
Aug 11 11:14:59 linbox -- MARK --

4. What program is most likely to be responsible for these?

a. syslogd
b. sendmail
c. cron
d. init

ans : a

Sunday, November 29, 2009

CompTIA Security+ Practice Test Answers

Question 1
(corresponding objective: 1.3)

Creating a basic standard for application settings, security settings, and active services on every company laptop would be considered...

A. group policy
B. baseline configuration
C. patch management
*D. a security template

Question 2
(corresponding objective: 3.7)

All of the following are correct about LDAP EXCEPT:

A. some implementations use x.509 certificates for securing communications
B. some of the implementations use default TCP ports 389 and 636
* C. all attributes will be encrypted
D. most of the implementations use the x.500 directory model

Question 3
(corresponding objective: 1.6)

Which of the following is a key reason for using virtual machines in a test lab where attackers or malware may compromise a machine?

A. Easier for the attacker to compromise the machine
B. Harder for the attacker to compromise the machine
* C. Easier to restore the system to the original state
D. Harder to restore the system to the original state

Question 4
(corresponding objective: 1.1)

Which of the following is more of an irritation than a security threat?

A. Rootkit
* B. Adware
C. Spyware
D. Trojan

Question 5
(corresponding objective: 3.1)

Least privilege is defined as giving access to information:

A. based on tenure at the company
B. based on sense of urgency from management
C. that may be revealed to the public
* D. needed to complete the task

Question 6
(corresponding objective: 1.1)

Which of the following describes a piece of malicious code that is activated when specified conditions are met?

A. Trojan
B. Spyware
* C. Logic Bomb
D. Virus

Question 7
(corresponding objective: 4.6)

An administrator wishes to enable network auditing policies. Which of the following should the security administrator log?

A. Only logon failures
B. Only logon success
*C. Both logon successes and logon failures
D. Only logon failures for non-existent users

Question 8
(corresponding objective: 4.4)

From a security perspective a performance baseline is MOST useful for:

* A. detecting performance anomalies that may be due to security breaches
B. assuring that systems are working to their optimal capacity
C. knowing when security scans are going to finish
D. predicting the end of useful life for the firewall


Question 9
(corresponding objective: 2.5)

A company creates its own application that accesses the company databases and requires a unique login, based on the user’s domain account. The developer has an undocumented login for testing that does not need to be authenticated against the domain. Which of the following is a security issue regarding this scenario?

A. The login should be the same as the domain account for authentication purposes
* B. It can be used as a backdoor into the company’s databases
C. The application should not be deployed if it is not fully tested
D. It is not considered best practice to have a user remember multiple logins


Question 10
(corresponding objective: 2.1)

In order to perform a TCP hijacking attack, an attacker would be required to:

A. have a protocol analyzer intercept traffic between two hosts
* B. know the IP addresses of both hosts and sequence numbers of the TCP/IP packets
C. perform a man-in-the-middle attack and communicate directly with two hosts
D. obtain the MAC address of the both hosts

Linux+ Quesions

1. customer wants internal office information to be accessible by employees through a Web browser. Which of the following Linux services should be used?

A. Squid
B. MySQL
C. Apache
D. sendmail

Ans : C

2 : Which of the following should be done before installing Linux on a home computer?

A. Upgrade the computer's memory to at least 64 MB
B. Create ext2 and swap partitions on the hard drive
C. Verify the hardware on the Linux hardware compatibility list
D. Defragment the drive using the computer's current operating system

Ans : C

3. Which of the following packages is usually more important for a "workstation" installation than a "server" installation?

A. DNS Server
B. DHCP Server
C. Proxy Server
D. XFree86 Server

Ans : D


4. A new employee having a problem with account login has the following entry in the /etc/passwd file:
user1:*:51:501:John Doe:/home/user1:/bin/bash
What is wrong with this entry in the /etc/passwd file?

A. The UID is not valid.
B. The account is locked.
C. The UID and GID must match.
D. Spaces are not permitted between the first and last name.

Ans : B

5. After having worked for several months, a PC fails to boot and indicates that the HDD has bad sectors. Which is the first action to take?

A. Reboot the system to remove the message.
B. Run the manufacturer's Diagnostic Utility.
C. Replace the defective HDD and reload the system.
D. Run Scandisk and Defrag to repair the damaged sectors.

Ans: B


6. A customer wants to determine which TCP ports are in use on his Linux server. Which of the following commands should be used?

A. tftp
B. lsport
C. minicom
D. netstat

Ans : D


7. A Linux superuser is unable to delete a file. The user is also unable to change permission for the file. What is the problem?

A. The file is actually a hard link.
B. The file has the immutable flag set.
C. The file has been fragmented across directories.
D. The superuser does not have permission to access the file.

Ans : B


8. Which of the following commands can be used to save and resume editing the file in the vi editor?

A. :w
B. :x
C. :v
D. :s!

Ans : A

9. A system technician needs to determine which hardware modules are loaded on a particular Linux server. Which of the following commands will perform this task?

A. lsmod
B. modules
C. insmod -list
D. modprobe -list

Ans : lsmod

10. What is the first step in troubleshooting a system problem?

A. Collect information
B. Test a possible solution
C. Make a hypothesis about a solution
D. Try to modify the configuration files

Ans : A

Thursday, November 12, 2009

FresherQuestionPaper

001. In Linux, how can you only see the first 14 lines of a file?



002. In Linux, what can you type at a command line to determine which shell you are using?




003. In Linux, what is the command to list ALL (hidden also) files of current directory & it’s subdirectories?




004. List out some popular linux distributions.


005. What is an ip address and what is the use of it?






006. What are the 7 layers of OSI model ?






007. What does HTML stand for?




008. What does CSS stand for?




009. What does PHP stand for?




010. What does SQL stand for?



011. What does PERL stand for ?



012. Which SQL statement is used to extract data from a database?



013. Explain about cache memory and virtual memory.







014. What is a compiler and give an example for compiler?


.
015. Diffrence between Stack and Queue?




016. What is union and structure?





017. Diffrence between pass by value and pass ny reference?




018. What is the difference between "calloc(...)" and "malloc(...)"?




019. What is the difference between "printf(...)" and "sprintf(...)"?





020. What is the difference between an Interface and an Abstract class?





021. What is the purpose of garbage collection in Java, and when is it used?




022. Explain differences between Swing and Awt.




023. Explain about Overriding, Encapsulation and Inheritence.








024. What is serialization?





025. List out different types of JDBC drivers. Briefly explain about each type.





026. Explain the life cycle methods of a Servlet.?





027. What is the difference between servlets and JSP?




028. What is Throughput, Turnaround time?





029. Explain about the paging systems?





030. What is Deadlock?





031. Explain the meaning of the expression ACID transaction?







032. In SQL a statement, How can you compare a part of the name rather than the entire name?






033. How do you delete a record from a database?

034. How do you delete a table from a database?


035. In SQL, Explain usage of "GROUP BY" clause ?



036. In SQL, Differenciate between a "where" clause and a "having" clause ?




037. What's the difference between a primary key and a unique key?



038. Explain about cursors.




039. Explain about triggers.



040.
What is a self join?




041. Explain about normalization.






042. How do we find ip address in Windows and Linux?





043. Diffrence between WAN and LAN?





044. What is protocol?




045. Diffrence between HTTP and HTTPS?



046. What are the ports associated with the following Applications/Services?
FTP
Telnet
http
ssh
smtp




047. Explain about configuration management and list out some configuration management tools.




048. What is Remote Procedure Call (RPC)?





049. Explain about Symmetric and Asymmetric Encryptions.






050. Explain about following terms.
Bug
Testcase

Wednesday, November 11, 2009

System Admin Interview Questions

1. What port does telnet use?
2. What is SMTP?
3. How would you troubleshoot a printer?
4. How does traceroute work?
5. Walk me through everything that happens in the network from the moment you punch in www.google.com in the address bar to when the browser displays the page?
6. Can you work this weekend?
7. What kind of people are your current users? Do you like them?
8. What role do you think computer support analysts should play in the company?
9. Assuming you have to work for a living and all jobs pay the same, how would you describe the job you want?
10. When conflict arises on your team, how do you handle it?

11. How do you stay current?
12. What operating system do you prefer and why?
13. What part of the project life cycle have you worked on?
14. Describe the project or situation that best demonstrates your coding (or analytical) skills.
15. What is the differece between local, global and universal groups?
16. What is the major difference between FAT and NTFS?
17. Name the FMSO roles and their functions.
18. You’ve just been asked to create 20 new Users and update 2 GPOs, ASAP! You go to the Administrative Tools, and discover they are all gone. What do you do? What do you suspect happened?
19. What is a Global Catalog?
20. Explain the function of DNS.
21. Explain a “Two-Way Transitive” trust.
22. In speaking about trusts, what does “Non-transitive” mean?
23. Describe the lease process of DHCP.
24. Explain NTP.
25. What is the 568B wiring scheme?
26. What us your highest achievement while working in the IT field?
27. What are your short term goals to achieve?
28. You have a user call for support for the 5th time on the same issue. How would you handle the call and what would you do differently?
29. List as many ways you can think of to move a file from a Windows machine to a Linux machine.
30. Demonstrate recursiveness by implementing a factorial function.

Important Unix Shell Questions

1. There can be multiple Kernels and shells running on your system. True or False?
2. Why shell is called Command Interpreter?
3. Two UNIX systems may or may not use the same system calls. True or False?
4. To obtain help on any feature of the system, what are the possible help sources available?
5. Why are the directories /bin and /usr/bin usually found first in the output of echo $PATH?
6. If two commands with the same filename exist in two directories in PATH, how can they be executed.
7. How is the Current directory is indicated in the value of the PATH?
8. Use the type command with the following arguments—cd, date, pwd and ls. Which are the internal commands in the list?
9. What is the difference between an argument and an option?
10. if the command ls –all works on your system, which flavor of UNIX could you be using?
11. What does the secondary prompt look like and when does it appear?
12. You located the string crontab in a man page by searching with /crontab [Enter]. How do you find out the other occurrences of this string in the page?
13. What is a pager? Name the two standard pagers used by man.
14. If a command doesn’t seem to complete, which key will you press to interrupt it?
15. Do you need to wait for a command to finish before entering the next one?
16. What do the | and the three dots in the SYNOPSIS section of these man pages indicate as shown below?
/usr/xpg4/bin/tail [ -f | -r ]
/usr/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [file .. ]
17. How do you direct man to use a specific pager, say less?
18. What is a whitespace? Explain the treatment the shell metes out to a command that contains a lot of whitespace.
19. A Program file named foo exists in the current directory, but when we try to execute it by entering foo, we see the message foo: command not found. Explain how that can happen?
20. What do multiprogramming, multiuser and multitasking mean?
21. Why are many UNIX commands designed to perform simple rather than complex tasks?

Linux/Unix Shell related questions

1. How do you find out what’s your shell? - echo $SHELL
2. What’s the command to find out today’s date? - date
3. What’s the command to find out users on the system? - who
4. How do you find out the current directory you’re in? - pwd
5. How do you remove a file? - rm
6. How do you remove a directory and its subdirectories - rm -rf
7. How do you find out your own username? - whoami
8. How do you send a mail message to somebody? - mail somebody@techinterviews.com -s ‘Your subject’ -c ‘cc@techinterviews.com‘

9. How do you count words, lines and characters in a file? - wc
10. How do you search for a string inside a given file? - grep string filename
11. How do you search for a string inside a directory? - grep string *
12. How do you search for a string in a directory with the subdirectories recursed? - grep -r string *
13. What are PIDs? - They are process IDs given to processes. A PID can vary from 0 to 65535.
14. How do you list currently running process? - ps
15. How do you stop a process? - kill pid
16. How do you find out about all running processes? - ps -ag
17. How do you stop all the processes, except the shell window? - kill 0
18. How do you fire a process in the background? - ./process-name &
19. How do you refer to the arguments passed to a shell script? - $1, $2 and so on. $0 is your script name.
20. What’s the conditional statement in shell scripting? - if {condition} then … fi
21. How do you do number comparison in shell scripts? - -eq, -ne, -lt, -le, -gt, -ge
22. How do you test for file properties in shell scripts? - -s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability
23. How do you do Boolean logic operators in shell scripting? - ! tests for logical not, -a tests for logical and, and -o tests for logical or.
24. How do you find out the number of arguments passed to the shell script? - $#
25. What’s a way to do multilevel if-else’s in shell scripting? - if {condition} then {statement} elif {condition} {statement} fi
26. How do you write a for loop in shell? - for {variable name} in {list} do {statement} done
27. How do you write a while loop in shell? - while {condition} do {statement} done
28. How does a case statement look in shell scripts? - case {variable} in {possible-value-1}) {statement};; {possible-value-2}) {statement};; esac
29. How do you read keyboard input in shell scripts? - read {variable-name}
30. How do you define a function in a shell script? - function-name() { #some code here return }
31. How does getopts command work? - The parameters to your script can be passed as -n 15 -x 20. Inside the script, you can iterate through the getopts array as while getopts n:x option, and the variable $option contains the value of the entered option.

Operating system questions

What is MUTEX ?
What isthe difference between a ‘thread’ and a ‘process’?
What is INODE?
Explain the working of Virtual Memory.
How does Windows NT supports Multitasking?

Explain the Unix Kernel.
What is Concurrency? Expain with example Deadlock and Starvation.
What are your solution strategies for “Dining Philosophers Problem” ?
Explain Memory Partitioning, Paging, Segmentation.
Explain Scheduling.
Operating System Security.
What is Semaphore?
Explain the following file systems : NTFS, Macintosh(HPFS), FAT .
What are the different process states?
What is Marshalling?
Define and explain COM?
What is Marshalling?
Difference - Loading and Linking ?

Basic Computer Networks Questions

Some of the Top Basic Computer Networks Questions, that must be Answered and known if you even think of attending any Networks/Network Admin Interviews.

1. Virtual meetings on Internet are called………….
2. LAN can be connected by devices called………..
3. The bit pattern …………… is the preamble of 802.3 frame format.
4. Basic SONET frame is a block of ……………. bytes.
5. The amount of thermal noise is measured by ………………..
6. Explain the Frequency Modulation.
7. What is WAN and where it is used? how it is different from LAN and MAN.
8. Explain single error detecting code with example.
9. What is Flow control? Explain.
10. Explain CSMA/CD Protocol.
11. Describe Multitasking.
12. Describe Service Primitives.
13. Explain briefly PCM and its requirements.
14. What is Concession Control describe i) Load shedding ii) Jitter Control. Under it.
15. What is QoS?
16. Token Bucket Algorithm is employed to prevent congestion. The capacity of the bucket is 250k byes Arriving rate of the token is 2MB/sec. if the maximum output rate is 25MB/sec, calculate the burst length in time.
17. Describe principles considered in the design of network layer in the internet.
18. Describe Address format used in Internet. [ With figure ]
19. A Network on the Internet has a Subnet mask of 255.255.240.0. What is the maximum No. of hosts it can handle?
20. What are basic difference between IPV4 and IPV6?
21. Describe Address Resolution Protocol, use diagram if required.
22. What is the difference between Interior gateway protocol and Exterior gateway protocol.
23. What is the function of ATM adaptation layer.
24. Illustrate the phenomenon of Silly Window Syndrome in TCP.
25. What is delayed duplicate problem?
26. Explain Unicast addresses, Multicast adresses, and broadcast address.

Networking Interview Questions and Answers

Networking Interview Questions and Answers :

1. What is an Object server?

With an object server, the Client/Server application is written as a set of communicating objects. Client object communicate with server objects using an Object Request Broker (ORB). The client invokes a method on a remote object. The ORB locates an instance of that object server class, invokes the requested method and returns the results to the client object. Server objects must provide support for concurrency and sharing. The ORB brings it all together.

2. What is a Transaction server?

With a transaction server, the client invokes remote procedures that reside on the server with an SQL database engine. These remote procedures on the server execute a group of SQL statements. The network exchange consists of a single request/reply message. The SQL statements either all succeed or fail as a unit.

3. What is a Database Server?

With a database server, the client passes SQL requests as messages to the database server. The results of each SQL command are returned over the network. The server uses its own processing power to find the request data instead of passing all the records back to the client and then getting it find its own data. The result is a much more efficient use of distributed processing power. It is also known as SQL engine.

4. What are the most typical functional units of the Client/Server applications?

* User interface
* Business Logic and
* Shared data.

5. What are all the Extended services provided by the OS?

* Ubiquitous communications
* Network OS extension
* Binary large objects (BLOBs)
* Global directories and Network yellow pages
* Authentication and Authorization services
* System management
* Network time
* Database and transaction services
* Internet services
* Object- oriented services

6. What are Triggers and Rules?

Triggers are special user defined actions usually in the form of stored procedures, that are automatically invoked by the server based on data related events. It can perform complex actions and can use the full power of procedural languages.
A rule is a special type of trigger that is used to perform simple checks on data.

7. What is meant by Transparency?

Transparency really means hiding the network and its servers from the users and even the application programmers.

8. What are TP-Lite and TP-Heavy Monitors?

TP-Lite is simply the integration of TP Monitor functions in the database engines. TP-Heavy are TP Monitors which supports the Client/Server architecture and allow PC to initiate some very complex multiserver transaction from the desktop.

9. What are the two types of OLTP?

TP lite, based on stored procedures. TP heavy, based on the TP monitors.

10. What is a Web server?

This new model of Client/Server consists of thin, protable, "universal" clients that talk to superfat servers. In the simplet form, a web server returns documents when clients ask for them by name. The clients and server communicate using an RPC-like protocol called HTTP.
11. What are Super servers?

These are fully-loaded machines which includes multiprocessors, high-speed disk arrays for intervive I/O and fault tolerant features.

12. What is a TP Monitor?

There is no commonly accepted definition for a TP monitor. According to Jeri Edwards' a TP Monitor is "an OS for transaction processing".

13. TP Monitor does mainly two things extremely well. They are Process management and Transaction management.?

They were originally introduced to run classes of applications that could service hundreds and sometimes thousands of clients. TP Monitors provide an OS - on top of existing OS - that connects in real time these thousands of humans with a pool of shared server processes.

14. What is meant by Asymmetrical protocols?

There is a many-to-one relationship between clients and server. Clients always initiate the dialog by requesting a service. Servers are passively awaiting for requests from clients.

15. What are the types of Transparencies?

The types of transparencies the NOS middleware is expected to provide are:-

* Location transparency
* Namespace transparency
* Logon transparency
* Replication transparency
* Local/Remote access transparency
* Distributed time transparency
* Failure transparency and
* Administration transparency.

16. What is the difference between trigger and rule?

The triggers are called implicitly by database generated events, while stored procedures are called explicitly by client applications.

17. What are called Transactions?

The grouped SQL statements are called Transactions (or) A transaction is a collection of actions embused with ACID properties.

18. What are the building blocks of Client/Server?

* The client
* The server and
* Middleware.

19. Explain the building blocks of Client/Server?

The client side building block runs the client side of the application.
The server side building block runs the server side of the application.

20. The middleware buliding block runs on both the client and server sides of an application. It is broken into three categories:-

* Transport stack
* Network OS
* Service-specific middleware.

21. What are all the Base services provided by the OS?

* Task preemption
* Task priority
* Semaphores
* Interprocess communications (IPC)
* Local/Remote Interprocess communication
* Threads
* Intertask protection
* Multiuser
* High performance file system
* Efficient memory management and
* Dynamically linked Run-time extensions.

22. What are the roles of SQL?

* SQL is an interactive query language for ad hoc database queries.
* SQL is a database programming language.
* SQL is a data definition and data administration language.
* SQL is the language of networked database servers
* SQL helps protect the data in a multi-user networked environment.
* Because of these multifacted roles it plays, physicists might call SQL as "The grand unified theory of database".

23. What is Structured Query Langauge (SQL)?

SQL is a powerful set-oriented language which was developed by IBM research for the databases that adhere to the relational model. It consists of a short list of powerful, yet highly flexible, commands that can be used to manipulate information collected in tables. Through SQL, we can manipulate and control sets of records at a time.

24. What are the characteristics of Client/Server?

* Service
* Shared resources
* Asymmentrical protocols
* Transparency of location
* Mix-and-match
* Message based exchanges
* Encapsulation of services
* Scalability
* Integrity

Client/Server computing is the ultimate "Open platform". It gives the freedom to mix-and-match components of almost any level. Clients and servers are loosely coupled systems that interact through a message-passing mechanism.

25. What is Remote Procedure Call (RPC)?

RPC hides the intricacies of the network by using the ordinary procedure call mechanism familiar to every programmer. A client process calls a function on a remote server and suspends itself until it gets back the results. Parameters are passed like in any ordinary procedure. The RPC, like an ordinary procedure, is synchoronous. The process that issues the call waits until it gets the results.

Under the covers, the RPC run-time software collects values for the parameters, forms a message, and sends it to the remote server. The server receives the request, unpack the parameters, calls the procedures, and sends the reply back to the client. It is a telephone-like metaphor.

26. What are the main components of Transaction-based Systems?

* Resource Manager
* Transaction Manager and
* Application Program.

27. What are the three types of SQL database server architecture?

* Process-per-client Architecture. (Example: Oracle 6, Informix )
* Multithreaded Architecture. (Example: Sybase, SQL server)
* Hybrid Architecture (Example: Oracle 7)

28. What are the Classification of clients?

Non-GUI clients - Two types are:-

1. Non-GUI clients that do not need multi-tasking
(Example: Automatic Teller Machines (ATM), Cell phone)
2. Non-GUI clients that need multi-tasking
(Example: ROBOTs)
GUI clients
OOUI clients

29. What are called Non-GUI clients, GUI Clients and OOUI Clients?

Non-GUI Client: These are applications, generate server requests with a minimal amount of human interaction.
GUI Clients: These are applicatoins, where occassional requests to the server result from a human interacting with a GUI
(Example: Windows 3.x, NT 3.5)
OOUI clients : These are applications, which are highly-iconic, object-oriented user interface that provides seamless access to information in very visual formats.
(Example: MAC OS, Windows 95, NT 4.0)

30. What is Message Oriented Middleware (MOM)?

MOM allows general purpose messages to be exchanged in a Client/Server system using message queues. Applications communicate over networks by simply putting messages in the queues and getting messages from queues. It typically provides a very simple high level APIs to its services.
MOM's messaging and queuing allow clients and servers to communicate across a network without being linked by a private, dedicated, logical connection. The clients and server can run at different times. It is a post-office like metaphor.

31. What is meant by Middleware?

Middleware is a distributed software needed to support interaction between clients and servers. In short, it is the software that is in the middle of the Client/Server systems and it acts as a bridge between the clients and servers. It starts with the API set on the client side that is used to invoke a service and it covers the transmission of the request over the network and the resulting response.
It neither includes the software that provides the actual service - that is in the servers domain nor the user interface or the application login - that's in clients domain.

32. What are the functions of the typical server program?

It waits for client-initiated requests. Executes many requests at the same time. Takes care of VIP clients first. Initiates and runs background task activity. Keeps running. Grown bigger and faster.

33. What is meant by Symmentric Multiprocessing (SMP)?

It treats all processors as equal. Any processor can do the work of any other processor. Applications are divided into threads that can run concurrently on any available processor. Any processor in the pool can run the OS kernel and execute user-written threads.

34. What are Service-specific middleware?

It is needed to accomplish a particular Client/Server type of services which includes:-

* Database specific middleware
* OLTP specific middleware
* Groupware specific middleware
* Object specific middleware
* Internet specific middleware and
* System management specific middleware.

35. What are General Middleware?

It includes the communication stacks, distributed directories, authentication services, network time, RPC, Queuing services along with the network OS extensions such as the distributed file and print services.

36. What is meant by Asymmetric Multiprocessing (AMP)?

It imposses hierarchy and a division of labour among processors. Only one designated processor, the master, controls (in a tightly coupled arrangement) slave processors dedicated to specific functions.

37. What is OLTP?

In the transaction server, the client component usually includes GUI and the server components usually consists of SQL transactions against a database. These applications are called OLTP (Online Transaction Processing) OLTP Applications typically,
Receive a fixed set of inputs from remote clients. Perform multiple pre-compiled SQL comments against a local database. Commit the work and Return a fixed set of results.

38. What is meant by 3-Tier architecture?

In 3-tier Client/Server systems, the application logic (or process) lives in the middle tier and it is separated from the data and the user interface. In theory, the 3-tier Client/Server systems are more scalable, robust and flexible.
Example: TP monitor, Web.

39. What is meant by 2-Tier architecture?

In 2-tier Client/Server systems, the application logic is either burried inside the user interface on the client or within the database on the server.
Example: File servers and Database servers with stored procedures.

40. What is Load balancing?

If the number of incoming clients requests exceeds the number of processes in a server class, the TP Monitor may dynamically start new ones and this is called Load balancing.

41. What are called Fat clients and Fat servers?

If the bulk of the application runs on the Client side, then it is Fat clients. It is used for decision support and personal software.
If the bulk of the application runs on the Server side, then it is Fat servers. It tries to minimize network interchanges by creating more abstract levels of services.

42. What is meant by Horizontal scaling and Vertical scaling?

Horizontal scaling means adding or removing client workstations with only a slight performance impact. Vertical scaling means migrating to a larger and faster server machine or multiservers.

43. What is Groupware server?

Groupware addresses the management of semi-structured information such as text, image, mail, bulletin boards and the flow of work. These Client/Server systems have people in direct contact with other people.

44. What are the two broad classes of middleware?

* General middleware
* Service-specific middleware.

45. What are the types of Servers?

* File servers
* Database servers Transaction servers Groupware servers
* Object servers Web servers.

46. What is a File server?

File servers are useful for sharing files across a network. With a file server, the client passes requests for file records over nerwork to file server.

47. What are the five major technologies that can be used to create Client/Server applications?

* Database Servers
* TP Monitors
* Groupware
* Distributed Objects
* Intranets.

48. What is Client/Server?

Clients and Servers are separate logical entities that work together over a network to accomplish a task. Many systems with very different architectures that are connected together are also called Client/Server.

49. List out the benefits obtained by using the Client/Server oriented TP Monitors?

* Client/Server applications development framework.
* Firewalls of protection.
* High availability.
* Load balancing.
* MOM integration.
* Scalability of functions.
* Reduced system cost.

50. What are the services provided by the Operating System?

Extended services - These are add-on modular software components that are layered on top of base service.

UNIX - LINUX Interview Questions and Answers :


1. How are devices represented in UNIX?

All devices are represented by files called special files that are located in/dev directory. Thus, device files and other files are named and accessed in the same way. A 'regular file' is just an ordinary data file in the disk. A 'block special file' represents a device with characteristics similar to a disk (data transfer in terms of blocks). A 'character special file' represents a device with characteristics similar to a keyboard (data transfer is by stream of bits in sequential order).

2. What is 'inode'?

All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode. In addition to descriptions about the file, the inode contains pointers to the data blocks of the file. If the file is large, inode has indirect pointer to a block of pointers to additional data blocks (this further aggregates for larger files). A block is typically 8k.
Inode consists of the following fields:

  • File owner identifier
  • File type
  • File access permissions
  • File access times
  • Number of links
  • File size
  • Location of the file data

3. Brief about the directory representation in UNIX

A Unix directory is a file containing a correspondence between filenames and inodes. A directory is a special file that the kernel maintains. Only kernel modifies directories, but processes can read directories. The contents of a directory are a list of filename and inode number pairs. When new directories are created, kernel makes two entries named '.' (refers to the directory itself) and '..' (refers to parent directory).
System call for creating directory is mkdir (pathname, mode).

4. What are the Unix system calls for I/O?

  • open(pathname,flag,mode) - open file
  • creat(pathname,mode) - create file
  • close(filedes) - close an open file
  • read(filedes,buffer,bytes) - read data from an open file
  • write(filedes,buffer,bytes) - write data to an open file
  • lseek(filedes,offset,from) - position an open file
  • dup(filedes) - duplicate an existing file descriptor
  • dup2(oldfd,newfd) - duplicate to a desired file descriptor
  • fcntl(filedes,cmd,arg) - change properties of an open file
  • ioctl(filedes,request,arg) - change the behaviour of an open file

The difference between fcntl anf ioctl is that the former is intended for any open file, while the latter is for device-specific operations.

5. How do you change File Access Permissions?

Every file has following attributes:
owner's user ID ( 16 bit integer )
owner's group ID ( 16 bit integer )
File access mode word

'r w x -r w x- r w x'


(user permission-group permission-others permission)
r-read, w-write, x-execute
To change the access mode, we use chmod(filename,mode).
Example 1:
To change mode of myfile to 'rw-rw-r–' (ie. read, write permission for user - read,write permission for group - only read permission for others) we give the args as:
chmod(myfile,0664) .
Each operation is represented by discrete values

'r' is 4
'w' is 2
'x' is 1


Therefore, for 'rw' the value is 6(4+2).
Example 2:
To change mode of myfile to 'rwxr–r–' we give the args as:

chmod(myfile,0744).

6. What are links and symbolic links in UNIX file system?

A link is a second name (not a file) for a file. Links can be used to assign more than one name to a file, but cannot be used to assign a directory more than one name or link filenames on different computers.
Symbolic link 'is' a file that only contains the name of another file.Operation on the symbolic link is directed to the file pointed by the it.Both the limitations of links are eliminated in symbolic links.
Commands for linking files are:

Link ln filename1 filename2
Symbolic link ln -s filename1 filename2


7. What is a FIFO?

FIFO are otherwise called as 'named pipes'. FIFO (first-in-first-out) is a special file which is said to be data transient. Once data is read from named pipe, it cannot be read again. Also, data can be read only in the order written. It is used in interprocess communication where a process writes to one end of the pipe (producer) and the other reads from the other end (consumer).

8. How do you create special files like named pipes and device files?

The system call mknod creates special files in the following sequence.
1. kernel assigns new inode,
2. sets the file type to indicate that the file is a pipe, directory or special file,
3. If it is a device file, it makes the other entries like major, minor device numbers.
For example:
If the device is a disk, major device number refers to the disk controller and minor device number is the disk.

9. Discuss the mount and unmount system calls

The privileged mount system call is used to attach a file system to a directory of another file system; the unmount system call detaches a file system. When you mount another file system on to your directory, you are essentially splicing one directory tree onto a branch in another directory tree. The first argument to mount call is the mount point, that is , a directory in the current file naming system. The second argument is the file system to mount to that point. When you insert a cdrom to your unix system's drive, the file system in the cdrom automatically mounts to /dev/cdrom in your system.

10. How does the inode map to data block of a file?

Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks in the file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a three-level(triple in-direction)index block. This provides a very large maximum file size with efficient access to large files, but also small files are accessed directly in one disk read.

11. What is a shell?

A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh,csh,ks etc.

12. Brief about the initial process sequence while the system boots up.

While booting, special process called the 'swapper' or 'scheduler' is created with Process-ID 0. The swapper manages memory allocation for processes and influences CPU allocation. The swapper inturn creates 3 children:

  • the process dispatcher,
  • vhand and
  • dbflush

with IDs 1,2 and 3 respectively.
This is done by executing the file /etc/init. Process dispatcher gives birth to the shell. Unix keeps track of all the processes in an internal data structure called the Process Table (listing command is ps -el).

13. What are various IDs associated with a process?

Unix identifies each process with a unique integer called ProcessID. The process that executes the request for creation of a process is called the 'parent process' whose PID is 'Parent Process ID'. Every process is associated with a particular user called the 'owner' who has privileges over the process. The identification for the user is 'UserID'. Owner is the user who executes the process. Process also has 'Effective User ID' which determines the access privileges for accessing resources like files.

  • getpid() -process id
  • getppid() -parent process id
  • getuid() -user id
  • geteuid() -effective user id

14. Explain fork() system call.

The `fork()' used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. We can tell which is which by checking the return value from `fork()'. The parent gets the child's pid returned to him, but the child gets 0 returned to him.

15. Predict the output of the following program code

main()
{
fork();
printf("Hello World!");
}


Answer:

Hello World!Hello World!


Explanation:

The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process.

16. Predict the output of the following program code

main()
{
fork(); fork(); fork();
printf("Hello World!");
}


Answer:
"Hello World" will be printed 8 times.
Explanation:
2^n times where n is the number of calls to fork()

17. List the system calls used for process management:

System calls Description

  • fork() To create a new process
  • exec() To execute a new program in a process
  • wait() To wait until a created process completes its execution
  • exit() To exit from a process execution
  • getpid() To get a process identifier of the current process
  • getppid() To get parent process identifier
  • nice() To bias the existing priority of a process
  • brk() To increase/decrease the data segment size of a process.

18. How can you get/set an environment variable from a program?

Getting the value of an environment variable is done by using `getenv()'. Setting the value of an environment variable is done by using `putenv()'.

19. How can a parent and child process communicate?

A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.

20. What is a zombie?

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.)

21. What are the process states in Unix?

As a process executes it changes state according to its circumstances. Unix processes have the following states:
Running : The process is either running or it is ready to run .
Waiting : The process is waiting for an event or for a resource.
Stopped : The process has been stopped, usually by receiving a signal.
Zombie : The process is dead but have not been removed from the process table.

CISCO (October, 2004)

CISCO (October, 2004)

1. In order to find out stack fault of a three input nand gate how many necessary input vectors
are needed ?

2. What is parity generation ?

3. A nand gate becomes ___ gate when used with negative logic ?

4. What is the advantage of cmos over nmos ?

5. What is the advantage of synchronous circuits over asynchronous circuits ?

6. What is the function of ALE in 8085 ?

7. A voice signal sample is stored as one byte. Frequency range is 16 Hz to 20 Hz. What is the
memory size required to store 4 minutes voice signal?

8. What will the controller do before interrupting CPU?

9. In a normalized floating point representation, mantissa is represented using 24 bits and exponent
with 8 bits using signed representation. What is range ?

10. The stack uses which policy out of the following-- LIFO, FIFO, Round Robin or none of these ?

11. Where will be the actual address of the subroutine is placed for vectored interrupts?

12. Give the equivalent Gray code representation of AC2H.

13.What is the memory space required if two unsigned 8 bit numbers are multiplied ?

14. The vector address of RST 7.5 in 8085 processor is _______.
Ans. 003C (multiply 7.5 by 8 and convert to hex)

15. Subtract the following hexadecimal numbers--- 8416 - 2A16

16. Add the following BCD numbers--- 1001 and 0100

17. How much time does a serial link of 64 Kbps take to transmit a picture with 540 pixels.

18. Give the output when the input of a D-flip flop is tied to the output through the XOR gate.

19. Simplify the ex-pression AB + A( B + C ) + B ( B + C )

20. Determine the logic gate to implement the following terms--ABC, A+B+C

21. Implement the NOR gate as an inverter.

22. What is the effect of temperature on the Icb in a transistor

23. What is the bit storage capacity of a ROM with a 512*4 organization?

24. What is the reason of the refresh operation in dynamic RAM's ?

25. Suppose that the D input of a flip flop changes from low to high in the middle of a clock pulse.
Describe what happens if the flip flop is a positive edge triggered type?

26. How many flip flops are required to produce a divide by 32 device ?

27. An active HIGH input S-R latch has a 1 on the S input and a 0 on the R input. What state is the
latch in?

28. Implement the logic equation Y = C^BA^ + CB^A + CBA with a multiplexer.
(where C^ stands for C complement)

29. Equivalent Gray code representation of AC2H.

30. What does a PLL consist of ?

We advice you to know the design of PLL as questions pertaining to this may be asked


II - Software Section

1. The starting location of an array is 1000. If the array[1..5/...4] is stored in row major order,
what is the location of element [4,3]. Each word occupies 4 bytes.

2. In a tertiary tree, which has three childs for every node, if the number of internal nodes are N,
then the total number of leaf nodes are

3. Explain the term "locality of reference" ?

4. What is the language used for Artificial Intelligence
Ans: lisp

5. What is the character set used in JAVA 2.0 ?
Ans: Unicode
6. char a =0xAA ;
int b ;
b = (int) a ;
b = b >> 4 ;
printf("%x",b);
What is the output of the above program segment ?

7. struct s1 { struct { struct { int x; } s2 } s3 }y; How does one access x in the above given structure
definition ?

8. Why there is no recursion in Fortran ?
Ans. There is no dynamic allocation.

9. What is the worst case complexity of Quick sort?
Ans. O(n2)

10. What will be sequence of operating system activities when an interrupt occurs ?

11. In a sequential search, what is the average number of comparisons it takes to search through n
elements ?
Ans: (n+1)/2.

12. What is the size of the array declared as double * X[5] ?
Ans. 5 * sizeof ( double * )

13. A binary search tree with node information as 1,2,3,4,5,6,7,8 is given. Write the result obtained
on preorder traversal of the binary search tree ?
Ans : 53124768

14. If size of the physical memory is 232-1, then what is the size of the virtual memory ?

15. S -> A0B A-> BB|0 B-> AA|1
How many strings of length 5 are possible with the above productions?

16. (3*4096+15*256+3*16+3). How many 1's are there in the binary representation of the result ?
Ans. 10

17. In memory mapped I/O how is I/O is accessed ?

18. What is the use of ALE in 8085 ?
Ans. To latch the lower byte of the address.

19. If the logical memory of 8 X 1024 is mapped into 32 frames, then the number of bits for the logical
address are____ ?
Ans. 13

20. Context free grammar is useful for which purpose ?

21. In ternary number representation, numbers are represented as 0,1,-1.(Here -1 is represented
as 1 bar.) How is 352/9 represented in ternary number representation?

22. There are processes which take 4,1,8,1 machine cycles respectively. If these are executed in round
robin fashion with a time quantum of 1, what is the time it take for process 4 to complete ?
Ans. 9

23. The minimum frequency of operation is specified for every processor because......
a) for interfacing slow peripherals
b) dynamic memory refreshing.
c) to make compatible with other processor.

24. For linked list implementation , which search is not applicable ?
Ans: Binary search.

25. Each character is represented by 7 bits, 1 bit is used to represent error bit and another bit for parity.
If total number of bits transmitted is 1200 bits, then what is the number of symbols that can be transmitted ?
Ans: 133

26. Explain set associatively of cache ?

27. Write the postfix form of the following ex-pression : A+[[(B+C)+( D+E)*F]/G]

28. What is the function of the linker?

29. void f(int y)
{
struct s *ptr;
ptr = malloc (sizeof (struct)+99*sizeof(int));
}
struct s
{
int i;
float p;
};
when free (ptr) is executed, what will happen?

30. To concatenate two linked lists strings, the order is O(1) is obtained for what kind of list

FAQ : OS concepts

Following are a few basic questions that cover the essentials of OS:

1. Explain the concept of Reentrancy.
It is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant Procedure is one in which multiple users can share a single copy of a program during the same period. Reentrancy has 2 key aspects: The program code cannot modify itself, and the local data for each user process must be stored separately. Thus, the permanent part is the code, and the temporary part is the pointer back to the calling program and local variables used by that program. Each execution instance is called activation. It executes the code in the permanent part, but has its own copy of local variables/parameters. The temporary part associated with each activation is the activation record. Generally, the activation record is kept on the stack.
Note: A reentrant procedure can be interrupted and called by an interrupting program, and still execute correctly on returning to the procedure.

2. Explain Belady's Anomaly.
Also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process' virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady's Anomaly. This is true for certain page reference patterns.

3. What is a binary semaphore? What is its use?
A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes.

4. What is thrashing?
It is a phenomenon in virtual memory schemes when the processor spends most of its time swapping pages, rather than executing instructions. This is due to an inordinate number of page faults.

5. List the Coffman's conditions that lead to a deadlock.
 Mutual Exclusion: Only one process may use a critical resource at a time.
 Hold & Wait: A process may be allocated some resources while waiting for others.
 No Pre-emption: No resource can be forcible removed from a process holding it.
 Circular Wait: A closed chain of processes exist such that each process holds at least one resource needed by another process in the chain.


6. What are short-, long- and medium-term scheduling?
Long term scheduler determines which programs are admitted to the system for processing. It controls the degree of multiprogramming. Once admitted, a job becomes a process.
Medium term scheduling is part of the swapping function. This relates to processes that are in a blocked or suspended state. They are swapped out of real-memory until they are ready to execute. The swapping-in decision is based on memory-management criteria.
Short term scheduler, also know as a dispatcher executes most frequently, and makes the finest-grained decision of which process should execute next. This scheduler is invoked whenever an event occurs. It may lead to interruption of one process by preemption.

7. What are turnaround time and response time?
Turnaround time is the interval between the submission of a job and its completion. Response time is the interval between submission of a request, and the first response to that request.

8. What are the typical elements of a process image?
*User data: Modifiable part of user space. May include program data, user stack area, and programs that may be modified.
* User program: The instructions to be executed.
* System Stack: Each process has one or more LIFO stacks associated with it. Used to store parameters and calling addresses for procedure and system calls.
* Process control Block (PCB): Info needed by the OS to control processes.

9. What is the Translation Lookaside Buffer (TLB)?
In a cached system, the base addresses of the last few referenced pages is maintained in registers called the TLB that aids in faster lookup. TLB contains those page-table entries that have been most recently used. Normally, each virtual memory reference causes 2 physical memory accesses-- one to fetch appropriate page-table entry, and one to fetch the desired data. Using TLB in-between, this is reduced to just one physical memory access in cases of TLB-hit.

10. What is the resident set and working set of a process?
Resident set is that portion of the process image that is actually in real-memory at a particular instant. Working set is that subset of resident set that is actually needed for execution. (Relate this to the variable-window size method for swapping techniques.)
11. When is a system in safe state?
The set of dispatchable processes is in a safe state if there exists at least one temporal order in which all processes can be run to completion without resulting in a deadlock.

12. What is cycle stealing?
We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA controller can use the data bus when the CPU does not need it, or it may force the CPU to temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle stealing can be done only at specific break points in an instruction cycle.

13. What is meant by arm-stickiness?
If one or a few processes have a high access rate to data on one track of a storage disk, then they may monopolize the device by repeated requests to that track. This generally happens with most common device scheduling algorithms (LIFO, SSTF, C-SCAN, etc). High-density multisurface disks are more likely to be affected by this than low density ones.

14. What are the stipulations of C2 level security?
C2 level security provides for:
 Discretionary Access Control
 Identification and Authentication
 Auditing
 Resource reuse

15. What is busy waiting?
The repeated execution of a loop of code while waiting for an event to occur is called busy-waiting. The CPU is not engaged in any real productive activity during this period, and the process does not progress toward completion.

16. Explain the popular multiprocessor thread-scheduling strategies.
 Load Sharing: Processes are not assigned to a particular processor. A global queue of threads is maintained. Each processor, when idle, selects a thread from this queue. Note that load balancing refers to a scheme where work is allocated to processors on a more permanent basis.
 Gang Scheduling: A set of related threads is scheduled to run on a set of processors at the same time, on a 1-to-1 basis. Closely related threads / processes may be scheduled this way to reduce synchronization blocking, and minimize process switching. Group scheduling predated this strategy.
 Dedicated processor assignment: Provides implicit scheduling defined by assignment of threads to processors. For the duration of program execution, each program is allocated a set of processors equal in number to the number of threads in the program. Processors are chosen from the available pool.
 Dynamic scheduling: The number of thread in a program can be altered during the course of execution.

17. When does the condition 'rendezvous' arise?
In message passing, it is the condition in which, both, the sender and receiver are blocked until the message is delivered.

18. What is a trap and trapdoor?
Trapdoor is a secret undocumented entry point into a program used to grant access without normal methods of access authentication. A trap is a software interrupt, usually the result of an error condition.

19. What are local and global page replacements?
Local replacement means that an incoming page is brought in only to the relevant process' address space. Global replacement policy allows any page frame from any process to be replaced. The latter is applicable to variable partitions model only.

20. Define latency, transfer and seek time with respect to disk I/O.
Seek time is the time required to move the disk arm to the required track. Rotational delay or latency is the time it takes for the beginning of the required sector to reach the head. Sum of seek time (if any) and latency is the access time. Time taken to actually transfer a span of data is transfer time.
22. What is time-stamping?
It is a technique proposed by Lamport, used to order events in a distributed system without the use of clocks. This scheme is intended to order events consisting of the transmission of messages. Each system 'i' in the network maintains a counter Ci. Every time a system transmits a message, it increments its counter by 1 and attaches the time-stamp Ti to the message. When a message is received, the receiving system 'j' sets its counter Cj to 1 more than the maximum of its current value and the incoming time-stamp Ti. At each site, the ordering of messages is determined by the following rules: For messages x from site i and y from site j, x precedes y if one of the following conditions holds....(a) if Ti<Tj or (b) if Ti=Tj and i<j.

23. How are the wait/signal operations for monitor different from those for semaphores?
If a process in a monitor signal and no task is waiting on the condition variable, the signal is lost. So this allows easier program design. Whereas in semaphores, every operation affects the value of the semaphore, so the wait and signal operations should be perfectly balanced in the program.

24. In the context of memory management, what are placement and replacement algorithms?
Placement algorithms determine where in available real-memory to load a program. Common methods are first-fit, next-fit, best-fit. Replacement algorithms are used when memory is full, and one process (or part of a process) needs to be swapped out to accommodate a new program. The replacement algorithm determines which are the partitions to be swapped out.

25. In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?
For load-time dynamic linking: Load module to be loaded is read into memory. Any reference to a target external module causes that module to be loaded and the references are updated to a relative address from the start base address of the application module.
With run-time dynamic loading: Some of the linking is postponed until actual reference during execution. Then the correct module is loaded and linked.

26. What are demand- and pre-paging?
With demand paging, a page is brought into memory only when a location on that page is actually referenced during execution. With pre-paging, pages other than the one demanded by a page fault are brought in. The selection of such pages is done based on common access patterns, especially for secondary memory devices.

27. Paging a memory management function, while multiprogramming a processor management function, are the two interdependent?
Yes.

28. What is page cannibalizing?
Page swapping or page replacements are called page cannibalizing.

29. What has triggered the need for multitasking in PCs?
Increased speed and memory capacity of microprocessors together with the support fir virtual memory and
Growth of client server computing

30. What are the four layers that Windows NT have in order to achieve independence?
Hardware abstraction layer
Kernel
Subsystems
System Services.

31. What is SMP?
To achieve maximum efficiency and reliability a mode of operation known as symmetric multiprocessing is used. In essence, with SMP any process or threads can be assigned to any processor.

32. What are the key object oriented concepts used by Windows NT?
Encapsulation
Object class and instance

33. Is Windows NT a full blown object oriented operating system? Give reasons.
No Windows NT is not so, because its not implemented in object oriented language and the data structures reside within one executive component and are not represented as objects and it does not support object oriented capabilities .

34. What is a drawback of MVT?
It does not have the features like
ability to support multiple processors
virtual storage
source level debugging

35. What is process spawning?
When the OS at the explicit request of another process creates a process, this action is called process spawning.

36. How many jobs can be run concurrently on MVT?
15 jobs

37. List out some reasons for process termination.
Normal completion
Time limit exceeded
Memory unavailable
Bounds violation
Protection error
Arithmetic error
Time overrun
I/O failure
Invalid instruction
Privileged instruction
Data misuse
Operator or OS intervention
Parent termination.

38. What are the reasons for process suspension?
  1. swapping
  2. interactive user request
  3. timing
  4. parent process request

39. What is process migration?
It is the transfer of sufficient amount of the state of process from one machine to the target machine

40. What is mutant?
In Windows NT a mutant provides kernel mode or user mode mutual exclusion with the notion of ownership.

41. What is an idle thread?
The special thread a dispatcher will execute when no ready thread is found.

42. What is FtDisk?
It is a fault tolerance disk driver for Windows NT.

43. What are the possible threads a thread can have?
 Ready
 Standby
 Running
 Waiting
 Transition
 Terminated.

44. What are rings in Windows NT?
Windows NT uses protection mechanism called rings provides by the process to implement separation between the user mode and kernel mode.

45. What is Executive in Windows NT?
In Windows NT, executive refers to the operating system code that runs in kernel mode.

46. What are the sub-components of I/O manager in Windows NT?
 Network redirector/ Server
 Cache manager.
 File systems
 Network driver
 Device driver

47. What are DDks? Name an operating system that includes this feature.
DDks are device driver kits, which are equivalent to SDKs for writing device drivers. Windows NT includes DDks.

48. What level of security does Windows NT meets?
C2 level security.