Monday, July 21, 2008

GD - Group Discussions FAQ's

What is the normal duration of a GD?

A GD is generally of 15-20 minutes duration.

How many panel members are there to evaluate?

There are usually 3-4 panel members to evaluate.

Is there time given for preparation after the topic is given and before starting the GD?

Usually some time (2-5 minutes) is given to collect one's thoughts, but there could be instances when this does not happen,

so it is best not to bank on this.

Should I address the panel or the group members?

Don't ever make the mistake of addressing the panel members. The GD is between you and the other members, not the panel

members. You must avoid even looking at the panel members while the GD is in progress. Just ignore their existence.

What is the seating arrangement like?

It could be semi-circular, or circular, or seating along side a rectangular table, depending upon the venue. It is best not to

bother about trivial issues like this, which you have no control over.

How should I address the other group members?

If you are initiating the discussion, you could do so by collectively addressing the group as "Friends". Subsequently, you could

use names (if the group has had a round of self-introduction prior to starting the discussion and you remember the names) or

simply use pronouns like "he" or "she".

Suppose I have a lot to say on the topic, should I say all of it?

You would not be looked upon favourably if you kept speaking all the time and did not listen to anyone else. Contrary to the

misconception, the person who talks the most is not necessarily the one who is judged the best. The quality and not the

quantity of your contribution is the success factor.

Should I encourage others to speak up?

Do not directly put someone who is consistently silent on the spot by asking him/her to speak up. If someone has been trying

to speak and has a good point but is cut off constantly, you may encourage him/her to continue with her point as you would

like to hear her out.

Are the group members supposed to keep track of the time or will the panel keep track?

It would be good if you are conscious of the time, but not to the point of getting so distracted looking at your watch that you

do not contribute to the discussion.

Are we allowed to carry a piece of paper during the GD for noting down important points?

Normally you are, but there may be instances when it is specifically forbidden to carry paper.

Is there any particular seating arrangement, which is favourable to the participants?

If participants are asked to sit in a circle or a semi circle, one position is as good as another. But if you are asked to sit on

either side of a rectangular table, then choose a position as clos
e to the centre as possible.

Should we begin the GD by appointing a leader amongst ourselves?

No. You should not. Leadership in a GD is established implicitly through one's performance in a GD.

Should we distribute the total time available to all the participants to ensure that everybody gets a chance to


Since a GD is not a debate or elocution, the participants should not resort to the strategy of distributing time amongst


Can we take a definite stand in the GD and then later on during the GD, switch over to another stand?

Yes, provided you do it the right way. In a GD it is quite likely that some other participant's counter-argument convinces you

to your point. If this happens, then it is best if you accept his argument and explain to the group how your previous argument

was true within a narrow range, and how the new argument is applicable to a broader range. Naturally, it is safer not to make

any rash statements for or against a topic before you learn the facts of the argument. Blindly taking a stand will definitely lead

you to trouble. This does not mean you should sit on the fence. You may participate actively by pointing out both sides of the

issue in a reasonable and logical manner.

If we do not understand the meaning of the topic, should we ask the moderator to explain it to us?

No. You cannot. Instead of displaying your ignorance in this manner, it is better to wait for some other participant to explain

the meaning of the topic. So listen to the discussion carefully for the first few minutes and when you have figured out what

the topic is about, start participating in the discussion.

Should we address the other participants by their names or their assigned numbers?

As far as possible, you should try and avoid names or numbers. It is better to use pronouns such as "he", "she", "you" etc.

while referring to the members of the group.

Are we expected to stick to the normally accepted line of thought or can we come up with something radical?

By all means you can. It would demonstrate your creativity and originality. Just make sure it is relevant to the topic.

If I feel strongly about an issue, should I voice my feelings?

It is important to be cool and emotionally objective in a GD. If you react emotionally you are likely to lose control over

yourself during the group discussion. You have to be calm and logical, not emotional in a GD.

Can I use technical terms or jargon, which is clear to me, but not to the group?

If you have to use technical terms, please do not use abbreviations. After mentioning the term in full take time out to explain

to the group what it means. It is quite likely that other participants of the group have a different academic background from

you, and you should make sure you are all on a level playing field.

Do I begin my participation by requesting the group's permission to do so?

