MICROSOFT PAPER ON 5TH SEPTEMBER,2008

4 04 2009

Question 1. [10]
Find the output of the following program segment
#include
char *c[]={“ENTNG”, “NST”,”AMAZI”,”FIRBE”};
char** cp[]={c+3, c+2, c+1, c};
char ***cpp= cp;
void main() {
printf(“%s”,**++cpp);
printf(“%s “,*–*++cpp+3);
printf(“%s”,*cpp[-2]+3);
printf(“%s”,cpp[-1][-1]+1);
}

Question 2. [5]
Write a function delete(struct node** Head) to delete the linked list node by node by deallocating them from the memory and at the end assign the head pointer to NULL.
void deleteListTest(struct node* headRef) {
struct node* myList=Listonetwothree();
delete(headRef);
}
//write your code here

Question 3. [10]
Write a function Compute(int x) such that it prints the values of x, 2x, 4x, 8x …. till the value doesn’t exceed 20000. After reaching 20000, it again comes back from …8x, 4x, 2x, x and stops there.
Note: (1) You can’t use any local variables in the function
(2) You can’t use any loops (for or while or do..while) or any GOTO statement.

Question 4. [10]
List all data structures you would use for a memory management module.

Question 5. [5]
Share 2 high complexity and 2 low complexity test cases for a coke vending (ATM) machine.

Question 6. [10]
Explain 3 high priority test cases for the performance of MSN search engine.

Answers:
Two of the trickiest questions and the easiest ones:
(1) AMAZING BEST
(3)void Compute  (int x) {
cout<if(x<20000) {
Compute(x*2);
}
cout<}





Compaq Placement Paper (OS, Networking & C)

10 02 2009

Paper: Compaq Placement Paper (OS, Networking & C)

1.Why paging is used ?

2.Which is the best page replacement algo and Why ?

3.What is software life cycle ?

4.How much time is spent usually in each phases and why ?

5.What is testing ?

6.Which are the different types of testing ?

7.Which are the different phases in Software life cycle (asked again)

8.Why is analysis and testing phases very important ?

9.Why networks are layered ? What is the advantage of that ?

10.How many layers are there in OSI ? Why is it called OSI model ?

11.network topologies ?

12.Which are the different network toplogies ?

13.an example of bus type network.

14.What is the Bandwidth of ethernet ?

15.Explain the advantage and disadvantage of ethernet ?

16.Which is the protocol used in ethernet. (CSMA/CD) Why is it called so ?

17.What is the advantage of Ring network ?

18.Compare it with ethernet.

19.What is inheritance, encapsulation etc.

20.If there are too many page faults what is the problem?

21.To ensure one pgm. doesnt corrupt other pgm. in a Multi-pgm. enviornment

22.What you should do?

23.Which one you will use to implement critical section? Binary Semaphore

24.Which one is not needed for Multi-pgm. enviornment?

25.options are: virtual memory,security,time sharing,none of the above.

26.Which one is not done by Data link layer ? bit stuffing, LRC,CRC,parity check

27.Which one is not related to Data link layer?

28.Which one is not suitable for client-server application? tcp/ip,message passing,rpc,none of the above.

29.Term stickily bit is related to a)kernel b)undeletable file c) d)none

30.semaphore variable is different from ordinary variable by ?

31.unix system is

a)multi processing

b)multi processing ,multiuser

c)multi processing ,multiuser,multitasking

d)multiuser,multitasking

32.x.25 protocol encapsulates the follwing layers

a)network

b)datalink

c)physical

d)all of the above

e)none of the above

33.TCP/IP can work on

a)ethernet

b)tokenring

c)a&b

d)none

34.a node has the ip address 138.50.10.7 and 138.50.10.9.But it is transmitting data from node1 to node2only. The reason may be

a)a node cannot have more than one address

b)class A should have second octet different

c)classB ” ” ” ” “

d)a,b,c

