CS计算机代考程序代写 interpreter  This quiz has been regraded; your score was not affected.

 This quiz has been regraded; your score was not affected.

Midterm 1 MCQ
Due Oct 28 at 10am Points 65 Questions 13
Available Oct 28 at 8am – Oct 28 at 10am about 2 hours Time Limit 90 Minutes

Instructions
This is the MCQ exam
Read carefully! This text will also be on the Canvas
exam as well.

Hello students,

Welcome to the CSE130 Midterm 1! Please keep in mind these instructions before you hit start:

1. There are two exams. You must complete both of these exams in order to complete the entire exam.
Both exams have a hard time limit of 90 minutes each.

1. DRC accommodations have been noted and those who are eligible will be provided with extra
time respectively.

2. The examination window starts at 8:00 AM PST and ends at 10:00 AM PST. You are allowed to start
either exam’s 90-minute timer within this window.

3. You are not allowed to collaborate on the exam.

4. This exam is open book and open notes.

5. There are ~15 MC questions (barring any last-minute removals) and 8 FRQs, please read each
question carefully before answering.

You are expected to hit submit for both exams BEFORE 10:00 AM PST. There is a 15 minute time
window after 9:45 AM PST to allow for submissions in case of network connectivity issues. If you choose
to submit at 10:00 AM PST and fail to submit due to network connectivity issues, you are at fault for
waiting until the last minute.

This quiz was locked Oct 28 at 10am.

Attempt History
Attempt Time Score Regraded

We anticipate that you should budget your time as follows. Keep in mind that this is not a hard limit, but
our predicted time allocation for each question:

15 MC x 3 mins = 45 mins

8 FRQ x 5 min = 40 mins

Total: 85 minutes

If you open the exam and do not see any questions, please try a different browser or Incognito Mode.

YOU ARE RESPONSIBLE FOR HITTING SUBMIT FOR THE EXAM. WE CANNOT GUARANTEE A
GRADE FOR AN EXAM THAT IS NOT SUBMITTED.

While you take this exam, please CLOSE DISCORD. ALL ANNOUNCEMENTS RELATED TO THIS
EXAM (including corrections) WILL BE ON A PINNED POST ON PIAZZA.

DO NOT CONTACT US ON DISCORD DURING THE EXAM.

IF YOU HAVE QUESTIONS RELATED TO THE EXAM, PLEASE ASK US IN A PRIVATE POST ON
PIAZZA. PUBLIC POSTS WILL BE DELETED WITH UTMOST PREJUDICE.

After the exam, do not discuss exam content on discord or Piazza until the DRC students have
finished. We will make an announcement of when you are free to discuss the exam’s contents.
We expect this time to be approximately 11:30 AM PST.

Attempt Time Score Regraded

LATEST Attempt 1 26 minutes 40 out of 65 40 out of 65

Score for this quiz: 40 out of 65
Submitted Oct 28 at 8:28am
This attempt took 26 minutes.

5 / 5 ptsQuestion 1

When we bind a name N to a value V in a context C, it is necessary to
ensure that:

(b) There is no other value V’ that N points to in C. Correct!Correct!

(c) Both (a) and (b) are correct.

(a) There is no other name N’ in C that points to V.

(d) Neither (a) nor (b) is correct.

0 / 5 ptsQuestion 2

Suppose that “file” is a filename read from standard input. What is the
expected result of the following code sample?

char buf[13] = “Hello, World!”;

int fd = open(file, O_WRONLY | O_TRUNC);

int bytes_written = write(fd, buf, 13);

https://canvas.ucsc.edu/courses/45879/quizzes/60940/history?version=2

Bytes_written = -1. ou Answeredou Answered

Opens “file” for writing and overwrites the contents of “file” with the
contents of “buf.”

Opens “file” for writing and appends the contents of “buf” to the contents of
“file.”

Not enough information. orrect Answerorrect Answer

0 / 5 ptsQuestion 3

For a fixed size queue throughput is inversely proportional to latency.

True orrect Answerorrect Answer

False ou Answeredou Answered

5 / 5 ptsQuestion 4

In the interpreter abstraction applied to a CPU, which of the following is
part of the repertoire?

Program Counter

Stack Pointer

Exceptions

Instruction Set Correct!Correct!

5 / 5 ptsQuestion 5

A misbehaving client can interfere with a server by:

Overwriting a shared memory region.

None of these are correct

Sending it more data than it knows how to handle. Correct!Correct!

Returning into the wrong location.

0 / 5 ptsQuestion 6

fd is a descriptor for a normal file (not a pipe or stream) of length L > 50
that has just been

opened (but not yet read), and that buffer is declared as uint8_t buffer[B],
where B > 50. Which of the following is not a possible return value from
read(fd, buffer, sizeof(buffer))?

0 orrect Answerorrect Answer

B ou Answeredou Answered

L

-1

5 / 5 ptsQuestion 7

Alice looks up the address of her favorite website. It resolves to Bob’s IP
address. Bob does not, however, have the webpage that Alice is looking
for. Instead, after a quick lookup, Bob decides to connect to Carol, who
has a copy of the page and is not too busy right now. Bob downloads the
page that Alice wants from Carol, and uploads it to Alice. Bob is acting as
a:

Load balancer

Client

Server

All of these are correct Correct!Correct!

5 / 5 ptsQuestion 8

If you are a computer in San Francisco, and you want to send a message
to a computer in London, United Kingdom, how can you 100% ensure
that the London computer either did, or did not, receive your message?

If no reply came in 10 minutes, then the London computer for sure didn’t
receive the message.

Get a response from any intermediate router about the availability of the
London computer

This is impossible. Correct!Correct!

Receive an ACK from the London computer.

Original Score: 0 / 5 pts Regraded Score: 0 / 5 ptsQuestion 9

 This question has been regraded.

Which of the following should generate a 500 response code (internal
server error) in an HTTP server?

open() returns an error because the file doesn’t exist ou Answeredou Answered

open() returns an error on a PUT because the client asked to write a file
that has no write permissions

ou Answeredou Answered

open() returns an error because the server doesn’t have permission to
read a file

ou Answeredou Answered

write() returns an error while the server is writing user data for a PUT
operation

orrect Answerorrect Answer

5 / 5 ptsQuestion 10

Abstraction, modularity, layering and hierarchy are techniques for
managing complexity. Although they differ in their details, all of them
reduce complexity by:

Hiding private data from untrusted components

Isolating components from faults in other components

Hiding the details of a component’s implementation from its users

Reducing the possible interactions among components Correct!Correct!

5 / 5 ptsQuestion 11

Which of the following is an example of modularity:

All of these are correct Correct!Correct!

Grouping a collection of functions and data over which they operate into a
class

Hosting functionality as a server on a remote machine

Moving code into a function

5 / 5 ptsQuestion 12

Compared to soft modularity via procedure calls, client server systems
have _________________ .

More possible executions.

Stronger isolation from faults.

All of these are correct Correct!Correct!

More complicated implementations

0 / 5 ptsQuestion 13

A thread virtualizes a ____________________ via aggregation.

None of these are correct orrect Answerorrect Answer

Processor

Core ou Answeredou Answered

Process

Quiz Score: 40 out of 65