It is not likely that you will get a chance to ask for such permission. It may also go against you (as appearing weak on your<


What is the right time to enter a GD to ensure that I am heard properly?

In any GD, there are crests and troughs during the discussion. The crest is when the noise level is at its peak. The trough is

when there is almost total silence. Ideally, you should enter the GD during the trough period. But in competitive GDs, the

crests occur more often and troughs may not occur at all. In such cases, you could identify the stages in the GD, where ideas

dear to you are being discussed and enter the GD irrespective of the noise level.

How do I participate when the noise level is too high?

You could try the following strategy - Identify the most powerful speaker in the group, and note down the points that he/she is

making. The moment the noise level reduces a little, enter supporting the powerful speaker. You will have made a strong ally

who will carry you through the noise.

Do I have to be cautious about other participants' feelings (on sensitive issues like religion, caste etc)?

You certainly do. Insensitivity to others displays a lack of maturity and viciousness. It will act against your favour.

Is it beneficial to be the first speaker in a group discussion?

Being the first speaker is a high risk, high return strategy. If you can make a good opening statement, which is relevant and

sets the tone for the GD, it will go in your favour. If you do this well, you may automatically become the group leader.

However if you bungle it up (by speaking for the sake of speaking, not really having anything pertinent to say), it will be

remembered and will go against your favour.

How critical is my fluency in English to my performance?

Command over English is certainly advantageous but will not compensate for lack of good content. If your content is good,

then even if your English might not be great, you must speak it out, rather than be inhibited by lack of good English. You will

get credit for soundness of ideas.

How necessary is it to use examples for illustrating an idea?

Use of examples is helpful in elaborating your point, and helping others understand your idea better. But please remember to

keep it short and simple because in a competitive GD nobody has the patience to listen to long, drawn out examples.

How much or for how long should I participate?

In a 20 minute GD with 10-12 participants, you should try and participate at least 4 times with each entry lasting at least 25-

30 seconds. You could participate more depending on your comfort level and the need for participation.

Is it good to be humorous in a GD?

Depends on the situation. In a GD that is fairly relaxed, it may be acceptable. But in a competitive situation, where the

participants are tensed up, your attempts at humour may fall flat.

Should we make an interim summary?

An interim summary is a way of directing the group mid-way through the GD. It helps t
he group to pick out and focus on the

most important points and thus use the remaining time more effectively. However it is not necessary to make an interim

summary, if the discussion is already well focused.

What do I do if someone else has already said what I wanted to say?

You have two choices:

1. Agree with the point made by that person and add on to it by displaying the applicability of the argument to different

situations. By doing this you will have broadened the scope of the argument.

2. Drop the point and think of fresh points.

To avoid getting into a situation where someone else has already spoken your points, do speak up in the first 4-5

minutes of the GD. If you wait longer, it is almost inevitable that someone would have spoken your points.

Is the use of slang/colloquialism permitted?

It is best to avoid using slang.

Can I use a language other than English to drive home my point?

No. You will have to stick to English.

How is aggression taken and measured in a GD?

The moment you notice people reacting to you negatively or strongly, you may take it that you are being too aggressive. The degree

of the reaction is the measure of your aggression.

What level of aggression is seen acceptable?

There is a very thin line between aggression and assertiveness. You should always aim to sound assertive and not stubborn.

Is it true that the person who speaks the most in a GD is the one who is most successful?

This is a myth. Generally the person who has a sound knowledge of the topic and is a clear thinker speaks more. This leads the

students into believing that whoever speaks most is successful. But just speaking for the sake of speaking will not take you far.

Will I be quizzed about my (or others) participation in the GD?

You may be. Therefore it helps to be alert all through the GD.

Is it true that the GD is used more as an elimination technique rather than as a selection tool?

Depends on the institute. In most premier institutes it is used as a selection tool, not as an elimination technique.

What is the level of accuracy desired in the facts and figures you quote during the GD?

An error margin of 5% is acceptable.

Is motivating other people in the group to speak looked upon favourably?

Depends on how it is done. If you openly request someone to speak, you may be putting the other person in a difficult spot, and the

evaluators will not look that upon favourably. It is therefore better to use other means of motivation, such as agreeing with a halting

speaker, adding on to their points, implicitly supporting and giving them direction.

Does the moderator have any biases or preconceived notions about the topic?

Ideally the moderator i
s supposed to be unbiased and neutral. But being a human being, the moderator cannot be totally free from

bias. Since this is not a factor within your control, there isn't much point losing sleep over it.

Can we expect the moderator to stop or cut short the GD much before the stipulated time is over?

This may happen if the GD becomes too noisy and if the level of discussion deteriorates abysmally.

Can I be aggressive with a lady participant?

A GD is not the place to demonstrate chivalry. Being rude to any participant (male or female) is downright unacceptable. You need

not extend any special privileges to a lady.

Is it all right to ask pointed questions to other participants during a GD?

It is alright to ask questions for the purpose of clarification but not for the purpose of playing the devil's advocate and proving them

wrong. By playing the devil's advocate you hamper the flow of the GD. The pointed questions unsettle the other participant and the

quality of the GD deteriorates. This would reflect badly on you and will go against your favour.

Is it necessary that a group should arrive at a conclusion in the stipulated time?

Ideally a group is supposed to reach a conclusion. Normally the time constraints do not allow the group to do so.

Is an end-summary absolutely essential?

No. If the group has not reached a conclusion, then it would be good if someone puts the whole discussion into perspective by

summarizing. But if there isn't sufficient time, a summary may be avoided.

Do we have to write a synopsis of the GD once it is over?

Some institutes insist on this, but it is not universal.

Is voting an acceptable method of reaching a consensus?

Certainly not. A GD is not a debate.

How should a group select a topic if asked to?

The group should brainstorm for about two minutes and narrow down the list of topics to 3-4. After this the group should prioritize

them based on the comfort level and ease of discussion of the topics. This could be done by asking each participant to rank the 4

topics and the most popular choice should be taken.

Are the topics decided on the basis of the academic background of the participant?

No. Topics are usually general in nature to give a level playing field to everyone.

What do I do if one member is very stubborn and aggressive?

You could use any of the following methods.

_ Ignore him and address the other members of the group.

_ Be assertive and tell him that his argument is faulty.

_ Point out to him that his point is well taken and that the group must progress further by discussing the ideas presented by


What ar
e the acceptable ways of interrupting somebody else, so that I may make my point?

You can interrupt in any of the following ways:

_ "Excuse me, but I feel that what you are saying isn't universally true ..."

_ "Yes, I agree with your idea, and I would like to add on to it …"

_ "Yes, I think you are right when you say that, but could you clarify what if …"

Basic computer Science Interview Questions

Notc:Attempt FIVE questions in all, including QUESTION NO. 8 which is COMPULSORY. Select at least ONE question from each of the SECTIONS -1, H and HI. All questions carry EQUAL marks. Illustrate your answer with diagrams and sketches wherever necessary. Answer-should be neat, clean and to the point. Avoid unnecessary details but record facts and any assumptions made. -;

1. (a) What is the BIOS and what functions are preformed by it?. ' (10)

(b) What is Virtual Memory and how many ways it is implemented? In this context describe some three process scheduling techniques? (10)

2. (a) What do you mean by a linear system? Give an example of it.

Explain how Gaussian elimination algorithm can be used to solve a linear system of equations? Why this algorithm is suitable for parallelization? ' (10) (b) ' Explain various addressing modes of instructions with examples. What is the process control Block and what are its functions. (10)

3. (a) What factors would you consider if you are asked to

design, a LAN from scratch? Assume that all Hardware

requirements can be. satisfied appropriately. (10)

(b) What is the basic difference between a Switch and a Hub
which device controls the collision domains battery (10)

4. (a) How the complexity of, an algorithm is-measurcd?

Define and explain Greedy Algorithms. (10)

(b) Discuss various types of team structure that can be formed for software development, Also explain briefly why the feasibility of producing quality software is' reduced if project risk is great. (10)

5 (a) Provide three examples of fourth generation Software Engineering technique, Explain COCOMO model for software estimation; Discuss your perception of ideal training send background for a system analyst.

(b) Differentiate between the parameter passing paradigm "calls by value" and "call by reference". Also find out the result of the following expressions. Execute each expression independently.
int a = 40. b = -8, c = 2, p * 9, q = 4, p= 12, x 5, >= 10
(a) x + =!(!x)*!!yc
(b) p = q + + %-q++
(c) x = (a% b> ?(a% c> 0 ? 3 ! 4 ): ( b> c ? 5 ! 6)
(d) P-=.q++%-q++
(e) x = P + + --q + + + h

(a) Describe various 2D-taransformations and represent them in normal form. (10)
(b) Explain the concept of ODBC, with the help of an architectural diagram.
What problems are caused by data redundancies? Can data redundancies be completely eliminated when the database, approach is used? Why or why not? (10) .

7--(a) Define 3NF, BCNF. Give an example of a relation in 3NF but not in BCNF. Transform that relation in BCNF. What arc checkpoints? Where they are used? Why? (10)

(b) With the help of appropriate diagram explain the CG! programming environment in detail. Write a CG! based Peri script that keeps track of the number of visitors to the home page of a certain site. (10)


8--(a) Write only True or False in the Answer Book. Do not reproduce the question. (1x10)
(1) A feature of an operating system that allows more than one program to run simultaneously is called Multitasking.
(2) A trackball operates like a joystick on its back. It is extremely useful when there isn't enough space to use a mouse,
(3) Digitizing Tablet is a'special Input device that is mainly used to digitize vector-oriented design or pictures.
(4) Dedicated line is a high speed cable line that is not permanently wired into the internet.
(5) A Router is a network device that helps LANs and WANs achieve interoperability and connectivity and thai can link LANs that have different netwoik topdldgies, such as Ethernet and Token Ring.
(6) Internet Protocol is a routable protocol in the backbone that is responsible for IP addressing, routing, and the fragmentation and reassembly of IP packets.

(7) Telnet is an Internet connection that enables a user to terminate an active connection with a computer at a retoete site.

(8) ESD stands for Electronic Static Distance.

(9) IRQ is Interrupt Request.

(10) Copyright computer programs made available on

trial basis are called shareware.

(b) Please choose^he most appropriate answer from the given set of answers. . (.1x5)

(11) What is the long form of 'CMOS'?

(a) Complimentary Metal Oxide Semiconductor V

(b) Complex Metal Oxide Semiconductor

(c) Controller Metal Oxide Semiconductor

(d) Complimentary Metal Oxide Sets.

(12) What is a Y-Connector? '

(a) A'Y-Shaped splitter cable that divides a source input into two output signals.

(b) A Y-Shaped splitter connector that divides a source input into two output signals.

(c) A Y-Shaped splitter card that divides'a source input into two output signals.

(d) None of the above. (]?') What do you mean by IBM-Compatible'?

fn) A computer that has a processor that is

compatible vvith the original IBM PC. (M A computer that has a processor that is similar

to original IBM PC (cm A computer that has a casing that is similar

original IBM PC. (d) None of the above

(14) What do you mean by "virtual? Select'all that apply:

(a) In general, it distinguishes something that is merely conceptual from something that has physical reality,

(b) Real (c) Not real. (d) None of the above

(15) Select correct statement describing a term 'stateless'?

(a) Having all information about what occurred previously

(b) Having some information aboot what occurred previously

(c) Having no information about what occurred previously

(d) Having new information about what occurred

previously (c) Write short answers to the following: (5)

(16) MAN

(17) Polymorphism in OOPS

(18) HTML

(19) Business management and IT.

(20) Usenet


NOTE:Attempt FIVE questions in all, including QUESTION No.8 which is COMPULSORY. Select at least ONE question from each of the SECTIONS-I, II and III. All, questions cany EQUAL marks.


1-(a) Explain the two strategic technologies to make the computer speedier; RISC and Parallel Processing. Hence also differentiate between RISC and CISC.(10)

(b) Discuss the sequential, indexed^ and direct data organization. (10)

2-(a) Explain, shortly, different file management systems.(10)
(b) Define and explain the Interleaved Processing Techniques. (10)

3-(a) Which are different tools to handle WAN traffic ? Explain them. (10)
(b) What are communication protocols? Define Full Duplex and Synchronous Transmissions.(10)


4-(a) Suppose that a non-negat*'ve weight w(e) is associated with each edge in an undirected graph G = (V, E), give an efficient algorithm to find an acyclic subset of E of total maximum weight. (10)

(b) How can th
e number of strongly connected components of a graph change if a new edge is added? (10)

5-(a) Differentiate between Object Oriented Programming and Procedural Programming. Also explain the concept of Abstraction in OOP. (10)

(b) Data-flow diagrams are means of documenting end-to-end data flow through a system;


6-(a) What is the difference between a data entity in first normal form (Inf) and second normal from (2NF)? Give an example of an entity in INF and show its conversion to 2NF. (10)

(b) List and briefly describe the three table operations used to manipulate relational tables. (10)

7-(a) What is Polygon Mesh Representation? Give at least two examples of polygon modeling strategies.(10)

(b) What are the tools to develop web pages in dynamic contents? (10)


(A) Write the terms, on your answer book, for whom the following abbreviations stand for:
(i) DML (ii) EDI (Hi) OLE
(iv) SDLS . " ' (v) RAID

(B) Please choose the most appropriate answer from the
given set of options about all the following given

(i) When all access and processing is done in one location, a computer system is said to be (a) networked (b) distributed (c) centralized (d) linked

(ii) Tools to change PROM chips, called (a) chip kits (b) RAM
(c) PROM burners (d) none of

(iii) The type of modulation that changes the height of the single is called (a) frequency (b) * phase (c) amplitude (d) prophase

(iv) A connection for similar network:
(a) satellite (b) bridge (c) gateway (d) fax

(v) The technology whereby part of the program is stored on disk and is brought into memory for execution as needed is called
(a) memory allocation
(b) virtual storage
(c) interrupts
(d) prioritized memory
..• v '' (5)

(C) Write '"True" or "False" in your answer book about the following statements:

(i) Application software may be either custom or packaged.
(ii) RISC technology uses more instructions than traditional computers.
(iii) A ring network has no central host computer.
(iv) Satellites use line-of-sight transmission.
(v) Time-sharing is both event-driven and time-driven.

(D) Write short answer to the following:

(i) Modularity • (ii) Teinet (iii) Cache Memory (iv) Applet (v) Function Overloading

(Computer Science)


NOTE:1.Attempt FIVE questions in all, including question No.8, which is compulsory. There should be at least ONE question from each section. All questions carry equal marks.

2 Illustrate your answers with diagrams and sketches where ever necessary.

3 Answers should be neat, clean and to the point. Avoid unnecessary details but record facts and any assumptions made.


1.a. Illustrate the basic computer architecture and define the functions of its main components. . . , (10)

b. Describe in detail the memory types used in computers. How data and instructions are communicated to and from the computer memory. (10)

2. a. Define the operating system and its functions. List different operating systems available in the market. (10)
b. Why scheduling is necessary in operating systems? Briefly describe various
scheduling policies. (10)

3. a. Illustrate a simple LAN model showing major LAN components and their functions. What types of changes need to be made in such a model if the speed of data communication is to be increased. (10)
b. Describe ISO reference Model. Explain at which layers, the TCP/IP works. (10)


4. Write a simple program in C/C++ to calculate the marks of each student appearing in this paper. The marks must be identified for each section (A,B ...), question (1,2,...) and part of the question (a, b, etc.). The program must calculate the total marks obtained subject to following conditions: 20

1) Only five questions are attempted. Student must attempt a compulsory question and at least one question from each section. Marks of one question will not be counted if no question is attempted from any one section.

2) All questions carry equal (20) marks each. All marks are equally divided in

3) There is no negative marking. Student must not get more than maximum marks allotted to the question attempted.

