Monday, December 10, 2007

Unix Concepts 2

11. What Happens when you execute a program?

When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then execute your program in that context. The steps include the following:

Ø Allocate a slot in the process table, a list of currently running programs kept by UNIX.

Ø Assign a unique process identifier (PID) to the process.

Ø iCopy the context of the parent, the process that requested the spawning of the new process.

Ø Return the new PID to the parent process. This enables the parent process to examine or control the process directly.

After the fork is complete, UNIX runs your program.

12. What Happens when you execute a command?

When you enter 'ls' command to look at the contents of your current working directory, UNIX does a series of things to create an environment for ls and the run it: The shell has UNIX perform a fork. This creates a new process that the shell will use to run the ls program. The shell has UNIX perform an exec of the ls program. This replaces the shell program and data with the program and data for ls and then starts running that new program. The ls program is loaded into the new process context, replacing the text and data of the shell. The ls program performs its task, listing the contents of the current directory.

13. What is a Daemon?

A daemon is a process that detaches itself from the terminal and runs, disconnected, in the background, waiting for requests and responding to them. It can also be defined as the background process that does not belong to a terminal session. Many system functions are commonly performed by daemons, including the sendmail daemon, which handles mail, and the NNTP daemon, which handles USENET news. Many other daemons may exist. Some of the most common daemons are:

Ø init: Takes over the basic running of the system when the kernel has finished the boot process.

Ø inetd: Responsible for starting network services that do not have their own stand-alone daemons. For example, inetd usually takes care of incoming rlogin, telnet, and ftp connections.

Ø cron: Responsible for running repetitive tasks on a regular schedule.

14. What is 'ps' command for?

The ps command prints the process status for some or all of the running processes. The information given are the process identification number (PID),the amount of time that the process has taken to execute so far etc.

15. How would you kill a process?

The kill command takes the PID as one argument; this identifies which process to terminate. The PID of a process can be got using 'ps' command.

16. What is an advantage of executing a process in background?

The most common reason to put a process in the background is to allow you to do something else interactively without waiting for the process to complete. At the end of the command you add the special background symbol, &. This symbol tells your shell to execute the given command in the background.

Example: cp *.* ../backup& (cp is for copy)

17. How do you execute one program from within another?

The system calls used for low-level process creation are execlp() and execvp(). The execlp call overlays the existing program with the new one , runs that and exits. The original program gets back control only when an error occurs.

execlp(path,file_name,arguments..); //last argument must be NULL

A variant of execlp called execvp is used when the number of arguments is not known in advance.

execvp(path,argument_array); //argument array should be terminated by NULL

18. What is IPC? What are the various schemes available?

The term IPC (Inter-Process Communication) describes various ways by which different process running on some operating system communicate between each other. Various schemes available are as follows:


One-way communication scheme through which different process can communicate. The problem is that the two processes should have a common ancestor (parent-child relationship). However this problem was fixed with the introduction of named-pipes (FIFO).

Message Queues :

Message queues can be used between related and unrelated processes running on a machine.

Shared Memory:

This is the fastest of all IPC schemes. The memory to be shared is mapped into the address space of the processes (that are sharing). The speed achieved is attributed to the fact that there is no kernel involvement. But this scheme needs synchronization.

Various forms of synchronisation are mutexes, condition-variables, read-write locks, record-locks, and semaphores.

Unix Concepts

Unix Concepts



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:


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.



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

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

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

4. Predict the output of the following program code




printf("Hello World!");



Hello World!Hello World!


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.

5. Predict the output of the following program code



fork(); fork(); fork();

printf("Hello World!");



"Hello World" will be printed 8 times.


2^n times where n is the number of calls to fork()

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

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

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

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

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

SQL interview questions/ SQL faq / SQL important Questions


1. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?

Data Definition Language (DDL)

2. What operator performs pattern matching?

LIKE operator

3. What operator tests column for the absence of data?

IS NULL operator

4. Which command executes the contents of a specified file?

START or @

5. What is the parameter substitution symbol used with INSERT INTO command?


6. Which command displays the SQL command in the SQL buffer, and then executes it?


7. What are the wildcards used for pattern matching?

_ for single character substitution and % for multi-character substitution

8. State true or false. EXISTS, SOME, ANY are operators in SQL.


9. State true or false. !=, <>, ^= all denote the same operation.


10. What are the privileges that can be granted on a table by a user to others?

Insert, update, delete, select, references, index, execute, alter, all

11. What command is used to get back the privileges offered by the GRANT command?


12. Which system tables contain information on privileges granted and privileges obtained?


13. Which system table contains information on constraints on all the tables created?




Will the outputs of the above two commands differ?