35.the OSI layer from bottom to top for an application which exceeds 64k the memory model should be

a)medium

b)huge

c)large

d)none

36.the condition required for dead lock in unix system is set-user-id is related to (in unix) bourne shell has

37.wrong statement about c++

a)code removably

b)encapsulation of data and code

c)program easy maintenance

d)program runs faster

38.which is true

a)bridge connects dissimiler LANand protocol insensitive

b)router ” ” ” ” “

c)gateway ” ” ” ” “

d)none of the above

C SKILL SET

1.How do you write a program which produces its own source code as its output?

2.How can I find the day of the week given the date?

3.Why doesn’t C have nested functions?

4.What is the most efficient way to count the number of bits which are set in a value?

5.How can I convert integers to binary or hexadecimal?

6.How can I call a function, given its name as a string?

7.How do I access command-line arguments?

8.How can I return multiple values from a function?

9.How can I invoke another program from within a C program?

10.How can I access memory located at a certain address?

11.How can I allocate arrays or structures bigger than 64K?

12.How can I find out how much memory is available?

13.How can I read a directory in a C program?

14.How can I increase the allowable number of simultaneously open files?

15.What’s wrong with the call “fopen(“c:newdirfile.dat”, “r”)”?





C Sharp Interview Questions

10 02 2009

C Sharp Interview Questions

1) Explain about C#?

Ans:-C # is also known as c sharp. It is a programming language introduced by Microsoft. C# contains features similar to Java and C++. It is specially designed to work with Microsoft .NET platform.

2) Explain about the rules for naming classes in C#?

These are the rules for naming classes in c sharp.
• Must begin with a letter. This letter may be followed by a sequence of letters, digits (0-9), or ‘_’. The first character in a class name cannot be a digit.
• Must not contain any embedded space or symbol like ? – + ! @ # % & . ( ) { } [ ] , : ; ‘ “ and/. However an underscore _ can be used wherever a space is required.
• Must not use a keyword for a class name.

3) What are the rules to be followed while naming variables in C#.

The following rules are used for naming variables in C#.
• Must begin with a letter or an underscore _ which may be followed by a sequence of letters, digits (0-9), or ‘_’. The first character in a variable name cannot be a digit.
•Must not contain any embedded space or symbol like ? – + ! @ # % & . ( ) { } [ ] , : ; ‘ “ and/. However an underscore _ can be used wherever a space is required.
• Must be unique
• Can have any number of characters
• Keywords cannot be used as variable names.

4) What are the different types of Data?

There are two different types of data supported by C#. They are:-

1) Value types: -They directly contain data. When you declare an int variable, the system allocates memory to store the value.
2) Reference type: -The reference types do not maintain data but they contain a reference to the variables, which are stored in memory. This means that if the value in the memory location is modified by one of the variables, the other variables automatically reflect the changes value

5) Explain about member functions?

Ans:-A function is a set of statements that perform a specific task in response to a message. The functions of a class are called member functions in C-sharp. Member functions are declared inside the class. The function declaration introduces the function in the class and the function definition contains the function code.

6) Explain about comment entry?

Ans:-Comments are a part of the program and are used to explain the code. Compilers ignore comment entries. If a comment entry spans more than one line, it has to be enclosed within ‘/.’ and ‘./’. The symbol ‘//’ treats the rest of code within the same line as a comment.

7) What are operators?

Ans:-Applications use operators to process the data entered by a user. Operators like + and – are used to process variables and return a value. An operator is a set of one or more characters that is used for computations or comparisons. Operators can transform one or more data values, called operands into a new data value.
8) Explain about the break statement?

Ans:-A break statement is used to exit the switch statement. This prevents the execution of the remaining case structures by ending the execution of the switch case construct. Each break statement terminates the enclosing switch statement and the flow of control. If none of the cases match the default case is invoked.

9) Define encapsulation?

