Daily Exam Programmer 19-07-2024

Join us on Telegram


Q 1: Which of the following events will cause a thread to die
(1) The method sleep() is called
(2) The method wait () is called
(3) Execution of the start() method ends
(4) Execution of the run() method ends
Correct Answer: Execution of the run() method ends

Q 2: 12. Consider the following class definition:

public class MyClass

private int value:

public void setValue(int i){ /* code */}

// Other methods...
}


The method setValue assigns the value of i to the instance field value. What could you write for the implementation of setValue?
(1) value = i;
(2) this.value = i;
(3) value ==i;
(4) all
Correct Answer: all

Q 3: Which of the following is TRUE?
(1) In java, an instance field declared public generates compilation error.
(2) int is the name of a class available in the package java.lang
(3) Instance variable names may only contain letters and digits.
(4) A class has always a constructor (possibly automatically supplied by the java compiler).
Correct Answer: A class has always a constructor (possibly automatically supplied by the java compiler).

Q 4: Which of the following difference between Bluetooth and wi-fi is correct?
(1) Bluetooth uses 2.4 GHz radio frequency band, whereas wi-fi can use 2.4 GHz or 5 GHz frequency band.
(2) Bluetooth is used for Wireless Local Area Network (WLAN) only whereas wi-fi is used for Wireless Wide Area Networks (WWAN) only.
(3) When information is transmitted between two devices using Bluetooth technology, the devices have to be in line of sight of each other, but when wi-fi technology is used the devices need not be in the line of sight of each other.
(4) Both the statement (Bluetooth uses 2.4 GHz radio frequency band, whereas wi-fi can use 2.4 GHz or 5 GHz frequency band.) & (Bluetooth is used for Wireless Local Area Networks (WLAN) only whereas wi-fi is used for Wireless Wide Area Networks (WWAN) only.) are correct in this context.
Correct Answer: Bluetooth uses 2.4 GHz radio frequency band, whereas wi-fi can use 2.4 GHz or 5 GHz frequency band.

Q 5:

Risk tables are sorted by

(1) Probability and cost
(2) Probability and impact
(3) Probability and size
(4) Probability and exposure
Correct Answer: Probability and impact

Q 6: IGMP is a companion to the ........... protocol
(1) UDP
(2) TCP
(3) ICM
(4) None
Correct Answer: None

Q 7: In HTTP, for sending data to server which of the following command(s) is used
(1) GET
(2) POST
(3) Either GET or POST
(4) Neither GET nor POST
Correct Answer: POST

Q 8: How many identifiers we need to define the webpage
(1) 2
(2) 3
(3) 4
(4) 5
Correct Answer: 4

Q 9: Consider a file of 16384 records. Each record is 32 bytes long and its key field is of size 6 bytes. The file is ordered on a non-key field, and the file organization is unspanned. The file is stored in a file system with block size 1024 bytes, and the size of a block pointer is 10 bytes. If the secondary index is built on the key field of the file, and a multilevel index scheme is used to level and second-level blocks in the multilevel index are respectively
(1) 512 and 5
(2) 128 and 6
(3) 256 and 4
(4) 8 and 0
Correct Answer: 256 and 4

Q 10: The following key values are inserted into a B+ tree in which order of the internal nodes is 3, and that of the leaf nodes is 2, in the sequences given below. The order of internal nodes is the maximum number of free pointers in each node, and the order of leaf nodes is the maximum number of data items that can be stored in it. The B+ tree is initially empty.

10, 3, 6, 8, 4, 2, 1

The maximum number of times leaf nodes would get split up as a result of these insertions is
(1) 4
(2) 3
(3) 2
(4) 5
Correct Answer: 5