5. a. Describe the difference between a queue and a stack. How these are handled in a C/C++ program. Describe various situations in which you will use stack instead of queue. (10)
b. Briefly contrast various Software Development Life Cycle models and discuss
their effectiveness in appropriate situations. (10)


6. a. Define a data model. Describe various sets of information this model provides. Critically examine, which information (with respect to program development) is not described by the data model alone. (10)
b. A Relational model is commonly used database model. What are essential
characteristics of the Relational Model? and Why do we use normalization? (10)

7. a. Briefly contrast the uses of HTML, CGI, PERL, JAVA Applets in web page design. Where and when will you prefer to use these? (10)

b. What is meant by windowing and clipping operations? Describe the clipping techniques with examples. (10)


8. a. Identify TRUE and FALSE statements. (10)

1.Application program instructions are loaded in the main memory just before execution (True/False)

2. ALU performs control tasks. (True/False)

3. Paging operation in operating system is performed to allot page numbers to different chunks of data to be processed. (True/False)

4. The Basic difference between WAN and LAN is speed of data communication and not the size of data. (True/False)

5. Inheritance and Polymorphism are two essential properties considered in Object Oriented Programming. (True/False)

6. Tree structure will have more paths with the large size of same data. (True/False)

7. Object Oriented Methods use data and processes (on that data) defined as a single entity. (True/False)

