所屬科目:學士後西醫◆計算機概論與程式設計
1. “Hash Table” is an effective data structure for implementing dictionaries. What is a hash table and how does it work? (A) A hash table is a data structure that uses a hash function to map keys to values, allowing for fast retrieval of data. (B) A hash table is a data structure that stores data in a sorted manner for fast searching. (C) A hash table is a data structure that allows for efficient sorting of data. (D) A hash table is a data structure that stores data in a hierarchical manner for fast searching. (E) None of the above.
2. Overfitting is an undesirable machine learning behavior that occurs when the machine learning model gives accurate predictions for training data but not for new data. There are some techniques that could ease or even solve this problem. Which of the following techniques can NOT avoid overfitting problem? (A) Increasing layers / number of units per layer. (B) Using Lasso / Ridge regularization. (C) Early stopping while training model. (D) Adding dropout between layers. (E) Cross-validation.
3. What is the result of -22 in the two’s complement representation with an 8-bit allocation?(A) 0001 0101 (B) 0001 0110 (C) 1110 1010 (D) 1110 1001(E) None of the above.
4. Given the boolean function F = AB'C' + BCD' + CD + B'C'D', what is the maximum number of terms that it can be simplified to? (A) 1 (B) 2 (C) 3 (D) 4 (E) 5
5. Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with a frame size of 4, which means that a maximum of 4 pages can be in a frame. Use the First In First Out (FIFO), Least Recently Used (LRU), and Optimal Page Replacement (OPT) algorithms to calculate page faults. What are the page faults for each algorithm? (A) FIFO: 9, LRU: 8, OPT: 6 (B) FIFO: 8, LRU: 8, OPT: 7 (C) FIFO: 9, LRU: 9, OPT: 6 (D) FIFO: 10, LRU: 8, OPT: 7 (E) FIFO: 7, LRU: 9, OPT: 6
6. Assuming a memory access time of 250 nanoseconds and an average page fault handling time of70 microseconds, what is the expected page fault rate if you want to ensure that the effective access time is less than 270 nanoseconds?(A) 0.002% (B) 0.02% (C) 0.2% (D) 2% (E) 20%
7. Which of the following activation functions is commonly used in the output layer of neural networks and performs well in multi-class classification problems? (A) Softmax (B) Leaky ReLU (C) Tanh (D) ReLU (E) Sigmoid
8. Which of the followings is an example of a race condition in a multi-threaded program?(A) A thread waiting indefinitely for a resource.(B) A deadlock caused by two threads trying to acquire each other's locks.(C) Two threads executing concurrently and attempting to access shared data without synchronization.(D) A thread executing multiple times when it should only execute once.(E) None of the above.
9. In operating system, which scheduling algorithm can obtain the shortest waiting time for all processes in average?(A) First-Come-First-Served(B) Priority scheduling(C) Shortest-Job-First(D) Round-Robin(E) Multilevel Queue scheduling
10. Which term specifically refers to the entity created by encapsulating data within data-link layer headers and trailers? (A) Data (B) Chunk (C) Segment (D) Packet (E) Frame
11. A company has a network address of 192.168.1.64 with a subnet mask of 255.255.255.192. Thecompany wants to create two subnetworks that would contain 10 hosts and 18 hosts respectively.Which of the following networks would achieve that?(A) 192.168.1.16/28 (B) 192.168.1.64/27(C) 192.168.1.128/27 (D) 192.168.1.192/28(E) None of the above.
12. The DARPA technology includes a set of network standards that specify the details of how computers communicate, as well as a set of conventions for interconnecting networks and forwarding traffic. Officially named the TCP/IP Internet Protocol Suite and commonly referred to as TCP/IP (after the names of its two main standards), it can be used to communicate across any set of interconnected networks. Which of the following statements about TCP/IP is INCORRECT? (A) TCP/IP is a suite of protocols for communication over the internet. (B) TCP is a connection-oriented protocol that guarantees reliable delivery of data. (C) IP is a connectionless protocol that provides a best-effort delivery service. (D) TCP uses a three-way handshake to establish a connection between two hosts. (E) UDP is a more reliable protocol than TCP.
13. The pre-order traversal of a Binary Search Tree (BST) is 31, 27, 21, 12, 25, 30, 29, 38, 33, 41 and its in-order traversal is 12, 21, 25, 27, 29, 30, 31, 33, 38, 41. When the element to be deleted is in a non-leaf node that has two children, the element is replaced by the largest element in its left subtree. When a key value 36 is inserted into the binary search tree, which of the following statements is CORRECT (A) The key value 38 is the parent of key value 36. (B) The key value 30 has two children. (C) The key value 27 is the parent of key value 25. (D) The BST has three leaf nodes. (E) If we delete the key value 30, then key value 29 will inherit it.
14. What is the value of the node at index 2 (with the root at index 1) in a max-heap that is represented as an array, after inserting the following 6 numbers in this precise order: 8, 12, 12, 9, 10, 11?(A) 9 (B) 10(C) 11 (D) 12(E) None of the above.
15. Suppose we have two tables, as shown below named STUDENT_TABLE and AGE_TABLE, respectively. Consider the following SQL query: Regarding the result of executing this query, which of the following comments is CORRECT? (A) Peter’s age is 20 (B) The average age of Male is 21.75 (C) The Sex of T_ID 4 is Female (D) (John’s Age + Jack’s Age) mod (Emma’s Age + Jack’s Age) = 8 (E) None of the above.
16. Which one of the options below is NOT a sorting algorithm that performs in-place sorting in their typical implementations? (A) Bubble sort (B) Insertion sort (C) Merge sort (D) Heap sort (E) Quick sort
17. What is the difference between a fully connected layer and a convolutional layer in a neural network? (A) Fully connected layers are only used in supervised learning, while convolutional layers are used in unsupervised learning. (B) Fully connected layers require less computation than convolutional layers. (C) Fully connected layers connect every input neuron to every output neuron, while convolutional layers only connect a subset of input neurons to a subset of output neurons. (D) Convolutional layers are used for time-series data, while fully connected layers are used for image data. (E) Convolutional layers are used for classification tasks, while fully connected layers are used for regression tasks.
18. Ackermann's function is an example of a recursive function which is not primitive recursive. It is interesting from the point of view of benchmarking because it "grows faster than any primitive recursive function." Ackermann's function is defined as follows: A(0,n)=n+1 A(m,0)=A(m-1,1) A(m,n)=A(m-1,A(m,n-1)) What is the A(1,3) return value of the following program?(A) 2 (B) 3 (C) 4 (D) 5 (E) 6
19. Given the head of a linked list, determine whether the linked list has a cycle. If it does have a cycle, return true; otherwise, return false. The example and algorithm are shown below. Which of the followings should be "Q1" and "Q2" in the algorithm? (A) Q1: a = a -> next; Q2: b = b -> next; (B) Q1: a = b; Q2: b = b -> next; (C) Q1: a = a -> next; Q2: b = b -> next; (D) Q1: a = a -> next -> next; Q2: b = b -> next; (E) Q1: a = a -> next; Q2: b = b -> next -> next;
20. What is the output of the following C program?(A) 123 (B) 243 (C) 303 (D) 183 (E) None of the above.
21. Which of the following statements correctly describes the output of the following C program, where the function foo is called at least three times with different arguments:(A) The program will not compile because of an error in the function foo.(B) The program will output 12.(C) The program will output 18.(D) The program will output 20.(E) The output cannot be determined without knowing the implementation of the function foo.
22. What is the output of the following C code?(A) 71989 (B) 71889(C) 81889 (D) 829810(E) None of the above.
23. Which of the following techniques can be used to help prevent SQL injection attacks?(A) Concatenating user input with SQL queries.(B) Using stored procedures.(C) Storing sensitive data in plain text.(D) Creating complex table names.(E) Ignoring input validation.
24. Which of the following statements is related to a characteristic or application of asymmetric encryption? (A) Asymmetric encryption is highly efficient for encrypting large amounts of data, making it the primary choice for cloud storage. (B) Asymmetric encryption is widely used for digital signature and digital envelope. (C) Asymmetric encryption requires that both the sender and receiver share the same private key, which is used to encrypt and decrypt the data, making it less secure than symmetric encryption. (D) Asymmetric encryption uses the same key for both encryption and decryption, making it a popular choice for real-time messaging applications. (E) In asymmetric encryption, only the sender has access to the decryption key, ensuring that intercepted data cannot be deciphered by unauthorized parties.
25. A DDoS attack attempts to consume the target’s resources so that it cannot provide service. What is a distributed denial of service (DDoS) attack and how does it work? (A) A type of malware that infects multiple machines and spreads through a network. (B) A type of cyber attack that targets an individual user's personal information. (C) A type of attack that attempts to overload a server or network with traffic from multiple sources. (D) A type of attack that exploits vulnerabilities in software to gain unauthorized access to a system. (E) A type of attack that intercepts and manipulates data transmitted over a network.
26. RSA (Rivest Shamir Adleman) is a public-key cryptosystem that is widely used for secure data transmission. In RSA, if the public key (e, N) is (5, 77), the private key (d, N) is (9, 77), and the plaintext is 4, what is the corresponding ciphertext? (A) 7 (B) 16 (C) 13 (D) 23 (E) 18
27. Which of the following statements about Big O notation is CORRECT?(A) Big O notation provides the exact running time of an algorithm.(B) Big O notation can be used to compare algorithms only if they are similar algorithms.(C) Big O notation provides the best-case running time of an algorithm.(D) Big O notation ignores constants and lower-order terms.(E) Big O notation is only used to analyze sorting algorithms.
28. What is the difference between a generative and a discriminative model? (A) A generative model learns the underlying probability distribution of the data, while a discriminative model learns the decision boundary between classes. (B) A generative model learns the decision boundary between classes, while a discriminative model learns the underlying probability distribution of the data. (C) A generative model is unsupervised, while a discriminative model is supervised. (D) A generative model is used for regression, while a discriminative model is used for classification. (E) None of the above.
29. ChatGPT is a large-scale language model trained by OpenAI, which is mainly trained to understand and generate natural language. Which of the following statements about ChatGPT is CORRECT? (A) ChatGPT has used fine-tuning. (B) It handles context through a history of previous conversation turns. (C) The GPT model is developed based on the Transformer architecture. (D) ChatGPT uses supervised learning. (E) All of the above.
30. Which of the following statements about ROC curve and AUC is INCORRECT? (A) Usually, the y-axis is the true positive rate. (B) AUC is used as an indicator of the quality of the model. (C) The perfect prediction is at the ROC space coordinate (0, 1) point. (D) If AUC=0.5, it means that the model is the same as random guessing, and has no predictive value. (E) If AUC<0.5 means that the model will not be better than random prediction in any way.
(1) SCAN (Elevator) algorithm. (5%)
(2) C-SCAN (Circular SCAN) algorithm. (5%)
2. Given the block diagram of a 2-to-4 decoder with enable, design a 1-to-16 demultiplexer (DeMUX) with one input signal I, four selection signals from S0 to S3, and sixteen output signals from O0 to O15 by using block diagrams of 2-to-4 decoder. (10%)
(1) What is the precision? (2%)
(2) What is the Recall? (2%)
(3) What is the Accuracy? (2%)
(4) What is the Specificity? (2%)
(5) What is the F1 score? (2%)
4. What will be shown on the screen after running the following program? (10%)