UP Police Programmer
UP Police Programmer
43. The sequence of operations that happens during an instruction fetch cycle is-
(A) PC MAR Memory MDR IR (B) PC Memory MDR IR
(C) PC Memory IR (D) PC MAR Memory IR
48. Two common wildcard characters that Microsoft Excel recognizes are
(A) * and ? (B) < and > (C) ^ and / (D) + and –
49. How many 2-input multiplexers are required to construct a 210 input multiplexer ?
(A) 1023 (B) 31 (C) 10 (D) 127
50. To add two cells (A1 and A2) together in Microsoft Excel one should use the following
formula
(A) = A1 + A2 (B) = Add (A1+ A2)
(C) = together (A1 : A2) (D) A1 plus A2
57. representation requires the least number of bits to store the number +255.
(A) BCD (B) 2’s complement (C) Signed binary (D) Unsigned binary
58. Using Bubble Sort in how many passes number 9 would be in its place for the given
sequence ?
20 1 7 9 30 45 10
(A) 4 (B) 3 (C) 2 (D) 1
59. The combinational circuit in the following figure can be replaced by a single
61. The 2’s compliment of a binary no. is obtained by adding to its 1’s compliment.
(A) 0 (B) 1 (C) 10 (D) 12
62. What is the shortest command to take you to your home directory ?
(A) cd ~ (B) cd $HOME
(C) cd – (D) cd h
65. Which of the following concurrency control protocols ensure both conflict serializability
and freedom from deadlock ?
i) Two phase locking, ii) Time stamp ordering
(A) i) Only (B) ii) Only
(C) Both i) and ii) (D) Neither i) nor ii)
66. If you want to retain the first four bits of a given binary string of 8 bits and complement last
four bits then the correct mask and operation should be (consider first bit as MSB).
(A) 00001111 and AND (B) 11110000 and XOR
(C) 00001111 and XOR (D) 11110000 and OR
67. Which of the following clause is usually used together with aggregate function ?
(A) ORDER BY ASC (B) GROUP BY
(C) ORDER BY DESC (D) None of the above
68. What command is used to count the total number of lines, words, and characters contained
in a file ?
(A) countw (B) wcount (C) wc (D) count p
72. The SQL Data Definition Language (DDL) provides commands for
(A) Defining relation schemas (B) Deleting relations
(C) Modifying relation schemas (D) All of the above
73. Time complexity to search an element in linked list and in an ordered linked list in worst
case is as follows
(A) O(1) , O(1) (B) O(n) , O(1) (C) O(1) , O(n) (D) O(n) , O(n)
80. The following algorithm requires all the edges to be ordered before making the minimum
spanning tree
(A) Dijkstra algorithm (B) Kruskal algorithm
(C) Prim algorithm (D) None of the above
84. What will be the output of the following code segment if it is invoked using the statement
Mystery (234) ?
int Mystery (int n){
if (n < = 0)
return n;
return (n % 10) + Mystery (n / 10);
}
(A) 9 (B) 432 (C) 234 (D) 24
88. The TWO fields found in both TCP and UDP headers that are essential for multiplexing and
de-multiplexing at the transport layer are
i) source port number
ii) source IP address
iii) destination host name
iv) destination port number
v) destination IP address
(A) i) & ii) (B) i) & iv) (C) ii) & v) (D) iii) & iv)
89. The Stop and Wait protocol is executed on a 10km wire between your modem and your ISPs
edge router. The propagation speed of an electrical signal on the wire is 200,000 km/sec.
The packet size is 1000 bytes. The time to generate an acknowledgment by the receiver
is 4 microseconds. The channel capacity is 100 Mbps. is the maximum efficiency
of the protocol.
(A) 43.48% (B) 37.15% (C) 53% (D) 100%
92. Suppose four active nodes—nodes A, B, C and D—are competing for access to a channel
using slotted ALOHA. Assume each node has an infinite number of packets to send. Each
node attempts to transmit in each slot with probability p. The first slot is numbered slot 1,
the second slot is numbered slot 2, and so on.
is the probability that some node (either A, B, C or D) succeeds in slot 4.
(A) (1 – 4 p(1 – p)3)24 p(1 – p)3
(B) (1 – p(1 – p)3)4 p(1 – p)3
(C) 1 – 4 p(1 – p)3
(D) 4 p(1 – p)3
94. Which of the following keys in a table can uniquely identify a row in a table ?
(A) Primary key (B) Alternate key
(C) Candidate key (D) All of the above
95. Consider a packet that travels from the output of one router to the input of the next router
across a single fiber optic link of bandwidth 100 Mbps. The packet is 500 bytes long, the
physical length of the link is 5 km, and the propagation speed of the link is 2.5 x 108 meters/
second. From the time the first bit of the packet is transmitted by the sending router until
the last bit of the packet is received by the receiving router is .
(A) 45 microseconds (B) 60 microseconds
(C) 120 microseconds (D) 180 microseconds
99. Tail recursion occurs when a linearly recursive method makes its recursive call as it’s :
(A) first step (B) middle step
(C) last step (D) None of the above
100. Your icon-based startup company owns the entire IP address space that belongs to the
class-B IP network 131.106.0.0. The company has 1000 machines (with one IP address
per machine) and does not anticipate any growth in its computing infrastructure. Due to
hard financial times, the company decides to sell its IP address space to nearby Microsoft,
except for one subnet that should be just large enough to include the company’s computers.
be the length of the subnet field (in bits) of IP addresses of hosts in your company
after the Microsoft arrangement takes place.
(A) 2 bits (B) 6 bits (C) 7 bits (D) 10 bits
Page- 19
x=4+“4”;
document.write(x);
}x();
</script>
(A) 44 (B) 8
(C) 4 (D) Error output
102. Which of the following statements is most appropriate for the code given below ?
int tryThis (char s [ ] ) {
int c1 = 0, c2 = 0, i = 0;
for (i = 0 ; s [ i ] ; i ++)
if (i % 2 = = 0)
c1 ++ ;
else
c2 ++ ;
return c1 – c2;
}
main ( ) {
if (!tryThis (“Palindromes”))
printf (“even”);
else
printf(“odd”);
}
(A) The program will not compile as the condition in for loop is not given properly.
(B) The program will not display anything as for loop is infinite.
(C) The output of the program will be even.
(D) The output of the program will be odd.
Page- 20
struct node *temp = front;
front = front -> next;
free(temp);
return temp -> info;
}
(B) int removeFromFront() {
struct node *temp = front;
front = front -> next;
return temp -> info;
free(temp);
}
(C) int removeFromFront(){
int x = front -> info;
front = front -> next;
return x;
}
(D) int removeFromFront(){
int x = front -> info;
struct node *temp = front;
front = front -> next;
free(temp);
return x;
}
107. OSI Model layer best describes the data integrity service.
(A) Physical (B) Transport (C) Session (D) Presentation
110. Consider a circular queue of size 4. What is the position of front and rear after the following
operations ?
Insert four elements A, B, C, D one after the other.
Delete element A and B and then insert element E.
(A) Front =0,rear=3(0 indicates first position) (B) Front =0,rear=4
(C) Front =1,rear=3 (D) Front =2,rear=0
(A) i), ii) & iii) are true (B) i) & ii) are true
116. __________ data communication method is used to transmit the data over a serial
communication link.
117. The value of a variable is retained across the function calls in storage class.
(C) Loss of protecting or maintaining secrecy over critical data of the organization
120. Which of the statement(s) in the following code segment will result in a syntax error ?
char a [ ] = “this”, b [ ] = “this”; // Line 1
while (*a != ‘ \0’ && *b != ‘\0’) { // Line 2
if (*a != *b) // Line 3
printf(“Not same”); // Line 4
++a ; // Line 5
++b ; // Line 6
}
if (*a == ‘ \0’ && *b == ‘\0’) // Line 7
printf(“Same”); // Line 8
(A) All the lines (B) Line 1, Line 2 and Line 3
(C) Line 5 only (D) Line 5 and Line 6
127. Ten out of fourteen stations on a LAN accept the same transmission. The destination
address is probably a address.
(A) unicast (B) multicast
(C) broadcast (D) None of the above
134. To connect a computer with a device in the same room, you might be likely to use a
(A) coaxial cable (B) ground station (C) dedicated line (D) none of the above
135. When you normalize a relation by breaking it into two smaller relations, what must you do
to maintain data integrity ?
(A) Link the relations by a common field and create primary key for the new relation
(B) Remove any functional dependencies from both relations
(C) Assign both relations the same primary key field(s)
(D) None of the above
142. To store the value 100 in each of the elements of the array A declared by
int [ ] A = new int[12];
Which of the following for loops would do this correctly ?
(A) for (int k = 1; k <= 12; k++)
A[k] = 100;
(B) for (int k = 0; k <= 12; k++)
A[k] = 100;
(C) for (int k = 1; k <= 11; k++)
A[k] = 100;
(D) for (int k = 0; k <= 11; k++)
A[k] = 100;
154. Which of the following parallel programming library doesn’t support shared memory
architecture ?
(A) OpenMP (B) MPI
(C) PThreads (D) None of the above
155. If we draw a binary search tree of the sequence 30 9 15 45 24 8 5 75 50 80. Then the no.
of nodes in left sub tree, right sub tree and height of the tree are as follows: (note: empty
tree is considered of height 0)
(A) 5 4 3 (B) 5 4 4 (C) 6 5 4 (D) 6 5 3
159. Which of the following variable declaration would not be compiled in a Java program ?
(A) int var; (B) int VAR; (C) int var1; (D) int 1_var