AP COMP SCI MIDTERM (practice questions)
Convert the decimal number 67 to binary:
1000011
The decimal number 50 in binary:
110010
Largest number a computer can store with 7 bits:
127
How many different values can be represented using 4 bits?
16 different values
What is the minimum number of bits you would need to encode the 26 letters of the alphabet plus a space - a total of 27 characters?
5 bits
How many different numbers can you represent if you have 6 bits?
64
8 bits is enough to represent 256 different numbers. How many total bits do you need to represent 512 (twice as many) numbers? A. 9 bits B. 10 bits C. 16 bits D. 17 bits
A) 9 bits
A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is 0. Which of the following is the best explanation for the result? A) An overflow error occurred. B) A round-off error occurred. C) The result was affected by lossy data compression. D) The result was approximated by a floating-point representation.
A) An overflow error occurred.
A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality? A) The song was saved using fewer bits per second than the original song. B) The song was saved using more bits per second than the original song. C) The song was saved using a lossless compression technique. D) Some information is lost every time a file is saved from one location on a computer to another location.
A) The song was saved using fewer bits per second than the original song.
Which of the following is true about packets? A) The receiving device acknowledges the first and last packets to indicate receipt of the data stream. B) Packets travel in order to their destination. C) Packets follow the shortest path to their destination. D) Packets are reassembled at their final destination.
D) explanation: Packets are created at the sending end of the transmission and reassembled at the final destination.
A user clicks on a website, and it begins to load immediately, but it takes a long time to load completely and pictures appear slowly, one by one. Which of the following is demonstrated through this situation? A. High bandwidth, high latency B. Low bandwidth, high latency C. High bandwidth, low latency D. Low bandwidth, low latency
D. Low bandwidth, low latency
The World Wide Web is used to access the Internet
FALSE
The metadata of the packet must contain the packet number, the receiver's address, and the destination address
FALSE
The protocols your device uses to send and receive messages via the internet depends on your device's operating system
FALSE
Which protocol checks to see if any packets don't arrive at the destination device?
TCP
How do TCP and UDP perform segmentation?
TCP performs segmentation by taking data chunks from applications and breaking them into smaller segments that will fit in the maximum transmission unit (MTU) of the underlying network layers. UDP does not perform segmentation; instead it expects the application process to send data in correct sizes.
How do TCP and IP differ?
TCP verifies the correct delivery of data in case it is corrupted, where IP verifies the data are sent to the correct IP address
Which protocol is used to play online games?
UDP
Intellectual property is assumed to be _______ even if it doesn't say it
copyright
If Einstein were alive today he would publish his research in _________ journals so that anyone could read it for free:
open access
What is the 4-bit binary number for the decimal number Ten (10)?
1010
Which of the following is LEAST likely to indicate a phishing attack? A) An e-mail from your bank asks you to call the number on your card to verify a transaction B) An e-mail from a merchant asks that you click on a link to reset your password C) An e-mail from a utility company asks you to enter your date of birth and social security number for verification purposes. D) An e-mail indicates that you have won a large sum of money and asks you to enter your bank account number so that the money can be transferred to you
A) An e-mail from your bank asks you to call the number on your card to verify a transaction
A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 6 and 2, the result is 0. Which of the following is the best explanation for this result? A) An overflow error occurred. B) A round-off error occurred. C) An off-by-one error occurred. D) The result was affected by lossy data compression.
A) An overflow error occurred.
A user enters a web address in a browser, and a request for a file is sent to a web server. Which of the following best describes how the file is sent to the user? A) The file is broken into packets for transmission. The packets must be reassembled upon receipt. B) The file is broken into packets for transmission. The user's browser must request each packet in order until all packets are received. C) The server attempts to connect directly to the user's computer. If the connection is successful, the entire file is sent. If the connection is unsuccessful, an error message is sent to the user. D) The server repeatedly attempts to connect directly to the user's computer until a connection is made. Once the connection is made, the entire file is sent.
A) The file is broken into packets for transmission. The packets must be reassembled upon receipt.
A student is transferring photos from her camera to her computer. The student notices that the saved photos on her computer are lower quality than the original raw photo on her camera.Which of the following could be a possible explanation for the difference in image quality? A) The saved image files were compressed with a lossy compression technique. B) The saved image files were compressed with a lossless compression technique. C) The saved image files were not compressed properly. D) Some information is lost every time a file is saved on a computer.
A) The saved image files were compressed with a lossy compression technique.
How do the World Wide Web and the Internet work together? A) They perform the same functionality. B) The web uses HTTP to share computational artifacts using the Internet. C) The Internet uses the Web to connect devices to share data. D) The Internet has the "deep" net and "dark" net but the Web does not.
B) explanation: The WWW is an application that uses HTTP to share documents, videos, images, and other files among devices connected to the Internet.
Which of the following best explains what happens when a new device is connected to the Internet? A) A device driver is assigned to the device. B) An Internet Protocol (IP) address is assigned to the device. C) A packet number is assigned to the device. D) A Web site is assigned to the device.
B) An Internet Protocol (IP) address is assigned to the device.
Which of the following is NOT true about TCP/IP packets? A) Packets are numbered so if they arrive out of order the message can be reassembled. B) TCP guarantees that no packets are ever dropped C) Packets can be routed on different paths from sender to receiver. D) Messages are broken into packets to improve reliability of the internet.
B) TCP guarantees that no packets are ever dropped
Which of the following is a characteristic of the fault-tolerant nature of routing on the Internet? A) The ability to use a hierarchical naming system to avoid naming conflicts B) The ability to provide data transmission even when some connections have failed C) The ability to resolve errors in domain name system (DNS) lookups D) The ability to use multiple protocols such as hypertext transfer protocol (HTTP), Internet protocol (IP), and simple mail transfer protocol (SMTP) to transfer data
B) The ability to provide data transmission even when some connections have failed
Which of the following are benefits of using well-named variables in a computer program? A) The program will run faster B) The program will be easier for people to read. C) The program will have a greater data storage capacity.
B) The program will be easier for people to read.
Which number system is used to store information digitally in a computer?
Binary (base 2)
How do TCP and IP interact? A) IP towards the data to the DNS server to identify which TCP to use. B) TCP hands off control to HTTP, which passes it to IP. C) TCP creates packets from the data to be sent and transfers control to IP for routing. TCP then reassembles the packets at the destination. D) IP uses the SSL in conjunction with TCP to securely send data.
C) explanation: TCP creates packets and passes control of them to IP which routes then to their final destination. TCP then reassembles the packets to display.
Which of the following activities poses the greatest personal cybersecurity risk? A) Making a purchase at an online store that uses public key encryption to transmit credit card information B) Paying a bill using a secure electronic payment system C) Reserving a hotel room by e-mailing a credit card number to a hotel. D) Withdrawing money from a bank account using an automated teller machine (ATM)
C) Reserving a hotel room by e-mailing a credit card number to a hotel.
Which of the following is a true statement about data compression? A) Data compression is only useful for files being transmitted over the Internet B) Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state. C) Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user. D) There are trade-offs involved in choosing a compression technique for storing and transmitting data.
D) There are trade-offs involved in choosing a compression technique for storing a transmitting data.
Which of the following is a true statement about data compression? A) Data compression is only useful for files being transmitted over the Internet. B) Regardless of the compression technique being used, once a data file is compressed, it cannot be restored back to its original state. C) Sending a compressed version of a file ensures that no one can read the contents of the file except for the intended recipient. D) There are trade-offs involved in choosing a compression technique for storing and transmitting data.
D) There are trade-offs involved in choosing a compression technique for storing and transmitting data.
When the Internet was created it was designed to be __________ so that people could still use it even if some pacers of it aren't working properly:
Fault tolerant
Which protocol splits the data into packets?
IP
If you want to use a creative commons license, you don't have to ask the creator if you can use it
TRUE
When a file is sent to you across the internet, the file is split into packets and the metadata in the packets contain the sender's IP address
TRUE
When data is sent from one device to another, the packets may not arrive in order
TRUE