Both will result in deleting all the rows in the table EMP.

15. What is the difference between TRUNCATE and DELETE commands?

TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.

16. What command is used to create a table by copying the structure of another table?

Answer :


Explanation :

To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.


If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table.

17. What will be the output of the following query?



18. What will be the output of the following query?

SELECT DECODE(TRANSLATE('A','1234567890','1111111111'), '1','YES', 'NO' );

Answer :


Explanation :

The query checks whether a given string is a numerical digit.

19. What does the following query do?


This displays the total salary of all employees. The null values in the commission column will be replaced by 0 and added to salary.

20. Which date function is used to find the difference between two dates?


21. Why does the following command give a compilation error?


Variable names should start with an alphabet. Here the table name starts with an '&' symbol.

22. What is the advantage of specifying WITH GRANT OPTION in the GRANT command?

The privilege receiver can further grant the privileges he/she has obtained from the owner to any other user.

23. What is the use of the DROP option in the ALTER TABLE command?

It is used to drop constraints specified on the table.

24. What is the value of ‘comm’ and ‘sal’ after executing the following query if the initial value of ‘sal’ is 10000?


sal = 11000, comm = 1000

25. What is the use of DESC in SQL?

Answer :

DESC has two purposes. It is used to describe a schema as well as to retrieve rows from table in descending order.

Explanation :

The query SELECT * FROM EMP ORDER BY ENAME DESC will display the output sorted on ENAME in descending order.

26. What is the use of CASCADE CONSTRAINTS?

When this clause is used with the DROP command, a parent table can be dropped even when a child table exists.

27. Which function is used to find the largest integer less than or equal to a specific value?


28. What is the output of the following query?



Pay Scale for freshers

Company Pay in LPA
Accenture 2.1
Adobe 5.7
Amazon 7.5
Attrenta 4.8
Caritor 2.0
Computer Associates 4.5
CTS 2.1
DE Shaw 6.0
Deloitte 7.0
Fiorano 5.0
Flextronics (HSS) 3.0
Google 12.0
GE 3.0
HCL 2.0
Hexaware 2.1
IBM 2.5
Impulsesoft 4.5
Interra Systems 4.6
Induslogic 4.2
Infosys 1.8
Kanbay 2.25
Kritical 5.6
MBT 2.5
Microsoft 7.8
Mindtree 3.0
Motorola 3.6
Oracle 4.2
Patni(PCS) 1.7
Perot Systems 2.5
Polaris 2.0
SAP Labs 4.0
Samsung 4.6
Satyam 2.25
STM 4.5
Sun Micro Systems
Syntel 2.05
Tata Elxsi 1.9
Tavant 3.6
TCS 1.8
T-Mobile 8.0
Trilogy 7.5
Verizon 3.0
Virtusa 2.4
Wipro 2.1

Axes placement paper 2

