GATE 2014 (Session 1)
65 questions
MCQ 40 · NAT 251-mark 30 · 2-mark 35
Questions 26–30 of 65
Consider the finite automaton in the following figure.
What is the set of reachable states for the input string 0011?
What is the set of reachable states for the input string 0011?
Answer: (A)
Follow the set of states after each input symbol:
- Start: {q0}
- Input 0 {q0}; next input 0 {q0}
- Input 1 {q0, q1}
- Next input 1 {q0, q1, q2} (q0 stays or goes to q1; q1 goes to q2)
Answer: {q0, q1, q2}
- Start: {q0}
- Input 0 {q0}; next input 0 {q0}
- Input 1 {q0, q1}
- Next input 1 {q0, q1, q2} (q0 stays or goes to q1; q1 goes to q2)
Answer: {q0, q1, q2}
Which one of the following is FALSE?
Answer: (D)
Changing x = 4 * 5 into x = 20 means the constant is worked out at compile time. This is constant folding. It is not common subexpression elimination. The other statements are true.
Answer: x = 4*5 x = 20 is an example of common subexpression elimination (FALSE)
Answer: x = 4*5 x = 20 is an example of common subexpression elimination (FALSE)
Match the following:
| 1) Waterfall model | a) Specifications can be developed incrementally |
| 2) Evolutionary model | b) Requirements compromises are inevitable |
| 3) Component-based software engineering | c) Explicit recognition of risk |
| 4) Spiral development | d) Inflexible partitioning of the project into stages |
Answer: (B)
1) The waterfall model splits the project into fixed stages done one after another, with little going back: inflexible partitioning into stages (d).
2) The evolutionary model builds a first version and refines it with users, so the specification is developed incrementally (a).
3) Component-based software engineering reuses existing components, so requirements often have to be adjusted to what the components offer: compromises are inevitable (b).
4) The spiral model has a risk-analysis step in every loop, so it explicitly recognises risk (c).
So 1-d, 2-a, 3-b, 4-c.
Answer: (B)
2) The evolutionary model builds a first version and refines it with users, so the specification is developed incrementally (a).
3) Component-based software engineering reuses existing components, so requirements often have to be adjusted to what the components offer: compromises are inevitable (b).
4) The spiral model has a risk-analysis step in every loop, so it explicitly recognises risk (c).
So 1-d, 2-a, 3-b, 4-c.
Answer: (B)
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.
Answer: 3
SSTF starts at 100: first 100 (distance 0), then 105 (5), then 110 (5), then 90 (20, nearer than 135 at 25).
So 90 is served after 3 requests.
Answer: 3
So 90 is served after 3 requests.
Answer: 3
Which one of the following is FALSE?
Answer: (D)
Threads of one process, even kernel threads, use the same code segment. They also use the same data and files. Only their stacks and registers are kept apart. So the statement "kernel level threads cannot share the code segment" is false.
Answer: Kernel level threads cannot share the code segment
Answer: Kernel level threads cannot share the code segment