8. E-R model also defines the minimum and maximum values in each relationship of data entities. (True/False)

9. Structured models do not use data model. (True/False)

10. Scanning is a process to convert hard copy of the computer files. (True/False)

b. Please choose the most appropriate answer from the given set of answers to fill the Blanks. (10)

1. During the program execution, temporary/intermediate values are stored in

(a) Registers (b) Peripherals (c) LAN (d) None of these

2. The objects can be inherited by ____________

(a) A Single Object only (b) Multiple Objects (c) Both (a) and (b) (d) Either (a) or (b)

3. The operating system may perform ______________ operation to manage the memory while running a large program.

(a) Sorting (b) Scheduling (c) Paging (d) None of these

4. When the LAN is arranged in such a way that each computer is connected directly to the HUB the configuration can be termed as ________ network.

(a) Bus (b) Star (c) Ring (d) None of these

5. To communicate with other computers over a telephone line the computer must have ___________ installed.

(a) Telephone set (b) Modem (c) LAN Card (d) None of these

6. When each item of data in a database is directly linked with every other item of data, the database is called . database.

(a) Relational (b) Hierarchical (c) Network (d) None of these

7. _______________ is the most efficient method to reduce the duplication of data.

(a) Duplication (b) Normalization (c) Empty fields (d) All of these

8,. The __________ operation changes the coordinate values of objects being displayed.

(a) Transformation (b) Windowing (c) Both (a) and (b) (d) None of these

9. A linear sequential software development model is also referred to as

(a) Prototype Model (b) RAD Model (c) Spiral Model (d) None of these

10. State Transition Diagram gives information of______________

(a) Data Flow (b) Entity Relationship (c) Control Flow (d) None of these.



1.Why doesn't this code:

a[i] = i++;



The subexpression i++ causes a side effect--it modifies i's value--which leads to undefined behavior since i is also referenced elsewhere in the same expression. (Note that although the language in K&R suggests that the behavior of this expression is unspecified, the C Standard makes the stronger statement that it is undefined

2.So given

a[i] = i++;

we don't know which cell of a[] gets written to, but i does get incremented by one.


No. Once an expression or program becomes undefined, all aspects of it become undefined.

3.What is this infamous null pointer, anyway?


The language definition states that for each pointer type, there is a special value--the ``null pointer''--which is distinguishable from all other pointer values and which is ``guaranteed to compare unequal to a pointer to any object or function.'' That is, the address-of operator & will never yield a null pointer, nor will a successful call to malloc. (malloc does return a null pointer when it fails, and this is a typical use of null pointers: as a ``special'' pointer value with some other meaning, usually ``not allocated'' or ``not pointing anywhere yet.'')

A null pointer is conceptually different from an uninitialized pointer. A null pointer is known not to point to any object or function; an uninitialized pointer might point anywhere.

4. I think something's wrong with my compiler: I just noticed that sizeof('a') is 2, not 1 (i.e. not sizeof(char)).