Pattern of Axes
Micro Processor
1.Bus arbitaration is used for ans: controling the
2.which one is the higher priority a)hold
b)interrupt ans: a)
3. 2's complement of 43 010101
4.what happens when PUSH A instruction is exec....
5.INT6 pushes how many bytes on to the stack.
6.AL = 35, BL = 39
now what are contents of AL. 8086 program to find the o/p(i.e. to find the
largest of all)
8.x = 11010010 , y = 00110101
x+y what is the result
9.what is the diff b/w RET and IRET
10. What happens when AND/TEST instruction is
11. What is max unsigned value in 16bit databus
12. what is max address in 16bit address bus
13. what is meant by memory mapped i/o
14. AL = 35
what are contents of AL
15.LIFO occurs in which memory
1. what is amplitude modulation
2. Bandwidth of telephone line (4k)
3. IP layer uses a)packet switching b)circuit
c)store and forword switching d)both a and b
4. which one is not transmission media a)optical
fiber b)coaxial cable
c)catagary 5 UTP d)none of above
5.number of address bits in IPV6 128
6.ISDN is used for digital communication
7.which layer not present in TCP
8.what is the time period of E1 carrier superframe
ans: 2ms
9. what is the bit rate of the E1 carrier/channel
10. ATM is a) adapter b) n/w architecture layer c)
conectar ans: b
11.on ADSL - Asynchronous Digital Subscriber Line
12.on AI Networks?
C- Questions
1. struct {
int a;
char b;
char *c;
what is the sizeof structer.
2.union {
int a;
char b : 3;
char c : 2;
what is the sizeof union.
3. what is sizeof('a')
4. write p is pointer to constant char
a) char const *p;
b) char *const p;
c) const *char p;
d) const char *p;
5. which one is faster compiler or interpreter
6.sizeof is __________
7.STACK is part of__________? ANS:-RAM
8.TO print % ?
9.#include includes definitions or
10.where the locals and globals are stored. Ans :-
stack & heep.
Axes Technologies
1. A 2MB PCM(pulse code modulation) has
a) 32 channels
b) 30 voice channels & 1 signalling channel.
c) 31 voice channels & 1 signalling channel.
d) 32 channels out of which 30 voice channels, 1
signalling channel, &
1 Synchronizatio channel.
Ans: (c)
2. Time taken for 1 satellite hop in voice
communication is
a) 1/2 second b) 1 seconds c) 4 seconds d) 2 seconds
Ans: (a)
3. Max number of satellite hops allowed in voice
communication is :
a) only one b) more han one c) two hops d) four hops
Ans: (c)
4. What is the max. decimal number that can be
accomodated in a byte.
a) 128 b) 256 c) 255 d) 512 Ans: (c)
5. Conditional results after execution of an
instruction in a micro
processor is stored in
a) register b) accumulator c) flag register d) flag
register part of PSW(Program Status Word) Ans: (d)
6. Frequency at which VOICE is sampled is
a) 4 Khz b) 8 Khz c) 16 Khz d) 64 Khz Ans: (a)
7. Line of Sight is a) Straight Line b) Parabolic c)
Tx & Rx should be visible to each other d) none Ans:
8. Purpose of PC(Program Counter) in a MicroProcessor
a) To store address of TOS(Top Of Stack) b) To store
address of next instruction to be executed. c) count
the number of instructions.
d) to store base address of the stack. Ans: (b)
9. What action is taken when the processor under
execution is
interrupted by a non-maskable interrupt?
a) Processor serves the interrupt request after
completing the
execution of the current instruction. b)
Processor serves the interupt request after completing
the current task. c) Processor serves the interupt
request immediately. d) Processor serving the
interrupt request depends upon the priority of the
current task under execution. Ans: (a)
10. The status of the Kernel is
a) task b) process c) not defined. d) none of the
above. Ans: (b)
11 What is the nominal voltage required in subscriber
loop connected to
local exchange?
a) +48 volts b) -48 volts c) 230 volt s d) 110
12. To send a data packet using datagram , connection
will be established
a) before data transmission. b) connection is not
established before data transmission. c) no
connection is required. d) none of the above. Ans:
13. Word allignment is a) alligning the address
to the next word boundary of the machine. b)
alligning to even boundary. c) alligning to word
boundary. d) none of the above. Ans: (a)
14 When a 'C' function call is made, the order in
which parameters
passed to the function are pushed into the stack is
a) left to right b) right to left c) bigger
variables are moved first than the smaller variales.
d) smaller variables are moved first than the bigger
ones. e) none of the above. Ans: (b)
15 What is the type of signalling used between two
a) inband b) common channel signaling c) any of the
above d) none of the above. Ans: (a)
16. Buffering is a) the process of temporarily
storing the data to allow for small variation in
device speeds b) a method to reduce cross talks c)
storage of data within transmitting medium until the
receiver is ready to receive. d) a method to reduce
routing overhead. Ans: (a)
17. A protocol is a set of rules governing a time
sequence of events
that must take place between a) peers b) non-peers
c) allocated on stack d) assigned to registers.
18. Memory allocation of variables declared in a
program is
a) allocated in RAM. b) allocated in ROM. c)
allocated on stack.
d) assigned to registers. Ans: (c)
19. A software that allows a personal computer to
pretend as a computer
terminal is a) terminal adapter b) bulletin board c)
modem d)terminal emulation Ans: (d)
20. Find the output of the following program
int *p,*q;
p=(int *)1000;
q=(int *)2000;
Ans: 500
21. What does the statement int(*x[])() indicate?
22. Which addressing mode is used in the following
(a) MVI B,55 (b) MOV B,A (c) MOV M,A
Ans. (a) Immediate addressing mode. (b) Register
Addressing Mode
(c) Direct addressing mode
23. RS-232C standard is used in _____________. Ans.
Serial I/O
24. How are parameters passed to the main function?
25. What does the file stdio.h contain?
a) functin definition b) function decleration c) both
func. defn func. decleration.
26. scanf is used for ?
27. Memory. Management in Operating Systems is done by
a) Memory Management Unit b) Memory management
software of the Operating System c) Kernel Ans: (b)
28. What does the statement strcat(S2,S1) do?
29. TCP is Connection Oriented and used in ______
30. IP(Internet Protocol) is connectionless and used
in ________ layer?
31. For LAN Netwrok layer is not required. Why?
32. What is done for a Push opertion?
Ans: SP is decremented and then the value is
33. Describe the following structures as
(a) Stack (b) Queue
Network basics
* T1(US standard)
Data rate 1.544MBPS
No of Channels 24
No of bits per frame 193 (8x24 + 1 Framing bit)
Time 125uS/Sample(for 193 bits)
* E1(European standard)
Data rate 2.048MBPS
No of Channels 32
* OSI Model
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
* TCP/IP Model
Application Layer
Transport Protocol(TCP/UDP/SCTP)
Internet Protocol(IP)
Physical Layer
* TCP-->Connection Oriented
* UDP-->Connection less
* POT(Plain Old Telephone) works with -48V
* Internet--> packet switching
PSTN --> Circuit switching
* Hamming code distance --> 5
* In Ethernet Frame length is fixed
* MAC() length is 6 bytes
* In Asynchronous communication START/STOP bits r used
* Long Distance Communication --> Satellite
* Protocol is a set of rules used for communication
between two peers
* UTP-5 (Unshielded Twisted Pair)
STP (Shielded Twisted Pair)
7. A man owns 2/3 of the market research beauro
business and sells 3/4 of his shares for Rs. 75000.
What is the value of Business. Ans.150000
10. From its total income, A sales company spent
Rs.20,000 for advertising, half of the remainder on
commissions and had Rs.6000 left. What was its total
18. If a salesman's average is a new order every other
week, he will break the office record of the year.
However, after 28 weeks, he is six orders behind
schedule. In what proportion of the remaining weeks
does he have to obtain a new order to break the
record? Ans.3/4