Ans:-Encapsulation literally means to enclose in or as if in a capsule. Encapsulation is defined as the process of enclosing one or more items within a physical or logical package. It involves preventing access to nonessential details.

10) Define access specifiers with reference to class?

Ans:-An access specifier defines the scope of a class member. A class member refers to the variables and functions in a class. A program can have one or more classes. You may want some members of a class to be accessible to other classes. But, you may not want some other members of the class to be accessible outside the class.

11) Describe about private access specifier?

Ans:-The private access specifier allows a class to hide its member variables and member functions from other class objects and functions. Therefore, the private member of a class is not visible outside a class. If a member is declared private, only the functions of that class can access the member. Even the instance of the class cannot access its members

12) Explain about protected internal access specifier?

Ans:-This specifier allows a class to hide its member variables and member functions to be accessed from other class objects and functions, except the child class, within the application. The protected internal access specifier becomes important while implementing inheritance.

13) Define parameter by value?

Ans:-Pass by value is the default mechanism for passing parameters to a method. The simplest definition of a value parameter is a data type name followed by a variable name. When a method is called, a new storage location is created for each value parameter. The values of the corresponding expressions are copied into them. The expression supplied for each value parameter must be similar to the declaration of the value parameter.

14) State the methods through which parameters can be passed?

Ans:-Parameters can be passed by using any one of the following mechanism.

Value: -They are sometimes called in or out parameters; therefore, the data can be transferred into the method but cannot be transferred out.
Reference: -Are sometimes called in or out parameters, therefore, the data can be transferred into the method and out again.
Output: -Are sometimes called out parameters, data can be transferred out of the method.

15) Explain about reference parameter?

Ans:-A reference parameter is a reference to a memory location of a data member. Unlike a value parameter, a reference parameter does not create a new storage location. Instead a reference parameter represents the same location in memory as the variable that is supplied in the method call.

16) How do you use a structure?

Ans:-A structure is a value type data type. When you want a single variable to hold related data of various data types, you can create a structure. To create a structure you use the struct keyword.

17) What is an enumerator?

Ans:-Enumeration is a value data type, which means that enumeration contains its own values and cannot inherit or pass inheritance. Enumerator allows you to assign symbolic names or integral constants.





Accenture IDC Recruitment Latest Paper (Technical-C)

10 02 2009

Paper: Accenture IDC Recruitment Latest Paper (Technical-C)

1.Study the Following Points:
a.One Cannot Take the address of a Bit Field
b.bit fields cannot be arrayed
c.Bit-Fields are machine Dependant
d.Bit-fields cannot be declared as static
Which of the Following Statements are true w.r.t Bit-Fields
A)a,b&c B)Only a & b C)Only c D)All

2.What is the function of ceil(X) defined in math.h do?
A)It returns the value rounded down to the next lower integer
B)it returns the value rounded up to the next higher integer
C)the Next Higher Value
D)the next lower value

3.When do you say that a digraph is acyclic
A)if and only if its first search does not have back arcs
B)a digraph is acyclic if and only if its first search does not have back vertices
C)if and only if its first search does not have same dfnumber
D)None of these

4.A function ‘q’ that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as:
A)int (*q(char*)) []
B)int *q(char*) []
C)int(*q)(char*) []
D)None of the Above

5.What kind of sorting is this:

SORT (k,n)
1.[Loop on I Index]
repeat thru step2 for i=1,2,……..n-1
2.[For each pass,get small value]
min=i;
repeat for j=i+1 to N do
{
if K[j]
min=j;
}
temp=K[i];K[i]=K[min];K[min]=temp;

3.[Sorted Values will be returned]

A)Bubble Sort
B)Quick Sort
C)Selection Sort
D)Merge Sort

6.Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()

7.Identify the correct argument for the function call fflush() in ANSI C:
A)stdout
B)stdin
C)stderr
D)All the above