Perhaps surprisingly, character constants in C are of type int, so sizeof('a') is sizeof(int) (though it's different in C++).

A Good One

5. How can I print a '%' character in a printf format string? I tried \%, but it didn't work.

Simply double the percent sign: %% .

\% can't work, because the backslash \ is the compiler's escape character, while here our problem is that the % is printf's escape character.

6. Under my compiler, the code

int i = 7;
printf("%d\n", i++ * i++);

prints 49. Regardless of the order of evaluation, shouldn't it print 56?


Although the postincrement and postdecrement operators ++ and -- perform their operations after yielding the former value, the implication of ``after'' is often misunderstood. It is not guaranteed that an increment or decrement is performed immediately after giving up the previous value and before any other part of the expression is evaluated. It is merely guaranteed that the update will be performed sometime before the expression is considered "finished'' . In the example, the compiler chose to multiply the previous value by itself and to perform both increments afterwards.

The behavior of code which contains multiple, ambiguous side effects has always been undefined. (Loosely speaking, by ``multiple, ambiguous side effects'' we mean any combination of ++, --, =, +=, -=, etc. in a single expression which causes the same object either to be modified twice or modified en inspected. Don't even try to find out how your compiler implements such things (contrary to the ill-advised exercises in many C textbooks); as K&R wisely point out, ``if ou don't know how they are done on various machines, that innocence may help to protect you.''

7.What's a ``sequence point''?


A sequence point is the point (at the end of a full expression, or at the ||, &&, ?:, or comma operators, or just before a function call) at which the dust has settled and all side effects are guaranteed to be complete. The ANSI/ISO C Standard states that Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored.

The second sentence can be difficult to understand. It says that if an object is written to within a full expression, any and all accesses to it within the same expression must be for the purposes of computing the value to be written. This rule effectively constrains legal expressions to those in which the accesses demonstrably precede the modification.

A Good One
8. Are pointers really faster than arrays? How much do function calls slow things down? Is ++i faster than i = i + 1?


Precise answers to these and many similar questions depend of course on the processor and compiler in use. If you simply must know, you'll have to time
test programs carefully. (Often the differences are so slight that hundreds of thousands of iterations are required even to see them. Check the compiler's
assembly language output, if available, to see if two purported alternatives aren't compiled identically.)

It is ``usually'' faster to march through large arrays with pointers rather than array subscripts, but for some processors the reverse is true.

Function calls, though obviously incrementally slower than in-line code, contribute so much to modularity and code clarity that there is rarely good reason to
avoid them.

Before rearranging expressions such as i = i + 1, remember that you are dealing with a compiler, not a keystroke-programmable calculator. Any decent
compiler will generate identical code for ++i, i += 1, and i = i + 1. The reasons for using ++i or i += 1 over i = i + 1 have to do with style, not

9. Why doesn't the code

int a = 1000, b = 1000;
long int c = a * b;



Under C's integral promotion rules, the multiplication is carried out using int arithmetic, and the result may overflow or be truncated before being promoted
and assigned to the long int left-hand side. Use an explicit cast to force long arithmetic:

long int c = (long int)a * b;

Note that (long int)(a * b) would not have the desired effect.

A similar problem can arise when two integers are divided, with the result assigned to a floating-point variable.

10. I have a complicated expression which I have to assign to one of two variables, depending on a condition. Can I use code like this?

((condition) ? a : b) = complicated_expression;


No. The ?: operator, like most operators, yields a value, and you can't assign to a value. (In other words, ?: does not yield an lvalue.) If you really want to,
you can try something like

*((condition) ? &a : &b) = complicated_expression;

although this is admittedly not as pretty.

11. Does *p++ increment p, or what it points to?


Unary operators like *, ++, and -- all associate (group) from right to left. Therefore, *p++ increments p (and returns the value pointed to by p before the
increment). To increment the value pointed to by p, use (*p)++ (or perhaps ++*p, if the order of the side effect doesn't matter).

A Good One
12. How can I implement a variable field width with printf? That is, instead of %8d, I want the width to be specified at run time.


printf("%*d", width, n) will do just what you want.

A Good One
13. How can I specify a variable width in a scanf format string?


You can't; an asterisk in a scanf format string means to suppress assignment. You may be able to use ANSI stringizing and string concatenation to
accomplish about the same thing, or to construct a scanf format string on-the-fly.

14. Can I declare main as void, to shut off these annoying ``main returns no value'' messages?


No. main must be declared as returning an int, and as taking either zero or two arguments, of the appropriate types. If you're calling exit() but still getting
warnings, you may have to insert a redundant return statement (or use some kind of ``not reached'' directive, if available).

Declaring a function as void does not merely shut off or rearrange warnings: it may also result in a different function call/return sequence, incompatible with
what the caller (in ma
in's case, the C run-time startup code) expects.

(Note that this discussion of main pertains only to ``hosted'' implementations; none of it applies to ``freestanding'' implementations, which may not even
have main. However, freestanding implementations are comparatively rare, and if you're using one, you probably know it. If you've never heard of the
distinction, you're probably using a hosted implementation, and the above rules apply.)

15. The book I've been using, C Programing for the Compleat Idiot, always uses void main().


Perhaps its author counts himself among the target audience. Many books unaccountably use void main() in examples. They're wrong.

16. I have a char * pointer that happens to point to some ints, and I want to step it over them. Why doesn't

((int *)p)++;



In C, a cast operator does not mean ``pretend these bits have a different type, and treat them accordingly''; it is a conversion operator, and by definition it
yields an rvalue, which cannot be assigned to, or incremented with ++. (It is an anomaly in pcc-derived compilers, and an extension in gcc, that expressions
such as the above are ever accepted.) Say what you mean: use

p = (char *)((int *)p + 1);

or (since p is a char *) simply

p += sizeof(int);

Whenever possible, you should choose appropriate pointer types in the first place, instead of trying to treat one type as another.

17. If NULL and 0 are equivalent as null pointer constants, which should I use?


Many programmers believe that NULL should be used in all pointer contexts, as a reminder that the value is to be thought of as a pointer. Others feel that the
confusion surrounding NULL and 0 is only compounded by hiding 0 behind a macro, and prefer to use unadorned 0 instead. There is no one right answer. (See
also questions 9.2 and 17.10.) C programmers must understand that NULL and 0 are interchangeable in pointer contexts, and that an uncast 0 is perfectly
acceptable. Any usage of NULL (as opposed to 0) should be considered a gentle reminder that a pointer is involved; programmers should not depend on it
(either for their own understanding or the compiler's) for distinguishing pointer 0's from integer 0's.

NULL should not be used when another kind of 0 is required, even though it might work, because doing so sends the wrong stylistic message. (Furthermore,
ANSI allows the definition of NULL to be ((void *)0), which will not work at all in non-pointer contexts.) In particular, do not use NULL when the ASCII null
character (NUL) is desired. Provide your own definition

#define NUL '\0'

if you must.

18.This is strange. NULL is guaranteed to be 0, but the null pointer is not?


When the term ``null'' or ``NULL'' is casually used, one of several things may be meant:

1.1. The internal (or run-time) representation of a null pointer, which may or may not be all-bits-0 and which may be different for different pointer
types. The actual values should be of concern only to compiler writers. Authors of C programs never see them, since they use...
2.2. The null pointer constant, which is a constant integer 0 . It is often hidden behind...
3.3. The NULL macro, which is #defined to be 0 or ((void *)0) . Finally, as red herrings, we have...
4.4. The ASCII null character (NUL), which does have all bits zero, but has no necessary relation to the null pointer except in name; and...
5.5. The ``null string,'' which is another name for the empty string (""). Using the term ``null string'' can be confusing in C, because an empty string
involves a null ('\0') character, but not a null pointer, which brings us full circle...

19. Is char a[3] = "abc"; legal? What does it mean?


It is legal in ANSI C (and perhaps in a few pre-ANSI systems), though useful only in rare circumstances. It declares an array of size three, initialized with
the three characters 'a', 'b', and 'c', without the usual terminating '\0' character. The array is therefore not a true C string and cannot be used with
strcpy, printf %s, etc.

Most of the time, you should let the compiler count the initializers when initializing arrays (in the case of the initializer "abc", of course, the computed size
will be 4).

20. What's the difference between calloc and malloc? Is it safe to take advantage of calloc's zero-filling? Does free work on memory allocated with calloc, or do you need a cfree?


calloc(m, n) is essentially equivalent to

p = malloc(m * n);
memset(p, 0, m * n);

The zero fill is all-bits-zero, and does not therefore guarantee useful null pointer values (see section 5 of this list) or floating-point zero values. free is
properly used to free the memory allocated by calloc.

21. What's the difference between const char *p and char * const p?


char const *p declares a pointer to a constant character (you can't change the character); char * const p declares a constant pointer to a (variable)
character (i.e. you can't change the pointer).

22. What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?


The ANSI/ISO Standard says that it may do either; the behavior is implementation-defined

23. What's wrong with this code?

char c;
while((c = getchar()) != EOF) ...


For one thing, the variable to hold getchar's return value must be an int. getchar can return all possible character values, as well as EOF. By passing
getchar's return value through a char, either a normal character might be misinterpreted as EOF, or the EOF might be altered (particularly if type char is
unsigned) and so never seen.

24. How can I convert numbers to strings (the opposite of atoi)? Is there an itoa function?


Just use sprintf. (Don't worry that sprintf may be overkill, potentially wasting run time or code space; it works well in practice.)
You can obviously use sprintf to convert long or floating-point numbers to strings as well (using %ld or %f).

25. How can I get random integers in a certain range?


The obvious way,

rand() % N /* POOR */

(which tries to return numbers from 0 to N-1) is poor, because the low-order bits of many random number generators are distressingly non-random.
A better method is something like

(int)((double)rand() / ((double)RAND_MAX + 1) * N)

If you're worried about using floating point, you could use

rand() / (RAND_MAX / N + 1)

Both methods obviously require knowing RAND_MAX (which ANSI #defines in ), and assume that N is much less than RAND_MAX.

(Note, by the way, that RAND_MAX is a constant telling you what the fixed range of the C library rand function is. You cannot set RAND_MAX to some other
value, and there is no way of requesting that rand return numbers in some other range.)

If you're starting with a random number generator which returns floating-point values between 0 and 1, all you have to do to get integers from 0 to N-1 is
multiply the output of that generator by N.

Data Structures FAQ's

1. Simple Questions.
1) When we talk about linked lists, does it have to do with (choose the most
closely related item):
i. data types (such as priority queues)
ii. goals (such as adaptability)
iii. implementation (of, say, a sequence)
2) Underscore the line(s) (if any) in the following code which potentially break
the principle of encapsulation:
class Node {
public Object element;
public Node next;
Node() { this(null, null); }
void setNext(Node newText) { next = newText; }
Node getNext() { return next; }
3) What is the primary reason to use quadratic probing instead of linear probing?
(choose the most closely related item):
i. Easier to expand the hash table when it gets full
ii. To avoid the primary cluster which may cause excessive data collision
iii. Achieve the same search time with less memory
iv. Easier to support delete
4) Suppose that there are N distinct elements in a binary heap (with the maximum
at the root). Which positions could possibly be occupied by the fourth largest
i. 1
ii. 2 or 3
iii. 4 through 7
iv. 2 through 15
v. 16 and higher
5) Characterize, using the big-Oh notation, the worst-case running time of the
following algorithm:
Let A be a given array of n integers.
for i <- 0 to n-1 do
for j <- 0 to (i*i)-1 do
Let A[j mod n] <- j.
end for
end for
Best characterization: O(_______).
2. (Linked list) Recall we did singly linked list in PA #4. To refresh your memory,
· Consider a list with elements (1,2,3,4,5)
· The list will be like 1 2345
Singly linked list doesn’t have loops. Suppose your friend (call him Bob)
has inadvertently introduced a loop into his implementation on PA #4
· Consider a list with elements (1,2,3,4,5)
· Let 3 point to 1 instead of pointing to 4
· The list will be like 1 23 45
Since most of your friends suffer from the same bug while implementing PA#4
you decide to help them by writing a function which detects loops in a singly
linked list.
· Write program that outputs ‘false’ if there is no loop in the list input and
‘true’ if there is a loop in a list output
· Fill in the following code
o class list_sorted {
// You need to implement this
bool FindLoop() {
node* pHead;
o struct node{
int x;
node* next;
· Hint:
o Change the node data structure. Have some sort of counter which
indicates how many times a node is visited when you traverse through
the link list.
o There might be better ideas than this!
3. (Hash table) You have a hash table of size m = 11 and two has functions h1 and h2:
h1(x) = (sum of the values of the first and last letters of x) mod m
h2(x) = ((value of the last letter) mod (m – 1)) + 1
Where the value of a letter is its position in the alphabet, as in the following table:
a b c d e f g h i g k l m
1 2 3 4 5 6 7 8 9 10 11 12 13
n o p q r s t u v w x y z
14 15 16 17 18 19 20 21 22 23 24 25 26
1) Draw a picture of the resulting hash table after inserting the following words (by
the order):
ibex, hare, ape, bat, koala, mud, dog, carp, stork
2) Highlight cells that are looked at when trying to find bird. Do this for each of the
following techniques.
Chaining with h1 as your hash function.
Linear probing with h1 as your hash function.
4. (Heap) Give an algorithm for changing the value of an arbitrary element from a heap
of size N. Also, determine the worst case time complexity of your algorithm.
Describe your algorithm in pseudo-code. You may assume that the position of the
element whose value to be changed is given.
5. (Binary tree) Let T be a binary tree.
1) If T has seven nodes, what is its minimum height?
What is its maximum height?
Draw two trees with seven nodes that achieve the minimum and maximum height,
2) When deleting a node of a binary search tree, if we decide to replace it with a
node in its left subtree (of course, if it has one), which node should we choose?
3) A particular binary search tree has the following known about it:
A pre-order traversal yields 88, 6, 1, 3, 2, 5, 4, 30, 10, 20.
A post-order traversal yields 2, 4, 5, 3, 1, 20, 10, 30, 6, 88.
Draw this tree.
4) What is the in-order traversal of the tree from 3)?
5) Using the node values from 3), draw a minimal-height BST. Make it a complete
6. (Inheritance) Consider at the following code [each class is in the appropriately
named file]:
class Animal {
virtual void describe() {
class Rabbit: public Animal {
Rabbit() { Animal(); }
void describe() {
void hop () {
System.out.println ("Hop");
class Dog: public Animal {
Dog() {}
void describe() {
class Poodle: public Dog {}
1) List all constructors called for each line.
Code Constructor Calls
Animal a = new Dog();
Rabbit r = new Rabbit();
Poodle p = new Poodle();
Animal a2 = a;
2) What is output of the following lines? If it is a CT / RT exception, say
so. Assume each line is executed independently (no cascading errors).
Code Output
(new Animal()).describe();
(new Rabbit()).describe();
(new Dog()).describe();
(new Poodle()).describe();
Animal a = new Rabbit();
Animal b = new Rabbit();
7. (String searching) This question is about the problem of searching for any
occurrence of an M-character pattern in an N-character text string. Suppose that
student X uses the brute-force method and student Y uses the right-left scan. The
students are each given the option of picking from among one of the three string
generators listed below for both programs to be tested on (both pattern and text to be
generated from the same generator, then both programs invoked on the same input).
A. random string of As and Bs
B. random ASCII characters
C. all As except last character is B
Fill in the blanks to give the best choice and expected results from each students' point of
view. (If the asymptotic number of character compares is the same, answer "1".)
(a) For X's choice _______, brute-force is a factor of _______ faster than right-left.
(b) For Y's choice _______, right-left is a factor of _______ faster than brute-force.
8. (Operator overloading) Provide the declarations of the overloaded operator+ for F1
that will permit the two add operations shown in main().
class F1 {
int data;
F1 a;
9. Indicate true or false.
class A1 {
int a;
char* name;
A1(char* n){name=new char[strlen(n)+1];
memcpy(name, n, strlen(n)+1);}
int b;};
class D1 : public A1{
int data;
class D2 : private A1{};
a. The “public” constructor for A1 allocates memory from global heap for the
private member “name” therefore “name” can be direcly accessed by class D2,
which is derived from A1.
b. Since D2 inherits A1 as a public class, both the private members of A1 are
directly accessible within D2.
10. (set) Suppose the set s is declared with
set s;
Write the definition of the function removeOdd() that will remove all odd integers
belonging to s with the call
11. (doubly linked list) (a) Why do some programmers like to have dummy nodes at
each end of a doubly linked list? (b) What are the disadvantages of having dummy nodes
at th
e beginning of the list?
12 (map) Suppose we want a data structure that allows us to look up a person's name and
address from his or her social security number. (a) How would you use an STL map for
this? (b) How long does it take to access the name and/or address from a social security
number in this data structure?

Saturday, July 19, 2008





4) If a car starts from A towards B with some velocity due to some problem in the engine after travelling 30km.If the car goes with 4/5 th of its actuval velocity the car reaches B 45min later to the actual time. If the car engine fails ofter travelling 45km, the car reaches the destination B 36min late to the actual time , what is the initial velocity of car and what is the distance between A and B in km
ans) 20 & 130.

5)The values of shares A,B and C from january to june are as follows.

month A B C
JAN 30 60 80
FEB 35 65 85
MAR 45 75 65
APR 40 75 82
MAY 55 75 85
JUNE 50 75 80

i) During this period which share has undergone max fluctuation?

ii) In which month it is possible to buy B and C selling A?

iii) In which month the share values are very low?

iv) By purchasing one share of A and 4 each of B and C in the beginning of
the period , to get max profit when this shares should be sold?
v) ?

