aricent ppr.docx
-
Upload
priyanka-gupta -
Category
Documents
-
view
231 -
download
0
Transcript of aricent ppr.docx
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 1/52
Aricent 100 technical questions with answers 1. What does static variable mean?
Ans: Static variables are the variables which retain their
values between the function calls. They are initialized onlyonce their scope is within the function in which they are
defined.
2. What is a pointer?
Ans: Pointers are variables which stores the address of another
variable. That variable may be a scalar (including another pointer),or an aggregate (array or structure). The pointed-to object may be
part of a larger object, such as a field of a structure or an element
in an array.
3. What are the uses of a pointer?
Ans: Pointer is used in the following casesi) It is used to access array elements
ii) It is used for dynamic memory allocation.
iii) It is used in Call by referenceiv) It is used in data structures like trees, graph, linked list etc.
4. What is a structure?
Ans: Structure constitutes a super data type which representsseveral different data types in a single unit. A structure can be
initialized if it is static or global.
5. What is a union?
Ans: Union is a collection of heterogeneous data type but it usesefficient memory utilization technique by allocating enough memory
to hold the largest member. Here a single area of memory containsvalues of different types at different time. A union can never be
initialized.
6. What are the differences between structures and union?
Ans: A structure variable contains each of the named members, and
its size is large enough to hold all the members. Structure elementsare of same size. A union contains one of the named members at a
given time and is large enough to hold the largest member. Union
element can be of different sizes.
7. What are the differences between structures and arrays?
Ans: Structure is a collection of heterogeneous data type but arrayis a collection of homogeneous data types.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 2/52
Array
1-It is a collection of data items of same data type.2-It has declaration only
3-.There is no keyword.
4- array name represent the address of the starting element.Structure
1-It is a collection of data items of different data type.
2- It has declaration and definition3- keyword struct is used
4-Structure name is known as tag it is the short hand notation of
the declaration.
8. In header files whether functions are declared or defined?
Ans: Functions are declared within header file. That is function
prototypes exist in a header file, not function bodies. They aredefined in library (lib).
9. What are the differences between malloc () and calloc ()?
Ans: Malloc Calloc 1-Malloc takes one argument Malloc(a);where a
number of bytes 2-memory allocated contains garbage values1-Calloc takes two arguments Calloc(b,c) where b no of object and c
size of object
2-It initializes the contains of block of memory to zerosMalloc takes
one argument, memory allocated contains garbage values.It allocates contiguous memory locations. Calloc takes two
arguments, memory allocated contains all zeros, and the memoryallocated is not contiguous.
http://placement.freshersworld.com/placement-papers/
10. What are macros? What are its advantages and disadvantages?Ans: Macros are abbreviations for lengthy and frequently used
statements. When a macro is called the entire code is substituted bya single line though the macro definition is of several lines. The
advantage of macro is that it reduces the time taken for control
transfer as in case of function. The disadvantage of it is here theentire code is substituted so the program becomes lengthy if a
macro is called several times.
11. Difference between pass by reference and pass by value?
Ans: Pass by reference passes a pointer to the value. This allows the
callee to modify the variable directly.Pass by value gives a copy of the value to the callee. This allows the callee tomodify the value
without modifying the variable. (In other words, the callee simply
cannot modify the variable, since it lacks a reference to it.)
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 3/52
12. What is static identifier?
Ans: A file-scope variable that is declared static is visible only tofunctions within that file. A function-scope or block-scope variable
that is declared as static is visible only within that scope.
Furthermore, static variables only have a single instance. In thecase of function- or block-scope variables, this means that the
variable is not automatic and thus retains its value across function
invocations.
13. Where is the auto variables stored?
Ans: Auto variables can be stored anywhere, so long as recursion
works. Practically, they‗re stored on the stack. It is not necessarythat always a stack exist. You could theoretically allocate function
invocation records from the heap.
14. Where does global, static, and local, register variables, free
memory and C Program instructions get stored?
Ans: Global: Wherever the linker puts them. Typically the BSS
segment on many platforms.Static: Again, wherever the linker puts
them. Often, they‗re intermixed with the globals. Theonly differencebetween globals and statics is whether the linker will resolve the
symbols across compilation units.Local: Typically on the stack,
unless the variable gets register allocated and never spills.Register:
Nowadays, these are equivalent to Local variables. They live onthe stackunless they get register-allocated.
15. Difference between arrays and linked list?
Ans: An array is a repeated pattern of variables in contiguous
storage. A linked list is a set of structures scattered throughmemory, held together by pointers in each element that point to the
next element. With an array, we can (on most architectures) movefrom one element to the nextby adding a fixed constant to the
integer value of the pointer. With a linked list, there is a next
pointer in each structure which says what element comes next.16. What are enumerations?
Ans: They are a list of named integer-valued constants.
Example:enum color { black , orange=4, yellow, green, blue, violet
};This declaration defines the symbols black orange yellow
etc. to have the values 1,4,5,… etc. The difference between an
enumeration and a macro is that the enum actually declares a type,and therefore can be type checked.
http://placement.freshersworld.com/placement-papers/
17. Describe about storage allocation and scope of global, extern,static, local and register variables?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 4/52
Ans:
Globals have application-scope. They‗re available in any compilationunit that includes an appropriate declaration (usually brought from a
header file). They‗re stored wherever the linker puts them, usually a
place called the BSS segment Extern? This is essentially global.Static: Stored the same place as globals,
typically, but only available to the compilation unit that contains
them. If they are block-scope global, only available within that blockand its subblocks.
Local: Stored on the stack, typically. Only available in that block and
its subblocks. (Although pointers to locals can be passed tofunctions invoked from within a scope where that local is valid.)
Register: See tirade above on local vs. register.The onlydifference is that the C compiler will not let you take the address of
something you‗ve declared as register
18. What are register variables? What are the advantages of using
register variables?
Ans: If a variable is declared with a register storage class,it is
known as register variable.The register variable is stored in the cpuregister instead of main memory.Frequently used variables are
declared as register variable as it‗s access time is faster.
19. What is the use of typedef?Ans: The typedef help in easier modification when the programs are
ported to another machine. A descriptive new name given to theexisting data type may be easier to understand the code.
20. Can we specify variable field width in a scanf() format string? If possible how?
Ans: All field widths are variable with scanf(). You can specify amaximum field width for a given field by placing an integer value
between the %‗ and the field type specifier. (e.g. %64s). Suchaspecifier will still accept a narrower field width. The one exceptionis %#c (where # is an integer). This reads EXACTLY # characters,
and it is the only way to specify a fixed field width with scanf().
21. Out of fgets() and gets() which function is safe to use and why?
Ans: fgets() is safer than gets(), because we can specify a
maximum input length. Neither one is completely safe, because thecompiler can‗t prove that programmer won‗t overflow the buffer he
pass to fgets ().
22. Difference between strdup and strcpy?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 5/52
Ans: Both copy a string. strcpy wants a buffer to copy into. strdup
allocates a buffer using malloc(). Unlike strcpy(), strdup() is notspecified by ANSI .
23. What is recursion?Ans: A recursion function is one which calls itself either directly or
indirectly it must halt at a definite point to avoid infinite recursion.
24. Differentiate between for loop and a while loop? What are it
uses?
Ans: For executing a set of statements fixed number of times weuse for loop while when the number of iterations to be performed is
not known in advance we use while loop.
http://placement.freshersworld.com/placement-papers/
25. What is storage class? What are the different storage classes inC?
Ans: Storage class is an attribute that changes the behavior of a
variable. It controls the lifetime, scope and linkage. The storage
classes in c are auto, register, and extern, static, typedef.
26. What the advantages of using Unions?
Ans: When the C compiler is allocating memory for unions it will
always reserve enough room for the largest member.
27. What is the difference between Strings and Arrays?
Ans: String is a sequence of characters ending with NULL .it can betreated as a one dimensional array of characters terminated by a
NULL character.
28. What is a far pointer? Where we use it?
Ans: In large data model (compact, large, huge) the addressB0008000 is acceptable because in these model all pointers to data
are 32bits long. If we use small data model(tiny, small, medium)
the
above address won‗t work since in these model each pointer is16bits long. If we are working in a small data model and want to
access the address B0008000 then we use far pointer. Far pointer is
always treated as a 32bit pointer and contains a segment address
and offset address both of 16bits each. Thus the address is
represented using segment : offset format B000h:8000h. For anygiven memory address there are many possible far address segment
: offset pair. The segment register contains the address where the
segment begins and offset register contains the offset of data/codefrom where segment begins.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 6/52
http://placement.freshersworld.com/placement-papers/
29. What is a huge pointer?Ans: Huge pointer is 32bit long containing segment address and
offset address. Huge pointers are normalized pointers so for any
given memory address there is only one possible huge addresssegment: offset pair. Huge pointer arithmetic is doe with calls to
special subroutines so its arithmetic slower than any other pointers.
30. What is a normalized pointer, how do we normalize a pointer?
Ans: It is a 32bit pointer, which has as much of its value in the
segment register as possible.Since a segment can start every16bytes so the offset will have a value from 0 to F. for normalization
convert the address into 20bit address then use the 16bit for
segment address and 4bit for the offset address. Given a pointer
500D: 9407,we convert it to a 20bitabsolute address549D7,Whichthen normalized to 549D:0007.
31. What is near pointer?
Ans: A near pointer is 16 bits long. It uses the current content of
the CS (code segment) register(if the pointer is pointing to code) orcurrent contents of DS (data segment) register (if the pointer is
pointing to data) for the segment part, the offset part is stored in a
16 bit near pointer. Using near pointer limits the data/code to 64kb
segment.
32. In C, why is the void pointer useful? When would you use it?Ans: The void pointer is useful because it is a generic pointer that
any pointer can be cast into and back again without loss of
information.
33. What is a NULL Pointer? Whether it is same as an uninitializedpointer?
Ans: Null pointer is a pointer which points to nothing but
uninitialized pointer may point to anywhere.
34. Are pointers integer?
Ans: No, pointers are not integers. A pointer is an address. It is a
positive number.
35. What does the error ‗Null Pointer Assignment‘ means and whatcauses this error?
Ans: As null pointer points to nothing so accessing a uninitialized
pointer or invalid location may cause an error.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 7/52
36. What is generic pointer in C?
Ans: In C void* acts as a generic pointer. When other pointer typesare assigned to generic pointer, conversions are applied
automatically (implicit conversion).
37. Are the expressions arr and &arr same for an array of integers?
Ans: Yes for array of integers they are same.
38. IMP>How pointer variables are initialized?
Ans: Pointer variables are initialized by one of the following ways.
I. Static memory allocationII. Dynamic memory allocation
39. What is static memory allocation?
Ans: Compiler allocates memory space for a declared variable. Byusing the address of operator, the reserved address is obtained and
this address is assigned to a pointer variable. This way of assigning
pointer value to a pointer variable at compilation time is known as
static memory allocation.
http://placement.freshersworld.com/placement-papers/ 40. What is dynamic memory allocation?
Ans: A dynamic memory allocation uses functions such as malloc()
or calloc() to get memory dynamically. If these functions are used
to get memory dynamically and the values returned by thesefunction are assigned to pointer variables, such a way of allocating
memory at run time is known as dynamic memory allocation.
41. What is the purpose of realloc?
Ans: It increases or decreases the size of dynamically allocatedarray. The function realloc (ptr,n) uses two arguments. The first
argument ptr is a pointer to a block of memory for which the size isto be altered. The second argument specifies the new size. The size
may be increased or decreased. If sufficient space is not available to
the old region the function may create a new region.
42. What is pointer to a pointer?
Ans: If a pointer variable points another pointer value. Such a
situation is known as a pointer to a pointer.
Example:
int *p1,**p2,v=10;P1=&v; p2=&p1;
Here p2 is a pointer to a pointer.
43. What is an array of pointers?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 8/52
Ans: if the elements of an array are addresses, such an array is
called an array of pointers.
44. Difference between linker and linkage?
Ans: Linker converts an object code into an executable code bylinking together the necessary built in functions. The form and place
of declaration where the variable is declared in a program determine
the linkage of variable.http://placement.freshersworld.com/placement-papers/
45. Is it possible to have negative index in an array?
Ans: Yes it is possible to index with negative value provided thereare data stored in this location. Even if it is illegal to refer to the
elements that are out of array bounds, the compiler will not produce
error because C has no check on the bounds of an array.
46. Why is it necessary to give the size of an array in an array
declaration?
Ans: When an array is declared, the compiler allocates a base
address and reserves enough space in memory for all the elements
of the array. The size is required to allocate the required space andhence size must be mentioned.
47. What modular programming?
Ans: If a program is large, it is subdivided into a number of smallerprograms that are called modules or subprograms. If a complex
problem is solved using more modules, this approach is known asmodular programming.
48. What is a function?Ans: A large program is subdivided into a number of smaller
programs or subprograms. Each subprogram specifies one or moreactions to be performed for the larger program. Such sub programs
are called functions.
49. What is an argument?
Ans: An argument is an entity used to pass data from the calling to
a called function.
50. What are built in functions?
Ans: The functions that are predefined and supplied along with thecompiler are known as builtin functions.Theyarealsoknown aslibrary
functions.
http://placement.freshersworld.com/placement-papers/ 51. Difference between formal argument and actual argument?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 9/52
Ans: Formal arguments are the arguments available in the function
definition. They are preceded by their own data type. Actualarguments are available in the function call. These arguments are
given as constants or variables or expressions to pass the values to
the function.
52. Is it possible to have more than one main() function in a C
program ?Ans: The function main() can appear only once. The program
execution starts from main.
53. What is the difference between an enumeration and a set of
pre-processor # defines?
Ans: There is hardly any difference between the two, except that
#defines has a global effect(throughout the file) whereas anenumeration can have an effect local to the block if desired.Some
advantages of enumeration are that the numeric values are
automatically assigned whereasin #define we have to explicitly
define them. A disadvantage is that we have no control over the
size of enumeration variables.
54. How are Structure passing and returning implemented by the
complier?
Ans: When structures are passed as argument to functions, theentire structure is typically pushed on the stack. To avoid this
overhead many programmer often prefer to pass pointers tostructure instead of actual structures. Structures are often returned
from functions in a location pointed to by an extra, compiler-
supported hidden‗ argument to the function.http://placement.freshersworld.com/placement-papers/
55. IMP>what is the similarity between a Structure, Union andenumeration?
Ans: All of them let the programmer to define new data type.
56. Can a Structure contain a Pointer to itself?
Ans: Yes such structures are called self-referential structures.
57. How can we read/write Structures from/to data files?
Ans: To write out a structure we can use fwrite() as Fwrite( &e,
sizeof(e),1,fp);Where e is a structure variable. A correspondingfread() invocation can read the structure back from file. calling
fwrite() it writes out sizeof(e) bytes from the address &e. Data files
written as memory images with fwrite(),however ,will not beportable, particularly if they contain floating point fields or Pointers.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 10/52
This is because memory layout of structures is machine and
compiler dependent. Therefore, structures written as memoryimages cannot necessarily be read back by programs running on
other machine, and this is the important concern if the data files
you‗re writing will ever be interchanged between machines.
58. Write a program which employs Recursion?
Ans: int fact(int n) { return n > 1 ? n * fact(n – 1) : 1; }
59.Write a program which uses Command Line Arguments?
Ans:#include
void main(int argc,char *argv[])
{
int i;clrscr();
for(i=0;i
printf(\n%d‖,argv[i]);
}
60. Difference between array and pointer?
Ans: array
1- Array allocates space automatically
2- It cannot be resized3- It cannot be reassigned
4- sizeof (arrayname) gives the number of bytes occupied by thearray.
Pointer
1-Explicitly assigned to point to an allocated space.2-It can be sized using realloc()
3-pointer can be reassigned.
4-sizeof (p) returns the number of bytes used to store the pointervariable p.
http://placement.freshersworld.com/placement-papers/
61. What do the ‗c‘ and ‗v‘ in argc and argv stand for? Ans: The c in argc(argument count) stands for the number of
command line argument the program is invoked with and v in
argv(argument vector) is a pointer to an array of character string
that contain the arguments.
62. IMP>what are C tokens?Ans: There are six classes of tokens: identifier, keywords,
constants, string literals, operators and other separators.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 11/52
63. What are C identifiers?
Ans: These are names given to various programming element suchas variables, function, arrays.It is a combination of letter, digit and
underscore.It should begin with letter. Backspace is not allowed.
64. Difference between syntax vs logical error?
Ans:
Syntax Error1-These involves validation of syntax of language.
2-compiler prints diagnostic message.
Logical Error1-logical error are caused by an incorrect algorithm or by a
statement mistyped in such a way
that it doesn‗t violet syntax of language.
2-difficult to find.
65. What is preincrement and post increment?
Ans: ++n (pre increment) increments n before its value is used in
an assignment operation or any expression containing it. n++ (post
increment) does increment after the value of n is used.
66. Write a program to interchange 2 variables without using the
third one.
Ans:a ^= b; ie a=a^b
b ^= a; ie b=b^a;a ^= b ie a=a^b;
here the numbers are converted into binary and then xor operation
is performed.
You know, you‗re just asking have you seen this overly clever trick
that‗s not worth applying on modern architectures and only reallyapplies to integer variables?
67. What is the maximum combined length of command linearguments including the space between adjacent arguments?
Ans: It depends on the operating system.
68. What are bit fields? What is the use of bit fields in a Structure
declaration?
Ans: A bit field is a set of adjacent bits within a singleimplementation based storage unit that we will call a word The
syntax of field definition and access is based on structure. Struct {
unsigned int k :1;unsigned int l :1;unsigned int m :1;}flags;the number following the
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 12/52
colon represents the field width in bits.Flag is a variable that
containsthree bit fields.
69. What is a preprocessor, what are the advantages of
preprocessor?Ans: A preprocessor processes the source code program before it
passes through the compiler.
1- a preprocessor involves the readability of program2- It facilitates easier modification
3- It helps in writing portable programs
4- It enables easier debugging5- It enables testing a part of program
6- It helps in developing generalized program
70. What are the facilities provided by preprocessor?Ans:
1-file inclusion
2-substitution facility
3-conditional compilation
http://placement.freshersworld.com/placement-papers/ 71. What are the two forms of #include directive?
Ans:
1.#include‖filename‖
2.#include the first form is used to search the directory thatcontains the source file.If the search fails in the home directory it
searches the implementation defined locations.In the second form,the
preprocessor searches the file only in the implementation defined
locations.
72. How would you use the functions randomize() and random()?
Ans:Randomize() initiates random number generation with a random
value.
Random() generates random number between 0 and n-1;http://placement.freshersworld.com/placement-papers/
73. What do the functions atoi(), itoa() and gcvt() do?
Ans: atoi() is a macro that converts integer to character.
itoa() It converts an integer to string
gcvt() It converts a floating point number to string
74. How would you use the functions fseek(), freed(), fwrite() and
ftell()?Ans:fseek(f,1,i) Move the pointer for file f a distance 1 byte from
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 13/52
location i. fread(s,i1,i2,f) Enter i2 dataitems,each of size i1
bytes,from file f to string s.fwrite(s,i1,i2,f) send i2 data items,eachof size i1 bytes from string s to file f.
ftell(f) Return the current pointer position within file f. The data type
returned for functions fread,fseek and fwrite is int and ftell is longint.
75. What is the difference between the functions memmove() andmemcpy()?
Ans: The arguments of memmove() can overlap in memory. The
arguments of memcpy()cannot.
76. What is a file?
Ans: A file is a region of storage in hard disks or in auxiliary storage
devices.It contains bytes of information .It is not a data type.
77. IMP>what are the types of file?
Ans: Files are of two types
1-high level files (stream oriented files) :These files are accessed
using library functions2-low level files(system oriented files) :These files are accessed
using system calls
78. IMP>what is a stream?Ans: A stream is a source of data or destination of data that may be
associated with a disk or other I/O device. The source streamprovides data to a program and it is known as input stream. The
destination stream eceives the output from the program and is
known as output stream.
79. What is meant by file opening?Ans: The action of connecting a program to a file is called opening
of a file. This requires creating an I/O stream before reading or
writing the data.http://placement.freshersworld.com/placement-papers/
80. What is FILE?
Ans: FILE is a predefined data type. It is defined in stdio.h file.
81. What is a file pointer?
Ans: The pointer to a FILE data type is called as a stream pointer ora file pointer. A file pointer points to the block of information of the
stream that had just been opened.
82. How is fopen()used ?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 14/52
83How is a file closed ?Ans: A file is closed using fclose() function Egfclose(fp); Where fp is
a file pointer.
84. What is a random access file?
Ans: File can be accessed at random using fseek() function
fseek(fp,position,origin); fp file pointer position number of bytesoffset from origin origin 0,1 or 2 denote the beginning ,current
position or end of file respectively.
85. What is the purpose of ftell ?
Ans: The function ftell() is used to get the current file represented
by the file pointer. ftell(fp); returns a long integer value
representing the current file position of the file pointed by the filepointer fp.If an error occurs ,-1 is returned.
86. What is the purpose of rewind() ?
Ans: The function rewind is used to bring the file pointer to the
beginning of the file.Rewind(fp);Where fp is a file pointer.Also wecan get the same effect byfeek(fp,0,0);
87. Difference between a array name and a pointer variable?
Ans: A pointer variable is a variable where as an array name is afixed address and is not a variable. A pointer variable must be
initialized but an array name cannot be initialized. An array namebeing
a constant value , ++ and — operators cannot be applied to it.
88. Represent a two-dimensional array using pointer?
89. Difference between an array of pointers and a pointer to an
array?
Ans:Array of pointers
1- Declaration is: data_type *array_name[size];
2-Size represents the row size.
3- The space for columns may be dynamically
Pointers to an array
1-Declaration is data_type ( *array_name)[size];2-Size represents the column size.
http://placement.freshersworld.com/placement-papers/
90. Can we use any name in place of argv and argc as commandline arguments ?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 15/52
Ans: yes we can use any user defined name in place of argc and
argv;
91. What are the pointer declarations used in C?
Ans:1- Array of pointers, e.g , int *a[10]; Array of pointers to integer
2-Pointers to an array,e.g , int (*a)[10]; Pointer to an array of into
3-Function returning a pointer,e.g, float *f( ) ; Function returning apointer to float
4-Pointer to a pointer ,e.g, int **x; Pointer to apointer to int
5-pointer to a data type ,e.g, char *p; pointer to char
92. Differentiate between a constant pointer and pointer to a
constant?
Ans:const char *p; //pointer to a const character.
char const *p; //pointer to a const character.
char * const p; //const pointer to a char variable.
const char * const p; // const pointer to a const character.
http://placement.freshersworld.com/placement-papers/ 93. Is the allocated space within a function automatically
deallocated when the function returns?
Ans: No pointer is different from what it points to .Local variables
including local pointers variables in a function are deallocatedautomatically when function returns.,But in case of a local pointer
variable ,deallocation means that the pointer is deallocated and notthe block of memory allocated to it. Memory dynamically allocated
always persists until the allocation is freed or the program
terminates.
94. Discuss on pointer arithmetic?Ans:
1- Assignment of pointers to the same type of pointers.
2- Adding or subtracting a pointer and an integer.3-subtracting or comparing two pointer.
4-incrementing or decrementing the pointers pointing to the
elements of an array. When a pointer to an integer is incremented
by one , the address is incremented by two. It is done automatically
by the compiler.
5-Assigning the value 0 to the pointer variable and comparing 0with the pointer. The pointer having address 0 points to nowhere at
all.
http://placement.freshersworld.com/placement-papers/ 95. What is the invalid pointer arithmetic?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 16/52
Ans:
i) adding ,multiplying and dividing two pointers.ii) Shifting or masking pointer.
iii) Addition of float or double to pointer.
iv) Assignment of a pointer of one type to a pointer of another type
96. What are the advantages of using array of pointers to string
instead of an array of strings?Ans:
i) Efficient use of memory.
ii) Easier to exchange the strings by moving their pointers whilesorting.
97. Are the expressions *ptr ++ and ++ *ptr same?
Ans: No,*ptr ++ increments pointer and not the value pointed by it.
Whereas ++ *ptr increments the value being pointed to by ptr.
98. What would be the equivalent pointer expression foe referring
the same element as
http://placement.freshersworld.com/placement-papers/
99. Are the variables argc and argv are always local to main?Ans: Yes they are local to main.
100. Can main () be called recursively?
Ans: Yes any function including main () can be called recursively.
101. IMP>Can we initialize unions?
102. What‘s the difference between these two declarations?
103. Why doesn‘t this code: a[i] = i++; work?
Ans: The subexpression i++ causes a side effect.it modifies i‗svalue.which leads to undefined behavior since i is also referenced
elsewhere in the same expression.
http://placement.freshersworld.com/placement-papers/
104.WHy doesn‘t struct x { … };
105. Why can‘t we compare structures?
Ans:There is no single, good way for a compiler to implement
structure comparison which is consistent with C‗s low-level flavor. A
simple byte-by-byte comparison could founder on random bitspresent in unused holes‖ in the structure (such padding is used to
keep the alignment of later fields correct). A field-by-field
comparison might require unacceptable amounts of repetitive codefor large structures.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 17/52
106. How are structure passing and returning implemented?Ans: When structures are passed as arguments to functions, the
entire structure is typically pushed on the stack, using as many
words as are required. Some compilers merely pass a pointer to thestructure, though they may have to make a local copy to preserve
pass-by-value semantics. Structures are often returned from
functions in a location pointed to by an extra,compilersuppliedhidden‖ argument to the function.Some older
compilers used a special,static location for structure returns,
although this made structure-valuedfunctions non-reentrant, whichANSI Cdisallows.
Questions are:
1. Tell me about yourself?
2. Tell an incident when you helped anybody.(how, why, when)
3. Tell me a situation when you were right about the things but you
were forced to do according to others suggestions. (how, why,
when)
4. Tell an incident when you organized something and leaded the
team. (how, why, when) and many more HR questions.
The recruitment procedure was 1. Written Test 2. Group Discussion 3. Tech and HR
1. Written Test 1.Online Written test Sectional cutoff is present. Written is the major elimination round.In my case out of 600 only 60 are taken out from the written
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 18/52
SEC 1: English (25 Ques - 25 min) -- Meanings, opposites,
Passages, sentence ordering etc. SEC 2: Aptitude (25 Ques - 35 min) -- logarithms, work, distance,
discount, profit & loss, Interests etc.
SEC 3: Programming (25 Ques - 25 min) -- C and Data structures SEC 4: Logical (25 Ques - 35 min) -- Passages, coding, blood
relations etc.
SEC 1: English (25 Ques - 25 min) -- Meanings, opposites,
Passages, sentence ordering etc.
―Leave it.‖ Kelsey could not begin to fathom what she was hearing. In fact, a
partof her began to feel she was in some sort of dream, unable to
emerge to wakefulness. Even the contractor appeared flabbergasted. His mouth stayed in a
half-open position, like a marionette waiting for its strings to be
tugged. ―Yes. Leave it,‖ Robert said again, speaking to the notion thatsomeone in the room had asked him to clarify his words. No one
had, but Robert understood the silence. What were the chances that an Indian burial ground would be found
on the bucolic site where Robert and Kelsey had chosen to build
their dream home? Why in the world would Robert not want to havethe remains carted away, thought Kelsey. The last thing they
needed were Indian poltergeists meandering around their homewhile the two of them were trying to renovate their marriage. Kelsey, usually deferential to her husband, knew that now was the
time to make her position heard. She tried to cajole Robert away from the direction he was heading.
―Sweetheart,‖ she cooed. ―We don‘t want to build on a site with
human remains. It would be irreverent to the dead.‖
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 19/52
Immediately, she saw contempt in Robert‘s eyes; it was a subtle
reminder of how he often viewed her as superficial and self-absorbed.―What would be irreverent,‖ said Robert, his voice dripping
with condescension, ―would be to desecrate these Native graves and
move them from their final resting place. Remember the culture.‖
No, Kelsey did not ―remember the culture.‖ She could not care lessabout the culture. However, Robert, the history professor, was
obviously enthralled by the contractor‘s findings. He had an innateway of understanding other cultures and other people that amazed
Kelsey. He did not have that gift with her. But something inside Kelsey said this was too much. She believed
wholeheartedly in ghosts and could not imagine a life of them
haunting her, rattling her cupboards, and shaking her floorboards. Kelsey had an unnerving sensation that problems wereahead.Questions: 1 Which of the following best explains how Kelsey feels at thebeginning of the story? A. unable to comprehend the current situation B. unable to comprehend the decision of her husband C. unaware of the problem at hand D. unwilling to confront a potentially life-threatening ordeal
2 As used at the beginning of the story, which is the bestsynonymfor flabbergasted? A. dumbfounded B. hostile C. querulous D. unimpressed
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 20/52
3 In paragraph 2, the author writes, ―His mouth stayed in a half -
open position, like a marionette waiting for its strings to be tugged.‖ Which of the following literary techniques is used in this quotation?
A. allusion, characterized by a casual reference to a literary orhistorical figure B. simile, characterized by a comparison between two unlike thingsusing ―like‖ or ―as‖ C. denotation, characterized by the usage of the literaldefinition of a word D. hyperbole, characterized by a gross exaggeration
4 The title of this passage makes use of which literary device? A. a pun, where one word has two meanings that are both
used at the same time B. irony, where the words used mean the opposite of what they say C. foreshadowing, which hints at what is to come later in the story
D. overstatement, where something is exaggerated for effect
5 Kelsey wants to have the remains removed because I. She is afraid of ghosts.
II. Robert wants to leave them there.
III. She respects Native cultures. A. I only B. I and II C. I and III
D. I, II, and III
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 21/52
6 If Kelsey had chosen to be deferential (paragraph 6) to herhusband, what would she have likely told him regarding his plans? A. "Good idea."
B. "Don't be silly." C. "I'll leave you." D. "I‘m not sure."Questions (continued):
7Which adjective best describes Kelsey and Robert‘s marriage? A. busy B. appalling C. strained D. good-natured
8 What about Robert seems to keep him from wanting to move the
gravesite? A. He is controlling. B. He fears the Indians. C. He cares about cultural history. D. He is afraid of ghosts.
9 In paragraph 7, the author writes, ―She tried to cajole Robert
away from the direction he was heading."Which of the following isthe best way to rewrite the above sentence while keeping its
original meaning as used in the story? A. She tried to compromise with Robert to go the other direction.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 22/52
B. She tried to force Robert to change directions. C. She tried to entice Robert away from the direction he was
heading. D. She tried to threaten Robert about the direction he was heading.
10 As used at the end of the story, which is the best antonym for
desecrate? A. honor B. excavate C. defile D. criticize
11In the following questions choose the word which is the exact
OPPOSITE of the given words. QUIESCENT A. ACTIVE B. Dormant C. Weak D. Unconcerned Ans.A 12) FRAUDULENT A. Candid B. Direct C. Forthright D. Genuine Ans.D 13) BUSY A. Occupied B. Engrossed C. Relaxed D. Engaged
Ans.C
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 23/52
In each question below a sentence with four words printed in boldtype is given. These are lettered as (A), (B), (C) and (D). One of
these four words printed in bold may be either wrongly spelt or
inappropriate in the context of the sentence. Find out the wordwhich is wrongly spelt or inappropriate if any. The letter of that
word is your answer. If all the words printed inbold are correctly
spelt and also appropriate in the context of the sentence, mark (E)i.e. ‗All correct‘ as your answer.
14Since petroleum products are taxed (A) heavily they are a
majar(B) source (C) of revenue (D) for the government. All correct(E)
15Even though the proposal appearrs (A) practical (B) thecommittee should discuss (C) it
at length. (D) All correct (E)
16The Indian stock market has been one of the well
(A)performing (B) markets globally (C) during the current (D) year.
All correct (E)
17Had the scheme been allowed (A) to continue (B) it wouldhavegenerated (C) attracted (D) returns. All correct (E)
18People should constantly (A) upgrade their skills (B) in order
to be effective (C) and efficient. (D) All correct (E)
Aptitude (25 Ques - 35 min) -- logarithms, work, distance,
discount, profit & loss, Interests etc.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 24/52
1If the list price of a book is reduced by Rs. 5, then a person can
buy 5 more books for Rs. 300. The original cost of the book is (1) Rs. 15 (2) Rs. 20 (3) Rs. 25 (4) Rs. 30
2If the total distance of a journey is 120 km .If one goes by 60
kmph and comes back at 40kmph what is the average speed during
the journey? Ans: 48kmph
3 On a nice summer day two tourists visit the Dutch city of
Gouda. During their tour through the center they spot a cosyterrace. They decide to have a drink and, as an appetizer, a portion
of hot "bitterballs" (bitterballs are a Dutch delicacy, similar to
croquettes). The waiter tells them that the bitterballs can be served
in portions of 6, 9, or 20. What is the largest number of bitterballs
that cannot be ordered in these portions?
4 8 2 14 6 11 ? 14 6 18 12
What will be the 6th number? a)8 b)9 c)7 d)5
5 In a group of 15,7 have studied Latin, 8 have studied Greek, and
3 have not studied either.How many of these studied both Latin andGreek Ans. 0
6 A, B, C, D and E play a game of cards. A says to B, "If you giveme three cards, you will have as many as E has and if I give you
three cards, you will have as many as D has." A and B together had10 cards more than what D and E together have. If B has two cards
more than what C has and the total number of cards be 133, how
many cards does B have? Ans-25
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 25/52
7If A + B means A is the brother of B; A - B means A is the sister of B and A x B means A is the father of B. Which of the following
means that C is the son of M? A. M - N x C + F
B. F - C + N x M C. N + M - F x C
D. M x N - C + F
8 Pointing to a person, Deepak said, "His only brother is the
father of my daughter's father". How is the person related to
Deepak? A. Father
B. Grandfather C. Uncle
D. Brother-in-law Ans-C
9There are 5 persons a,b,c,d,e and each is wearing a block or white
cap on his head. a person can see the caps of the remaining 4 but
can't see his own cap. a person wearing white says true and whowears block says false.
i) a says i see 3 whites and 1 block i) b says i see 4 blocks iii) e says i see 4 whites iv) c says i see 3 blocks and 1 white.
now find the caps weared by a,b,c,d and e
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 26/52
10. Which of the following options are true Alphine tunnels are closed tunnels. in the past 30 yrs not even a
single accident has been recorded for there is one accident in therail road system. even in case of a fire accident it is possible to shift
the passengers into adjacent wagons and even the living fire can be
detected and extinguished with in the duration of 30 min. A. no accident can occur in the closed tunnels B. fire is allowed to live for 30 min.
C. All the care that travel in the tunnels will be carried by railshutters. Ans-A,C
11A company contracts to paint 3 houses. Mr. Brown can paint ahouse in 6 days while Mr. Black would take 8 days and Mr. Blue 12
days. After 8 days Mr. Brown goes on vacation and Mr. Black begins
to work for a period of 6 days. How many days will it take Mr. Blueto complete the contract?
A. 7B. 8
C. 11
D. 12
Ans. C
12. 2 hours after a freight train leaves Delhi a passenger train
leaves the same station traveling in the same direction at anaverage speed of 16 km/hr. After traveling 4 hrs the passenger train
overtakes the freight train. The average speed of the freight train
was?
A. 30
B. 40
C.58D. 60
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 27/52
Ans. B
13. If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?
A.-5
B. 4
C. 2D. 8
Ans. D 14 What is the maximum number of half-pint bottles of cream
that can be filled with a 4-gallon can of cream (2 pt.=1 qt. and 4qt.=1 gal)
A.16B.24
C.30
D.64
Ans. D
15 If the operation, ^ is defined by the equation x ^ y = 2x + y,
what is the value of in 2 ^ a = a ^ 3
A.0
B.1
C.-1D.4
Ans. B 16 A coffee shop blends 2 kinds of coffee, putting in 2 parts of a
33p. a gm. grade to 1 part of a 24p. a gm. If the mixture is changed
to 1 part of the 33p. a gm. to 2 parts of the less expensive grade,
how much will the shop save in blending 100 gms.
A.Rs.90
B.Rs.1.00
C.Rs.3.00D.Rs.8.00
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 28/52
Ans.C 17) Which of the following statements is not correct? A. log10 10 = 1 B. log (2 + 3) = log (2 x 3) C. log10 1 = 0 D. log (1 + 2 + 3) = log 1 + log 2 + log 3 Ans.B
18)
A. 1 8 B.
1 4
C. 1 2 D.
1 8
Ans.C 19 If log a
+ log b = log (a + b), then:
b a
A. a + b = 1 B. a - b = 1 C. a = b D. a2 - b2 = 1 Ans.A 20 If log10 7 = a, then log10 1
is equal to: 70
log 8 is equal to:
log 8
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 29/52
A. - (1 + a) B. (1 + a)-1 C.
a 10 D.
1 10a
Ans.A 21) If log10 2 = 0.3010, the value of log10 80 is: A. 1.6020 B. 1.9030 C. 3.9030 D. None of these Ans.B 26) Find the greatest number that will divide 43, 91 and 183 so as
to leave the same remainder in each case. A. 4 B. 7 C. 9 D. 13 Ans.A 27) The H.C.F. of two numbers is 23 and the other two factors of
their L.C.M. are 13 and 14. The larger of the two numbers is:
A. 276 B. 299 C. 322 D. 345 Ans.C 28) Six bells commence tolling together and toll at intervals of 2, 4,
6, 8 10 and 12 seconds respectively. In 30 minutes, how manytimes do they toll together ? A. 4 B. 10 C. 15 D. 16 29) Six bells commence tolling together and toll at intervals of 2, 4,6, 8 10 and 12 seconds respectively. In 30 minutes, how many
times do they toll together ? A. 4 B. 10 C. 15 D. 16 Ans.D
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 30/52
30) If log 2 = 0.30103, the number of digits in 264 is: A. 18 B. 19 C. 20 D. 21 Ans.C 30) If log x y = 100 and log2 x = 10, then the value of y is: A. 210 B. 2100 C. 21000 D. 210000 Ans.C
Data structure 1.what is the ternary operator in following
a. * b.& c.~ d.? 2.which is unary operator that used for addressing
a.* b.! c.& d.?3.what's equation for average class analysis of quicksort
a.O(n) b.O(logn) c.O(2nlogn) d.O(n2)
4.same 3rd question ....with quicksort O(n2)
a.O(n) b.O(logn) c.O(2nlogn) d.O(n2)
5.what operation & symbol indicate
a.bitwise AND b.bitwisOR c.logical AND d.logicalOR
6.which is the worst algorithm in average case analysis?
a.mergesort b.quick sort c.heapsort d.bubblesort
7.In stack 2,3
push() push()
pop()
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 31/52
pop()
pop()
1push()
what is the output?
8.which has highest priority?
Like 4 choice
High priority: $ symbol
Medium: * multiplication , / division
Low: +addition and -subtraction
High priority: * multiplication , / division
Medium: $ symbol
Low: +addition and -subtraction
9.what is sorting?
10.by using only 4 nodes, how many form of binary tree can make?
a.12 b.14 c.15 d.13
C Questions
1.main()
{
int i=32;
{
int i;
for(i=0;i<5;I++)
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 32/52
some operation.......
}
printf(―%d‖,i);
}
a.5 b.garbage c.error d.32
2.main()
{
int a=5,b=6,c=10;
c=a==b;
printf(―5d‖,c);
}
a.0 b.error c.1 d.10
3.int i,j;
int operate()
{
}
mainI()
{
} two varibles can use for both function.what is the name for that
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 33/52
varibles?
a.local variable b.register c.auto d.external
4.int sample(int i)
{
int count=1;
printf(%d‖,count++);
}
main()
{
int i,j;
for(i=0,j=5;i<5;i++,j--)
samuple(i);
printf(―the element %d and %d‖,i,j);
}
what is the ouput for last two printf statement? 5. The command which gives the device of our system : WHO 6.The command which gives the all list of files without graphic
symbols the choices are as follows ls-a ls-b ls-l
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 34/52
7. 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 leftc) bigger variables are moved first than the smaller variables.
d) smaller variables are moved first than the bigger ones.
e) none of the above.Ans: (b)
8.int a[3][5]={ {1,2,3,4,5],{2,3,4,5,6},{10,11,12,13,14}}; int *p=&a; printf(―%d‖,*(*(x+1)+3));
9.int a=0xdeabc; char x=a; printf(―%x‖,x);
find the output of this endiane machine. a)de b)ab c)0 d)cannot be predictable
10.A question on Computer Networks giving 3 lines o theorey on
CSMA/CD CSMA/CA.
11.sizeof() is an operator .
12.main() { pfrintf(―%d‖,f1(10,10);
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 35/52
} the function declaration of f1(int,int) is given in some other
program find how the function declaration is extern int f1(int,int) .What is use of the Wait for Graph
14.main()
{
a=5;
if(a=1)
{
printf(―d‖,a);
} always if prints the value of a is 1
15.a bit on convewrtion of binary number to Octal .10111000 firstconvert it into the decimal and convert it into the Octal by
deviding 8.
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 36/52
16.Given the following statement
enum day = {jan = 1, feb=4, april,may}
What is the value of may? (a) 4
(b) 5
(c) 6(d) 11
(e) None of the above
17. Find the output for the following C program main{int x,j,k;
j=k=6;x=2;
x=j*k;printf("%d", x);
18. Find the output for the following C program fn f(x)
{ if(x<=0)return;
else f(x-1)+x;
}
19. Find the output for the following C program i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{k+=j<10?4:3;}
printf("%d", k);
20. Find the output for the following C program int i =10
main()
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 37/52
{int i
=20,n;
for(n=0;n<=i;)
{int i=10;i++;
}
printf("%d", i);
1. What is paging?
2. What is virtual memory and why it is needed?
3. Write a program for Quick sort?
4. Write a program for banking management system and Railwaymanagement System?
5. Write a code by which you can find the no. of same train no.
Occurrence in a snapshot from a database in railway ticketing
system?
6. Write difference between switch and hub, tell about their
characteristic?
7. Tell me about routers?
8. What is software engineering. Tell all the steps involved in it?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 38/52
9 What is testing, what are different types of testing?
10. What is Scheduling. Explain different types of scheduling.
11. What is leaky bucket.
12. What is Segmentation?
13. What is token ring. Explain about it.
14. How many bits are required for IPv4 and IPv6.
15. Difference between UDP and TCP/IP.
16Tell me whats an operatng system?
17 Different functions of an OS?
18 Whats is heavy weight process?
19 Whats IPC?
20Whats critical section and its various solutions?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 39/52
21Draw fig of OSI model?
22 Which model is used in Internet?
23 Draw figure of it?
24 What is function of network layer?
Also he asks various protocols that are used in various layers of OSI
model like(IP, UDP, HTTP, IGP, TCP etc).
Then he switched to Data structures.
25Whats an Data Structure?
26What are differnt types of Data Structure?
27 Whats a Heap, Queue?
28 Write a program to implement Queue?
29Also questions like that (pseudocode or program).
Aricent recruitment process consists Writtent test, Group
Discussion,Tehnical and HR Interviews
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 40/52
1. enum number { a=-1, b=4, c,d,e,} what is the value of e?
(A) 7 (B) 4 (C) 5 (D) 3
2. which of the following correctly declares ―My_var‖ as a pointer toa function that returns an integer
a. int*My_Var();
b. int*(My_Var());
c. int(*)My_Var();
d. int(*My_Var)();
3. There are 76 persons. 53 can read hindu,46 can read times,39
can read deccan and 15 can read all.if 22 can read hindu anddeccan and 23 can read deccan and times then what is the number
of persons who read only times and hindu???
Ans 18
4. in pure milk if 20% replaced by water and in this again 20% isreplaced by water and again 20% is replaced by water then what is
the praportion of milk in that mixture
5. after 10 years A will be twice the age of B before 10 years.and
now if the difference is 9 years between them then what is the age
of B after 10 years
Ans 49
6. What is the Result of the following 'VIK'||NULL||'RAM' ?
a] Error
b] VIK RAM
c] VIKRAMd] NULL
Ans : C
7. What SYSTEM VARIABLE is used to refer DATABASE TIME ?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 41/52
a] $$dbtime$$
b] $$time$$c] $$datetime$$
d] None of the above
Ans : A
8. If m:n = 2:3,the value of 3m+5n/6m-n is
(A) 7/3 (B) 3/7 (C) 5/3 (D) 3/5
9. A dog taken four leaps for every five leaps of hare but three
leaps of the dog is equal to four leaps of the hare. Compare speed?
(A) 12:16 (B) 19:20 (C) 16:15 (D) 10:12
10. What is true about the following C functions?
(A) Need not return any value. (B) Should always return an integer.
(C) Should always return a float. (D) Should always return morethan one value.
11.In simple interest what sum amounts of Rs.1120/- in 4 years
and Rs.1200/- in 5 years ?(A) Rs. 500
(B) Rs. 600(C) Rs. 800
(D) Rs. 900
12. If a sum of money compound annually amounts of thrice itself
in 3 years. In how many years will it become 9 times itself.(A) 6
(B) 8
(C) 10(D) 12
13. Two trains move in the same direction at 50 kmph and 32 kmph
respectively. A man in the slower train observes the 15 seconds
elapse before the faster train completely passes by him.
What is the length of faster train ?(A) 100m
(B) 75m
(C) 120m(D) 50m
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 42/52
14. How many mashes are there in 1 square meter of wire gauge if each mesh is 8mm long and 5mm wide ?
(A) 2500
(B) 25000(C) 250
(D) 250000
15. void main()
{
int i,j,k;for(i=0;i<3;i++)
k=sum(i,i);
printf("\n%d",k);
getch();}
sum(s,t)
{
static int m;
m+=s+t;return m;
}Ans: 6
16. What is the output of the program
void main(){
int i,j,k,n=5;
clrscr();for(i=5;i>0;i--)
{ j=1<i;
k=n&j;
k==0?printf("0"):printf("1");}
getch();
}
// A. 00011
// B. 11110
// c. 11001 // D. 11100
Ans: B. 11110
17. What is the output of the program
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 43/52
void main()
{int i,j,k;
i=2;
j=4;k=i++>j&2;
printf("%d\n",k);
if(++k && ++i<--j|| i++){
j=++k;
}printf(" %d %d %d",i,-j--,k);
getch();
}
// A. 4,-3,2 // B. 5,-3,2
// c. 4,-2,2
// D. 5,-2,2
Ans: D
18. what is the final value of x when the code for(int
x=0;x<10;x++) is
run?
a. 10b. 9
c. 0d. 1
19. what is the data type of FILE?a. integer
b. unionc. pointer
d. structure
20. if "a" is an array of 5*5 dimension, a[2][4] is same as
a. **(a+2+4)
b. *(a+2) + *(a+4)
c. **(a+2)+4
d. *(*a+2)+4)
21. In a business P and Q invested amounts in the ratio 3:4,whereas the ratio between amounts invested by P and R was 6:7. If
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 44/52
Rs 106501.50 was their profit, how much amount did Q receive?
1) Rs 40572
2) Rs 30429
3) Rs 35500.504) Rs 34629
5) None of these
22. A man buys spirit at Rs. 60 per letter, adds water to it and then
sells it at Rs. 75 per litter. What is the ratio of spirit to water if his
profit in the feal is 37.5%?
(a) 9:1 (b) 10:1 (c) 11:1 (d) None of these.
Ans (b) 10.1
23. A certain quantity of petrol is found to be adulterated to the
extent of 10%. What proportion of the adulterated petrol should be
replaced with pure petrol to take the purity level to 98%?
(a) 80% (b) 32% (c) 66.67% (d) cannot be determined.
Ans (a) 80%
24. There is a family of six persons P,Q,R,S,T and U.They are
Lawyer, Doctor, Teacher, Salesman, Engineer and Accountant.There are two married couples in the family. S, the salesman is
married to the Lady Teacher. The Doctor is married to the Lawyer U,
The Accountant is the son of Q and brother of T. R, the Lawyer isthe daughter-in-law of P. T is the unmarried Engineer. P is the
Grandmother of U. Which is the profession of P?
a)Lawyer b)Teacher c)Doctor d)Accountant
25. My mother gave me money to buy stamps of price 2paisa, 7
paisa,15 paisa, 10paisa and 20 paisa. I had to buy 5 each of three
types and 6 each of the other 2 types . But on my way to the post
office i forgot how many of stamps of each type were to be brought
. My mother had given me rupees 3 . So i had no problem in finding
out the exact amount of each one . Can you tell me which stampswere 5 in number , n whic were 6 in number
Ans . 5 stamps each of 2paisa, 7 paisa, 15 paisa
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 45/52
26. If all the picture cards are removed from a pack of cards, thesum of the values of the remaining is
a) 55 b) 220 c) 54 d) 216
27.One monkey climbs a poll at the rate of 6mts/min and fell down
3mts in the alternately. Length of the poll is 60 mtrs , how muchtime it will take to reach the top?
a. 31 b.33 c.37 d.40 (ans: 37)
28. Find the approximate value of the following equation. 6.23% of
258.43 - ? + 3.11% of 127 = 13.87
1) 2
2) 4
3) 8
4) 6
5) 10
29. A train overtakes 2 persons walking at 3 km/hr and 5 km/hr
respectively in the same direction and completely passes them in 8
seconds and 10 seconds respectively. Find the speed of the train.
1) 15 km/hr2) 13 km/hr
3) 10 km/hr
4) 10 km/hr5) None of these
30. The sum of a number and its square is 1406. What is the
number?
1) 38
2) 39
3) 37
4) 29
5) None of these
31. A man spends half of his salary on household expenses, 1/4th
for rent, 1/5th for travel expenses, the man deposits the rest in a
bank. If his monthly deposits in the bank amount 50, what is his
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 46/52
monthly salary ?
(A) Rs.500(B) Rs.1500
(C) Rs.1000
(D) Rs. 900
32. To change the default date format in a SQLPLUS Session you
have to
(A) Set the new format in the DATE_FORMAT key in the windows
Registry.(B) Alter session to set NLS_DATE-FORMAT.
(C) Change the Config.ora File for the date base.
(D) Change the User Profile USER-DATE-FORMAT.
33. Which of the following is not necessarily an advantages of using
a package rather than independent stored procedure in data base.
(A) Better performance. (B) Optimized memory usage.
(C) Simplified Security implementation. (D) Encapsulation.
34. Find the greatest no. that will divide 964,1238 and 1400 leaving
remainder of 41,31 and 51 resp.
a) 58 b) 64 c) 69 d) 71
35. If all 6‘s get inverted and become 9‘s , by how much will the
sum of all nos. between 1 and 100 both inclusive change?
a) 300 b) 330 c) 333 d) none of these
36. What is the output of the program
void main(){
struct a
{
int i;
char *st1;
};typedef struct a ST;
ST *str1;
str1=(ST*)malloc(100);
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 47/52
str1->i=100;
strcpy(str1->st1,"Welcome to Oracle");printf(" %d%s\n",str1->i,str1->st1);
getch();
} // A. core dump
// B. will not compile
// c. 100,Welcome to Oracle // D. None of theseAns: C
37. What is the output of the program
void main()
{
int i,j,k;i=2;
j=4;
k=i++>j&2;
printf("%d\n",k);
if(++k && ++i<--j|| i++){
j=++k;
}
printf(" %d %d %d",i,-j--,k);getch();
} // A. 4,-3,2
// B. 5,-3,2
// c. 4,-2,2 // D. 5,-2,2
Ans: D
38. What is the output of the program
#include<stdio.h>#include<conio.h>
void main()
{
int i,j=20;
clrscr();
for(i=1;i<3;i++){
printf("%d,",i);
continue;
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 48/52
printf("%d",j);
break;}
getch();
} // A. 1,20
// B. 1,20,1,20
// c. 1,2 // D. 1,2,20,20
Ans: c
39. x% of y is y% of ?
(A) x/y
(B) 2y(C) x
(D) can't be determined
40. The price of sugar increases by 20%, by what % should a
housewife reduce the consumption of sugar so that expenditure onsugar can be same as before ?
(A) 15%
(B) 16.66%
(C) 12%(D) 9% ell me about yourself: -
The most often asked question in interviews. You need to have a
short statement prepared in your mind. Be careful that it does not
sound rehearsed. Limit it to work-related items unless instructed
otherwise. Talk about things you have done and jobs you have held
that relate to the position you are interviewing for. Start with the
item farthest back and work up to the present.
What experience do you have in this field? -
Speak about specifics that relate to the position you are applying
for. If you do not have specific experience, get as close as you can.
Do you consider yourself successful?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 49/52
You should always answer yes and briefly explain why. A good
explanation is that you have set goals, and you have met some and
are on track to achieve the others.
What do co-workers say about you?
Be prepared with a quote or two from co-workers. Either a specific
statement or a paraphrase will work. Jill Clark, a co-worker at Smith
Company, always said I was the hardest workers she had ever
known. It is as powerful as Jill having said it at the interview herself.
What do you know about this organization?
This question is one reason to do some research on the organization
before the interview. Find out where they have been and where they
are going. What are the current issues and who are the major
players?
What have you done to improve your knowledge in the last
year?
Try to include improvement activities that relate to the job. A wide
variety of activities can be mentioned as positive self-improvement.
Have some good ones handy to mention.
Are you applying for other jobs? - Be honest but do not spend a lot
of time in this area. Keep the focus on this job and what you can do
for this organization. Anything else is a distraction.
Why do you want to work for this organization?
This may take some thought and certainly, should be based on the
research you have done on the organization. Sincerity is extremely
important here and will easily be sensed. Relate it to your long-term
career goals.
Do you know anyone who works for us?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 50/52
Be aware of the policy on relatives working for the organization.
This can affect your answer even though they asked about friends
not relatives. Be careful to mention a friend only if they are well
thought of.
What kind of salary do you need?
A loaded question. A nasty little game that you will probably lose if
you answer first. So, do not answer it. Instead, say something like,
That‘s a tough question. Can you tell me the range for this position?
In most cases, the interviewer, taken off guard, will tell you. If not,
say that it can depend on the details of the job. Then give a wide
range.
Are you a team player?
You are, of course, a team player. Be sure to have examples ready.
Specifics that show you often perform for the good of the team
rather than for yourself are good evidence of your team attitude. Do
not brag, just say it in a matter-of-fact tone. This is a key point.
How long would you expect to work for us if hired?
Specifics here are not good. Something like this should work: I‘d
like it to be a long time. Or As long as we both feel I‘m doing a good
job.
Have you ever had to fire anyone? How did you feel about
that?
This is serious. Do not make light of it or in any way seem like you
like to fire people. At the same time, you will do it when it is the
right thing to do. When it comes to the organization versus the
individual who has created a harmful situation, you will protect the
organization. Remember firing is not the same as layoff or reduction
in force.
What is your philosophy towards work?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 51/52
The interviewer is not looking for a long or flowery dissertation here.
Do you have strong feelings that the job gets done? Yes. That‘s the
type of answer that works best here. Short and positive, showing a
benefit to the organization.
If you had enough money to retire right now, would you?
Answer yes if you would. But since you need to work, this is the
type of work you prefer. Do not say yes if you do not mean it.
Have you ever been asked to leave a position? - If you have not,
say no. If you have, be honest, brief and avoid saying negative
things about the people or organization involved.
Explain how you would be an asset to this organization?
You should be anxious for this question. It gives you a chance to
highlight your best points as they relate to the position being
discussed. Give a little advance thought to this relationship.
Why should we hire you?
Point out how your assets meet what the organization needs. Do not
mention any other candidates to make a comparison.
Tell me about a suggestion you have made - Have a good one
ready. Be sure and use a suggestion that was accepted and was
then considered successful. One related to the type of work applied
for is a real plus.
What is your greatest strength?
Numerous answers are good, just stay positive. A few good
examples: Your ability to prioritize, Your problem-solving skills, Your
ability to work under pressure, Your ability to focus on projects,
Your professional expertise, Your leadership skills, Your positive
attitude .
Tell me about your dream job.?
7/27/2019 aricent ppr.docx
http://slidepdf.com/reader/full/aricent-pprdocx 52/52
Stay away from a specific job. You cannot win. If you say the job
you are contending for is it, you strain credibility. If you say another
job is it, you plant the suspicion that you will be dissatisfied with
this position if hired. The best is to stay genetic and say something
like: A job where I love the work, like the people, can contribute
and can‘t wait to get to work.