8.Which of the Following will define a type NODE that is a node in a Linked list?
A)struct node {NODE*next;int x;};type def struct node NODE;
B)typedef struct NODE {struct NODE *next;int x;};
C)typedef struct NODE {NODE *next;int x;};
D)typedef struct {NODE *next;int x;}NODE;

9.Which of these statements are false w.r.t File Functions?
i)fputs() ii)fdopen() iii)fgetpos() iv)ferror()

A)ii B)i,ii C)iii D)iv

10.Study the code:
void show()
main()
{
show();
}
void show (char *s)
{
printf(“%sn”,s);
}

What will happen if it is compiled & run on an ANSI C Compiler?
A)It will compile & nothing will be printed when it is executed
B)it will compile but not link
C)the compiler will generate an error
D)the compiler will generate a warning

11.Look at the Code:
#include
void main()
{
char s1[]=”abcd”;
char s2[10];
char s3[]=”efgh”;
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,”abcd”));
printf(“%d”,i);
}

What will be the output?
A)No output B) A Non Integer C)0 D) Garbage

12.Look at the Code:
main()
{
int a[]={1,2,3},i;
for(i=0;i<3;i++)
{
printf(“%d”,*a);
a++;
}
}

Which Statement is/are True w.r.t the above code?
I.Executes Successfully & Prints the contents of the array
II.Gives the Error:Lvalue Required
III.The address of the array should not be changed
IV.None of the Above.

A)Only I B)Only II C)II & III D)IV

13.what is the output?
#define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t)
float gfloat;
main()
{
float a=1.12,b=3.14;
fun (a,b,float);
printf(“na=%4.2f,b=%4.2f”,a,b);
}

A)Error in Defining Macro
B)a=1.12,b=3.14
C)a=3.14,b=1.12
D)None of teh Above

14.study the code:
#include
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf(“a=%dn(*p)=%dn”,a,*p);
}
What is printed?

A)100,101 B)100,100 C)101,101 D)None of the above

15.Which of the following are valid “include” formats?
A)#include and #include[file.h]
B)#include (file.h) and #include
C)#include [file.h] and #include “file.h”
D)#include and #include “file.h”





Convergys Placement Paper (Aptitude, C C++ & VB)

10 02 2009

Paper: Convergys Placement Paper (Aptitude, C C++ & VB)

Aptitude :

1) All the children were arranged in rows. all the rows containing equal no. of students. if 4 students were removed from each row 10 more rows had to be added. if 5 students were added in each row no. of rows were reduced by 8.find the no. of children. the choices were like this
1)400
2)500
3)600
4)800.
Ans) 800

2) 2/3 of people read newspaper A , 3/4 read newspaper B.if 38 read both and 8 didn’t read any of the 2.how many read A?

ans) 48

3) There are 5 questions based on a murder story.the questions concentrate on the seating arrangements of people mentioned.

4) A plane goes from Chicago to Columbus and then comes back. It takes the same time to travel in either ways. It leave Chicago early in the morning 0644 LOCAL TIME and reaches the destination Columbus at 0849 LOCAL TIME. In the same evening it leave Columbus at 1625 hrs LOCAL TIME and reaches the destination at 1638 LOCAL TIME. Find the time that the plane takes to travel either way?

Ans: 69 mins

5) There is a 14 digit credit card number in which every 3 consecutive digits add to 20. Here is a part of it.. Find the value of ‘x’?

_ _ _ 9 _ _ _ x _ _ _ 7 _ _

Ans : 4

6) Ram gets 148 marks for 20 questions. +10 for correct. -3 for wrong. How many correct answers?

Ans : 16

7) Ganesh and Shankar travel abroad and take more luggage than the airlines allow. They have to pay extra money for it. They carry 52 kgs together and pay $60 and $100 respectively. Now, if the same luggage was carried by only Ganesh it would cost him $340. If the airlines charges only at one rate for extra luggage what is the maximum luggage that a person can carry without paying extra?