6. In a computer institute 9 languages can taught. The module is of 6
months duration and only six languages each of one month can be taught.
In addition to that BASIC is always there and should be in first month
# word perfect is to be taught in the preceeding week of word star.
# FORTRAN can not be taught until COBAL is coarsed prior to that
# BINO, FIFO never be taught in single module

i. Of the following which module is possible based on above conditions.

ii) If word star is in 3rd month , what could be in 6th month.

iii) If COBAL is in the 2nd month and BINO in 6th month are there in
addition to the above condition, FORTRAN will be in which month.

7. In a class , except 18 all are above 50 years. 15 are below 50 years of
age. how many people are there
a) 30 b) 33 c) 36 d) none of these.

8. A square plot of some size , at four corners equal squares of some size
are cut and is formed as open box. If this open box carries 128ml of oil.
What is the size of the plate i.e. side
a.17 b.14 c.13

9. In a square , all the mid points are joined. the inner square is
shaded. If the area of the square is A, what is the shaded area?

10. two questions on basic angles i.e given a circle, a few chords or
diameter is drawn etc.

11. @(a,b)= (a+b)/2
/(a,b)= a.b
*(a,b)= ab , if a=1, b=2 find
i) /(a,(@(a,b),*(a,b)))


12. (x#y) = x+y-xy
(x*y) = (x+y)/2

i) (x#y)#(x*y) < (x#y), which of the below values of x, y will satisfy
this equation

ii) (a*b)#(b*c)< (a#b)*(b*c) , what values of a,b,c satisfy the above.

