-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathSampleQuestions.html
236 lines (221 loc) · 10.2 KB
/
SampleQuestions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Sample Questions</title>
</head>
<body>
<center><h1>Sample Exam (midterm/final part I) Questions</h1></center>
<p>
These are examples of a few different types of questions that have been asked
on other mid-terms, along with examples of full-credit, 2/3 credit, and 1/3 credit
answers to those questions. The purpose of these examples is to show you:
</p><ul>
<li> What kinds of questions I am likely to ask </li>
<li> What kinds of answers I am expecting to see </li>
</ul>
<p></p>
<h2> General considerations </h2>
<p>
For full credit I am generally looking to see that:
</p><ul type="a">
<li>You understand the question, including a clear understanding of
the meanings of all terms used in the question.</li>
<li>You understand the concepts and issues that the question is exploring.</li>
<li>You understand or are able to determine what the most important factors are.</li>
<li>You can clearly express your understanding in a way that directly responds
to the question.</li>
</ul>
While the details are highly problem specific, partial credit will generally be awarded
in proportion to how well you were able to demonstrate how many of these things.
In the examples below:
<ul>
<li>2/3 credit was given for answers that clearly responded to the question,
but showed little depth or mastery of detail.</li>
<li>1/3 credit was given for answers that, while correct, were vague
and superficial.</li>
<li>0 credit would be given for answers that were incorrect, or that
failed to respond to the question.</li>
</ul>
<p></p>
<h2> "Principles" question </h2>
<p>
<strong>Why is it important to keep interface definitions distinct from implementations? <br>
Give an example of a bad thing that could happen if this
principle were violated.</strong>
</p>
<h3>Full Credit Answer</h3>
<p>
If the interface is an implementation-agnostic specification of expected
behavior, it will be much easier to change the implementation, while
maintaining interface compatability. Otherwise, it may be difficult
to know what the actual interface is.
</p>
<p>
If the interface definition was "the current behavior of module X":
</p><ol type="a">
<li> individual clients are left to examine behavior and try
to guess the interface specifications. This greatly increases the
likelihood that future changes will break old clients.
</li>
<li> implementors are likely to find it impossible to change
the implementation without breaking some clients.
This will greatly constrain their ability to evolve
their software.
</li>
</ol>
<h3>2/3 Credit Answer</h3>
<p>
Without a clear interface specification, nobody will be sure what the
right interface is, and a much greater chance that future implementations
will break some clients.
</p>
<h3>1/3 Credit Answer</h3>
<p>
Better interace definitions, and fewer fewer upwards compatability problems.
</p>
<h2> "Description" question </h2>
<strong> List the primary types of segments found in a process' virtual
address space and two characteristics (not contents) of each.</strong>
<h3>Full Credit Answer</h3>
The key segments in a process' address space are:
<ul>
<li> text ... executable, read-only</li>
<li> data ... read/write size, can change at run-time </li>
<li> stack ... read/write, grown/shrunk by os as needed</li>
<li> DLLs/shared libs ... executable, read-only other code segments loaded at load- or run-time</li>
<li> thread stacks ... like program stacks,
but are probably allocated in the data segment and
may not be managed by OS</li>
</ul>
<h3>2/3 Credit Answer</h3>
<ul>
<li> text ... executable code </li>
<li> data ... read/write program data </li>
<li> stack ... read/write, grows down</li>
</ul>
<h3>1/3 Credit Answer</h3>
<ul>
<li> code </li>
<li> data </li>
<li> stack</li>
</ul>
<h2> "Process" question </h2>
<strong> Describe or illustrate (in detail) the sequence of operatins involved
in the processing of an illegal-address trap from a user-mode program
with a registered segmentation fault handler.</strong>
<h3>Full Credit Answer</h3>
<ol type="1">
<li> illegal address raises fault in CPU</li>
<li> CPU loads new PC/PS from associated trap vector</li>
<li> CPU pushes PC/PS at time of trap onto supervisor mode stack</li>
<li> first level handler saves registers and status, forwards to 2nd level handler</li>
<li> 2nd level handler determines it was a user-mode segmentation fault and that there
is a registered signal handler</li>
<li> push PC/PS at time of trap onto user mode stack, and changes the return PC
(on the supervisor mode stack) to be the signal handler.</li>
<li> 2nd level handler returns to 1st level handler</li>
<li> 1st level handler restores registers and returns to user mode </li>
<li> user mode execution resumes in the registered signal handler</li>
</ol>
<h3>2/3 Credit Answer</h3>
<ol>
<li> CPU loads new PC/PS from associated trap vector</li>
<li> CPU pushes PC/PS at time of trap onto supervisor mode stack</li>
<li> OS trap handler saves registers and identifies cause of trap</li>
<li> Trap handler finds signal handler and changes stack to return to it</li>
<li> Restore registers, and return (to user-mode signal handler)</li>
</ol>
<h3>1/3 Credit Answer</h3>
<ul>
<li> trap into operating system</li>
<li> OS identifies cause </li>
<li> OS identifies handler </li>
<li> OS invokes signal handler </li>
</ul>
<h2> "Comparison" question </h2>
<strong> (a) List two key similarities between a (trap) system call and a procedure call.<br>
(b) List two key differences between a (trap) system call and a procedure call.</strong>
<h3>Full Credit Answer</h3>
<ol type="a">
<li> System calls are like procedure calls in that they pass parameters, perform a
service, and return a result when the operation is complete.</li>
<li> System calls run with different privileges, in a different address space.
Procedure calls are made with direct call instructions, while system calls are
a requested with an illegal instruction that is recognized by the trap handler.
Consquently, system calls are much more expensive than procedure calls.</li>
</ol>
<h3>2/3 Credit Answer</h3>
<ol type="a">
<li> parameter passing and return values </li>
<li> subroutines are fast, system calls go into OS, which is slow </li>
</ol>
<h3>1/3 Credit Answer</h3>
<ol type="a">
<li> both are made from subroutine calls in C </li>
<li> subroutines are in libraries, system calls are in OS </li>
</ol>
<center><h1>Sample Exam (XC/final part II) Questions</h1></center>
<p>
More open-ended questions generally fall into categories like:
<ul>
<li> Explaining and examining non-trivial processes.</li>
<li> Deriving equations to describe non-simple events.</li>
<li> Explain how you would implement a proposed feature or solve a posed problem.</li>
<li> Considering the implementation/implications of a proposed implementation.</li>
</ul>
These are examples of a few such questions that have been asked on other
final exams:
<p></p>
<h2> Process Understading</h2>
In Kerberos, the authentication is done by an impartial third party. The SSL protocol
does not involve a third host.
<ol type="a">
<li>
What knowledge or secret do the client and server have in an SSL connection have that
enables them to do this authentication, and what is the corresponding knowledge or
secret in a Kerberos Authentication Server?
</li>
<li>
Are there implicit third parties in the SSL authentication process? If so, identify
them and compare their knowledge and roles with those of the Kerberos Authentication
Server. If not explain how the SSL participants came to possess the knowledge that
enabled them to authenticate their partners, and why they trust that knowledge.
</li>
<li>
In SSL, the session key is securely negotiated with the use of public/private key pairs.
Kerberos uses symmetric (DES) encryption, which requires both sides to know the same key.
How is it possible for a Kerberos client and server (often called a verifier) to
securely agree on a session key, when they do not (initially) share any secrets?
</li>
<li>
Both mechanisms authenticate participants, and create a private channels between them
(symmetrically encrypted with aprivate session keys).
Are there any significant differences in the privacy of the negotiations, or in the
sureness of the authentications? If so describe them? If not, explain why anyone
would choose Kerberos over SSL or vice versa.
</li>
</ol>
<h2> Problem Examination </h2>
Short vs Long-Term Variable Partition Allocation
<ol type="a">
<li> To which type of fragmentation is variable-partition allocation subject?</li>
<li> If most of the dynamically allocated memory was held for the entire life of the process,
would we expect to see much fragmentation? Why, or Why Not?</li>
<li> If memory is continuously allocated and freed throughout the life of the process,
what activity (within the memory allocator) is intended to counter-act the development of fragmentation?</li>
<li> If memory is being freed at (very roughly) a similar rate to the rate at which it
is being allocated, why might this prevention/repair mechanism be more or less effective?</li>
<li> If we knew that a request was to be short-term or long term, how (specifically)
could we exploit this information to make variable partition memory allocation more efficient?</li>
<li> Explain why this change would perform better or more efficiently.</li>
</ol>
<h2> Problem Solution</h2>
A warehouse database includes information about every item, and cargo
manifests for delivery vehicles. Some operations (e.g. scheduling an
item for delivery) involve locking the item, and then updating the
cargo manifest. Other operations (e.g. loading) involve locking a
cargo manifest and then updating referenced item. If two such overlapping
operations happen at the same time, a deadlock could result.
<ol type="a">
<li>How can we maximally enable concurrent parallel updates while preventing deadlocks?</li>
<li>Why is this approach the right solution (vs attacking other necessary conditions)?</li>
</ol>
</body></html>