Ans : 18 kgs
8) There are 6 consecutive numbers P, Q, R, S, T, U, not necessarily in that order. Given that, Q is 2 less that P, P is 3 less that T and R is 2 less than S, arrange them in an ascending order.

Ans: QRPSUT

9) Number of digits with a 2 in them between 100 and 400?

Ans : 138

10) Bactria double every 3 mins. It is N in 1 hour, when was it N/4?

Ans : 54 minutes.

11) One day the Finance minister decides that the country should have only 33 paise and 56 paise.If there are two traders having enough change in the two denominations, what is the minimum amount for which they can transact?

Choices :1,2,3,6

Ans: 3

12) Out of the following numbers which is the greatest number when 7 times that number is (1,2) b)*g(1,2) c)(*g)(1,2) d)g(1,2)

Ans: c) (*g)(1,2)

4) Encapsulation

a)Aggregation of member objects
b)Aggregation of member functions
c)Used to incorporate data hiding

Ans: c)

5) Float_ptr = new float[100]
In order to deallocate this memory use

a)delete float_ptr
b)delete [] float_ptr
c)delete float_ptr [100]
d)delete float_ptr []

Ans:b)

6) i = 12
int *p = &I;
print (“%d %d”, p/p,*p**p)

Output
a) 1144
b) 144144
c) O/p Error
d) Junk

Ans:c)

7) What is Virtual member function?
8) Cin, Cout are

a)Class
b)Objects
c)Methods
d)Keywords

Ans: objects

9) cout << ( cout << “Hello” )<< “World”

Ans: HelloWorld

10) i=0;
a = 1;
b = 4;
swap(int a, int b)
{
int temp;
temp = a;
a = b;
b = a;
i = 1;
}

Output
a)4 0 0
b)0 4 1
c)1 4 1
d)Error

The questions is similar to this but am sure of the answer it is

Ans: 4 0 0

11)difference between member function and a constructor?
Ans: constructor cannot return value.

12)class B is the subclass of class A.which of the following describes the relationship?
a)…..is a……
b)….has a…..
c)…..implemented as……
d)
ans : I guess …..is a…. (Im not sure)

Language : VB

1) How will u keep the exisiting values of a array when enlarging it

Ans : Using Redim Preserve

2) for i = 0 to 5
a[i] = i
print a[i]
next i

how would it get printed in the form?

1.012345
2.0
1
2
3
4
5
3.12345
4.1
2
3
4
5

Ans : guess the choice is 2

Note : the question is some what similar to this, have a look at how print stmt’s result
would be

3) Resume used in conjunction with
a)On Error b)Error c)Error GOTO

Ans:On Error

4) Creating a new object using
a)New b) New, Create Object
c)New, Create Object, Set
d) New, CreateObject, Set Get Object

Ans: a) New

5) DIM x, y, z as Integer

Ans: X, Y variants, Z – Integer

6) Dim Counter;
For Counter = True to False
Print Counter
Next
Output :
a)Error msg b) True False c) -1 0 d) True

Ans: c) -1 0

7) Form load
textbox.text = “Hello”
on form load what all events will take place
a) Initialise b) Initialise, load c) Initialise, load, activate
d) Initialise, load, activate, validate

Ans: (c)
8) Connection object, command objection. How can u
associate both?

a)Set command object.activeconnection = connectionobject

9)some code segment was given (I don’t remember that) but the question was about this statement.
Print A A (A is a variable)
How VB will react?

10) var1 is declared as global variable.proc1( ) and proc( ) have local variables.when a call is made from proc1( ) to proc ( ) which are the variables will be displayed in locals window?

11)how do u unregister a COM from registry?
Ans) I think the third option .the answer will start with regsvr32 /u …..

12)what will happen when Require Variable Declaration option is checked?
a) existing undeclared variables are converted to variant by VB
b) this comes into effect for the new code segment

13)A global module called global. as is creates. which part of the program can access this module? The options were ambigous.be clear about the scope of the global. as module and the application which access it