13. By using the data given below answer the following questions. M.A

male 20
female 80

total 60
some thing similar to that question.
i) 40% of females are B.Techs
ii) Half of the students are either from B.Techs of M.Scs
iii) ...
i. what is the no. of female B.techs

14)L:says all of my other 4 friends have money
M:says that P said that exact one has money
N:says that L said that precisely two have money
O:says that M said that 3 of others have money.
P:Land N said that they have money.
all are liers.Who has money&who doesn't have?

15)A hotel has two,the east wing and the west wing.some east wing rooms
but not all have an ocean view(OV).All WW have a harbour view(HV).The
charge for all rooms is identical, except as follows
* Extra charge for all HV rooms on or above the 3rd floor
* Extra charge for all OV rooms except those without balcony
* Extra charge for some HV rooms on the first two floor&some EW rooms
without OV but having kitchen facilities. (GRE modrl Test 3-question

16)Post man has a data of name surname door name of 4 families.
But only one is correct for each family.There are a set of statements

17)4 couples have a party.Depending on the set of statements,find who
insulted whom and who is the host of the party.

18)5 women given some of their heights(tall,medium,short)Hair( long,
plainted),stards(Black or Brown), sari,2 medium,2-short.Tall->no
sari.Plainted->medium.Answer the combinations.
1) A person has to go both Northwards&Southwards in search of a job.
He decides to go by the first train he encounters.There are trains for
every 15 min both southwards and northwards.First train towards south
is at 6:00 A.M. and that towards North is at 6:10 .If the person arrives
at any random time,what is the probability that he gets into a train
towards North.

