Computer Science MCQs | Computer Science Multiple Choice Questions with Answers

Questions
1 Consider the following schemas : Branch_Schema = (branch_name, assets, city) Customer_Schema = (cutstomer_name, street, city) Deposit_Schema = (branch_name, account_number, customer_name, balance) Borrow_Schema = (branch_name, loan_number, customer_name, amount) Which of the following tuple relational calculus finds all customers who have loan amount more than ` 12,000 ?
A {t(customer_name) | t∈borrow[?] t[amount]>12000}
B {t |t(customer_name) | t∈borrow[?] t[amount]>12000}
C {t |[?] ∈ borrow (t(customer_name=s(customer_ name))[?] [amount]>12000}
D {t |[?] ∈ borrow (t(customer_name)[?] s[amount] >12000}

Answer: Option [A]
2 Sixty (60) reusable components were available for an application. If only 70% of these components can be used, rest 30% would have to be developed from scratch. If average component is 100 LOC and cost of each LOC is ` 14, what will be the risk exposure if risk probability is 80% ?
A ` 25,200
B ` 20,160
C ` 25,160
D ` 25,160

Answer: Option [B]
3 Consider the following two function declarations : (i) int *f( ) (ii) int (*f)( ) Which of the following is true ?
A Both are identical
B The first is a correct declaration and the second is wrong
C Both are different ways of declaring pointer to a function
D The first declaration is a function returning a pointer to an integer and the second is a pointer to function returning integer

Answer: Option [D]
4 Assume that we have constructor function for both Base and Derived classes. Now consider the declaration : main ( ) Base *p = new Derived; In what sequence, the constructor will be executed ?
A Derived class constructor is followed by Base class constructor
B Base class constructor is followed by Derived class constructor
C Base class constructor is never called
D Derived class constructor is never called

Answer: Option [A]
5 MPEG involves both spatial compression and temporal compression. The spatial compression is similar to JPEG and temporal compression removes ______ frames.
A Temporal
B Voice
C Spatial
D Redundant

Answer: Option [B]
6 If the data unit is 111111 and the divisor is 1010. In CRC method, what is the dividend at the transmission before division ?
A 1111110000
B 1111111010
C 111111000
D 111111

Answer: Option [B]
7 If user A wants to send an encrypted message to user B. The plain text of A is encrypted with the _______.
A Public Key of user A
B Public Key of user B
C Private Key of user A
D Private Key of user B

Answer: Option [B]
8 A _____ can forward or block packets based on the information in the network layer and transport layer header.
A Proxy firewall
B Firewall
C Packet filter firewall
D Message digest firewall

Answer: Option [B]
9 Which of the following graphics devices are known as active graphics devices ? (i) Alphanumeric devices (ii) Thumb wheels (iii) Digitizers (iv) Joystics
A (i) and (ii)
B (iii) and (iv)
C (i), (ii) and (iii)
D (i), (ii), (iii) and (iv)

Answer: Option [B]
10 A diametric projection is said to be trimetric projection when (i) two of the three foreshortening factors are equal and third is arbitrary. (ii) all of the three foreshortening factors are equal. (iii) all of the three foreshortening factors are arbitrary. Which of the above is true ?
A (i) and (ii)
B (ii) and (iii)
C (i) only
D (iii) only

Answer: Option [B]
11 Which of the following is/are fundamental method(s) of antialiasing ? (i) Increase of sample rate. (ii) Treating a pixel as a finite area rather than as a point. (iii) Decrease of sample rate.
A (i) and (ii)
B (ii) and (iii)
C (i) only
D (ii) only

Answer: Option [A]
12 The two color systems – the HSV and HLS are
A Hue, Saturation, Value and Hue, Lightness, Saturation
B High, Standard, Value and High, Lightness, Saturation
C Highly, Saturated, Value and Highly, Lightened, Saturation
D Highly, Standard, Value and Hue, Lightness, Saturation

Answer: Option [B]
13 Consider the following sequence of operations : (i) Pointer p1 is set to point at a new heap-dynamic variable. (ii) Pointer p2 is assigned p1’s value. (iii) The heap dynamic variable pointed to by p1 is explicitly de-allocated, but p2 is not changed by the operation. This situation leads to which of the following :
A p1 becomes a dangling pointer
B p2 becomes a dangling pointer
C Both p1 and p2 are now dangling pointer
D Neither p1 nor p2 is now a dangling pointer

Answer: Option [D]
14 The programming languages C and C++ are not strongly typed languages because :
A Both C and C++ allow functions for which parameters are not type checked
B Both C and C++ allow functions for which parameters are type checked
C Both C and C++ allow functions for which parameters are not type checked and also the union types in these languages are not type checked
D Union types in these (C and C++) languages are not type checked

Answer: Option [A]
15 The tracing model in Prolog describes program execution in terms of certain events. These events are
A call and exit
B call and fail
C call, exit and redo
D call, exit, redo and fail

Answer: Option [B]
16 Given 0-1 knapsack problem and fractional knapsack problem and the following statements : S 1 : 0-1 knapsack is efficiently solved using Greedy algorithm. S 2 : Fractional knapsack is efficiently solved using Dynamic programming. Which of the following is true ?
A S1 is correct and S2 is not correct
B Both S1 and S2 are correct
C Both S1 and S2 are not correct
D S1 is not correct and S2 is correct

Answer: Option [B]
17 A system contains 10 units of resource of same type. The resource requirement and current allocation of these resources for three processes P, Q and R are as follows : P Q R Maximum requirement 8 7 5 Current allocation 4 1 3 Now, consider the following resource requests : (i) P makes a request for 2 resource units. (ii) Q makes request for 2 resources units. (iii) R makes a request of 2 resource units. For a safe state, which of the following options must be satisfied ?
A Only request
B Only request (ii)
C Only request (iii)
D Request (i) and (ii)

Answer: Option [B]
18 Consider a main memory with 3 page frames for the following page reference string : 5, 4, 3, 2, 1, 4, 3, 5, 4, 3, 4, 1, 4 Assuming that the execution of process is initiated after loading page 5 in memory, the number of page faults in FIFO and second chance replacement respectively are
A 8 and 9
B 10 and 11
C 7 and 9
D 9 and 8

Answer: Option [B]
19 Which of the following shell scripts will produce the output “my first script” ?
A for i in my first script { echo –i $i}
B for my first script; do echo –n; done
C for i in my first script; do echo –i $i; done
D for n in my first script; do echo –i $i; done

Answer: Option [B]
20 The portion of Windows 2000 operating system which is not portable is
A processor management
B user interface
C device management
D virtual memory management

Answer: Option [B]