Axes placement paper

1.One of the following is my secret word:AIM DUE MOD OAT TIE.With the list in front
of you, if I were to tell you any one of my secret word, then you would be able to tell
me the number of vowels in my secret word.Which is my secret word?
2.In the following figure:A B C
Each of the digits 1, 2, 3, 4, 5, 6, 7, 8, and 9 is:
a)Represented by a different letter in the figure above.
b)Positioned in the figure above so that each of A + B + C,C + D +E,E + F + G, and
G + H + I is equal to 13.
Which digit does E represent?
Ans.E is 4
3.One of Mr. Horton,his wife,their son,and Mr. Horton's mother is a doctor and
another is a lawyer.
a)If the doctor is younger than the lawyer, then the doctor and the lawyer are not
blood relatives.
b)If the doctor is a woman, then the doctor and the lawyer are blood relatives.
c)If the lawyer is a man, then the doctor is a man.
Whose occupation you know?
Ans.Mr. Horton:he is the doctor.
4.Here is a picture of two cubes:
a)The two cubes are exactly alike.
b)The hidden faces indicated by the dots have the same alphabet on them.
Which alphabet-q, r, w, or k is on the faces indicated by the dots?
5.In the following figure:
Each of the seven digits from 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 is:
a)Represented by a different letter in the figure above.
b)Positioned in the figure above so that A*B*C,B*G*E, and D*E*F are equal.
Which digit does G represent?
Ans.G represents the digit 2.
6.Mr. and Mrs. Aye and Mr. and Mrs. Bee competed in a chess tournament.Of the
three games played:
a)In only the first game werethe two players married to each other.
b)The men won two games and the women won one game.
c)The Ayes won more games than the Bees.
d)Anyone who lost game did not play the subsequent game.
Who did not lose a game?
Ans.Mrs.Bee did not lose a game.
7.Three piles of chips--pile I consists one chip, pile II consists of chips, and pile III
consists of three chips--are to be used in game played by Anita and Brinda.The game
a)That each player in turn take only one chip or all chips from just one pile.
b)That the player who has to take the last chip loses.
c)That Anita now have her turn.
From which pile should Anita draw in order to win?
Ans.Pile II
8.Of Abdul, Binoy, and Chandini:
a)Each member belongs to the Tee family whose members always tell the truth or to
the El family whose members always lie.
b)Abdul says ''Either I belong or Binoy belongs to a different family from the other
Whose family do you name of?
Ans.Binoy's family--El.
C Test
1.Write a program to insert a node in a sorted linked list.
2.Write a program to implement the Fibonacci series.
3.Write a program to concatenate two circular linked lists into a single circular list.
4.A function even_odd_difference()passes the array of elements.Write a program to
calculate the difference of the two sums of which one sum adds the elements of odd
ones and another adds the elments of even ones.
5.Write a program to reverse a linked list.
C++ Test
1. Base class has some virtual method and derived
class has a method with the same name. If we initialize the base class pointer with
object,.calling of that virtual method will result in which method being called?
a. Base method
b. Derived method..
Ans. b
Almost all questions are of this kind. Go through virtual functions concepts in C++
and how the pointers to functions would be handled.