- Home
- MCQs by exam
- Campus Interviews
- Computer Science MCQs
Campus Interviews MCQs – Computer Science MCQs · Page 10
346 multiple choice questions typical of the Campus Interviews exam, with answers and explanations. Switch on practice mode to test yourself first.
-
A
The number of differing characters in the strings
-
B
A negative value, because "apple" sorts first
Correct answer
-
C
Zero, because the strings are different
-
D
A positive value, because "apple" is longer
-
A
Both the pointer and the characters are fixed
-
B
Nothing, since const is ignored on pointers
-
C
The pointed-to characters cannot be modified
Correct answer
-
D
The pointer p cannot be reassigned
-
A
It raises a runtime fault on the expression
-
B
It skips evaluating the right operand
Correct answer
-
C
It evaluates both operands and compares them
-
D
It falls back to a bitwise AND on the bits
-
A
20, the array's second element
-
B
10, the element at the base address
-
C
The address of the third element itself
-
D
30, the third element of the array
Correct answer
-
A
Allocates 100 bytes of static storage
-
B
Creates a function named MAX returning 100
-
C
Performs textual substitution before compilation
Correct answer
-
D
Declares a constant integer variable at run time
-
A
continue, which jumps ahead to the next iteration of the loop
-
B
return, which leaves the whole function
-
C
goto, which jumps to a labelled statement
-
D
break, which transfers control after the construct
Correct answer
-
A
Garbage values from the previous stack contents
-
B
2, because the last value is repeated
-
C
1, because the initialiser wraps around
-
D
0, because the remaining elements are zeroed
Correct answer
-
A
%c
-
B
%s
-
C
%f
Correct answer
-
D
%d
-
A
p.age, which selects from the pointer itself
-
B
*p.age, which binds the dot first
-
C
&p.age, which takes the member address
-
D
p->age, which dereferences and selects
Correct answer
-
A
'D', because the second letter position is skipped
-
B
'C', because letters have consecutive codes
Correct answer
-
C
65, because the value stays numeric
-
D
'B', because incrementing adds one
-
A
5, the characters before the terminating null byte
Correct answer
-
B
6, counting the terminating null byte as well
-
C
4, because the first character is not counted at all
-
D
It is undefined for a string literal argument
-
A
The switch statement, which selects a case label
-
B
The do-while loop, which tests after the body
Correct answer
-
C
The while loop, which tests before the body
-
D
The for loop, which tests before the body
-
A
<math.h>
-
B
<stdlib.h>
Correct answer
-
C
<stdio.h>
-
D
<string.h>
-
A
3.5, because floating division keeps the fraction
-
B
4, because the result is rounded to nearest
-
C
2, because the result is rounded downward
-
D
3, because integer division truncates toward zero
Correct answer
-
A
1, because the two operands cancel out
-
B
5, the number of elements in the array
Correct answer
-
C
20, the total size of the array in bytes
-
D
4, the size of one integer element
-
A
Storing exactly one copy of each object
-
B
Acquiring and releasing resources automatically
Correct answer
-
C
Keeping a fixed pool of reserved servers
-
D
Moving workloads to cheaper regions
-
A
Replicas converge once writes stop
Correct answer
-
B
Reads always see the newest write
-
C
Writes are refused during a partition
-
D
Every replica holds a separate schema
-
A
Containers cannot be isolated at all
-
B
Containers share the host kernel
Correct answer
-
C
Containers each boot a full guest OS
-
D
Containers need a hypervisor to run
-
A
The maximum number of tenants
-
B
Guaranteed uptime and service credits
Correct answer
-
C
The platform's full source code
-
D
The exact hardware in every host
-
A
Isolating resources in a private network
Correct answer
-
B
Publishing an application to the internet
-
C
Running virtual machines on local hosts
-
D
Replicating a database across regions
-
A
Encrypts them at the network edge
-
B
Spreads them across healthy servers
Correct answer
-
C
Compresses them before storage
-
D
Assigns them to one fixed server
-
A
Nothing, if replicas exist
-
B
Consistency or availability
Correct answer
-
C
Durability or consistency
-
D
Latency or throughput
-
A
The licence count of the software
-
B
The number of load balancers used
-
C
The largest machine that can be bought
Correct answer
-
D
The number of network ports used
-
A
Per reserved virtual machine hour
-
B
Per gigabyte of block storage
-
C
Per administrator account
-
D
Per request and execution duration
Correct answer
-
A
Providing virtual machines on demand
-
B
Caching content at edge sites near users
Correct answer
-
C
Encrypting traffic between data centres
-
D
Balancing writes across database replicas