19) A person has his own coach&whenever he goes to railway station he
takes his coach.One day he was supposed to reach the railway station
at 5 O'clock.But he finished his work early and reached at 3 O'clock.
Then he rung up his residence and asked to send the coach immediately.
He came to know that the coach has left just now to tje railway station.
He thought that the coach has left just now to the railway station.He
thought that he should not waste his time and started moving towards
his residence at the speed of 3mi/hr.On the way,he gets the coach and
reaches home at 6 o'clock.How far is his residence from railway

20)Radha,Geeta&Revathi went for a picnic.After a few days they forgot the
date,day and month on which they went to picnic.Radha said that it was
onThursday,May 8 and Geeta said that it was Thursday May 10.Revathi
said Friday Jun 8.Now one of them told all things wrongly,others one
thing wrong and the last two things wrongly.If April 1st is tuesday
what is the right day,date and month?


21) Q is not equal to zero and k = (Q x n - s)/2 find n?
(a) (2 x k + s)/Q (b) (2 x s x k)/Q (c) (2 x k - s)/Q
(d) (2 x k + s x Q)/Q (e) (k + s)/Q

(from GRE book page no:411)
A causes B or C, but not both
F occurs only if B occurs
D occurs if B or C occurs
E occurs only if C occurs
J occurs only if E or F occurs
D causes G,H or both
H occurs if E occurs
G occurs if F occurs

NOTE: check following answers.

22) If A occurs which of the following must occurs

I. F & G
II. E and H

(a) I only (b) II only (c) III only (d) I,II, & III
(e) I & II (or) II & III but not both ans: (e)

23) If B occurs which must occur
(a) D (b) D and G (c) G and H (d) F and G (e) J ans: (a)

24) If J occurs which must have occured
(a) E (b) either B or C (c)
both E & F (d) B (e) both B & C ans: (b)

25) which may occurs as a result of cause not mentioned
(1) D (2) A (3) F
(a) 1 only (b) 2 only (c) 1 & 2 (d) 2 & 3 (e) 1,2,3 ans: (c)

26) E occurs which one cannot occurs
(a) A (b) F (c) D (d) C (e) J ans: (b)
11 to 15:- ----------- e , a , b , c , b ---------------

27) There r 3 boys 7 4 girls; Howmany ways they r arranged
such that boys should be always together ???

(Ans: 240

28) If n.....; What is the max no that divides

(Ans: 8)

29) A,B,C,D has values from 0 to 9.... What is D ?

(Ans: 6)

30) A wodden piece taken which is in shape of Triangle ,
of 10 X 24 X 26 ; Then cut at some ..... which is rearranged
in rectangle format; so what is ...

(Ans: 5)

31) There r 5 numbers. The average is 25; the highest value
excluded then average is 25, if the lowest is excluded the avg is ..
Then average of remaining is ?

(Ans: 30)

32) The square is cut such that the end point of one side is
shown in fig.. This is repeated two times, what is the area ??

(Ans: 3.61)

33) The route problem... what is the shortest rout to p1 to p2...
(There may be circle figure......)

(Ans: From p1 to 0 & form 0 to p8)

34) Two motor cycles A & B are started from one point at
4 Kmph & 6 Kmph; After 45 min B starts returning , at what
time they will reach....

(Ans: 3.6 km)

35) All integer from 0 to 9, what is the smallest no perfectly devides;

(Ans: c)