Quiz Electronics Engineering 18 June 2020

Quiz Electronics Engineering
Exam: NIC
Topic: Miscellaneous
Date: 18/06/2020

Each Question carries 1 Mark
Negative Marking: 1/4
Time: 10 Minutes

Q1. The in-order and pre-order traversal of a binary tree are “d b e a f c g” and “a b d e c f g”
respectively. The post-order traversal of a binary tree is
(a) e d b g f c a
(b) e d b f g c a
(c) d e b f g c a
(d) d e f g b c a

Q2. What is the output of the program?
#include <stdio.h>
main()
{
int a = 5, b = 2;
printf(“%d”, (a++) + (++b));
}
(a) print 10
(b) print 7
(c) print 8
(d) print 3

Q3. Which layer of international standard organization’s OSI model is responsible for creating and recognizing frame boundaries?
(a) Physical layer
(b) Data link layer
(c) Transport layer
(d) Network layer

Q4. The output expression of the following gate network is

(a) XY+X ̅.Y ̅
(b) X.Y+X.Y
(c) X.Y
(d) X+Y

Q5. A box contains 3 black and 5 red balls. Two balls are randomly picked one after another from the box, without replacement. The probability for both balls being red is
(a) 1/8
(b) 1/2
(c) 6/14
(d) 5/14

Q6. Which of the following is a property of a parse tree?
(a) Root is labelled by the start symbol
(b) Each leaf is labelled by a token or terminal symbol
(c) Each interior mode is labelled by a non-terminal
(d) All of the above

Q7. The performance of Round Robin algorithm depends heavily on
(a) size of the process
(b) the I/O bursts of the process
(c) the CPU bursts of the process
(d) the size of the time quantum

Q8. For a software project, the spiral model was employed. When will the spiral stop?
(a) When the software product is retired
(b) When the software product is released after Beta testing
(c) When the risk analysis is completed
(d) After completing five loops

Q9. ______ are used to identity a user who returns to a Website.
(a) ASPs
(b) Plug-ins
(c) Scripts
(d) Cookies

Q10. How many 64 x 8 bit RAMs are required to design 8K x 32 bit RAM
(a) 512
(b) 1024
(c) 128
(d) 32

SOLUTIONS

S1. Ans.(c)
Sol. Given:
The in-order traversal sequence is d b e a f c g and
The pre-order traversal sequence is a b d e c f g.

We can construct the post-order sequence as follows: –
Step 1: Take the first node in pre-order traversal i.e., a. So, it will be the root of the tree.
Step 2: All nodes to the left of ‘a’ in in-order traversal will be in the left subtree of ‘a’ i.e., d, b, e and all elements on the right will be in the right subtree of ‘a’ i.e., f, c, g.
Step 3: Take the second element from pre-order traversal i.e., ‘b’. It goes to left subtree of ‘a’ as it is in the left of ‘a’ in in-order list.
Step 4: All nodes to the left of ‘d’ in in-order traversal will be in the left of ‘d’ i.e., e and all elements on the right will be in the right of ‘d’ i.e., e, a, f, c, g.
Step 5: Take the third element from pre-order traversal i.e., ‘d’. It goes to left subtree of ‘d’ as it is in the left of ‘d’ in in-order list.

Proceeding likewise we can construct the post-order binary tree as: d e b f g c a.

S2. Ans.(c)
Sol. ++b returns the value after it is incremented, while a++ returns the value before it is incremented.
Step 1: a = 5 and b = ++b = b + 1 = 3
Step 2: a + b = 5 + 3 = 8
Step 3: a++ = a + 1 = 5 + 1 = 6

S3. Ans. (b)
Sol. Data link layer establishes and terminates a connection between two physically connected devices. It is responsible for creating and recognizing frame boundaries. This is called as frame delimiting. This is accomplished by attaching special bit patterns at the beginning and end of the frame.

S4. Ans.(a)
Sol.
XY is obtained from first AND gate.
X ̅. Y ̅ from the second AND gate.
The output of both the AND Gate are given as input to the OR Gate.
So, The Final expression is XY + X ̅.Y ̅ . and.

S5. Ans.(d)
Sol. Probability of both balls being red is
= p(first is red)×p (second is red given that first is red)
= 5/8×4/7 = 20/56 = 5/14

S6. Ans.(d)
Sol. Parse tree or parsing tree or derivation tree or concrete syntax tree is an ordered, rooted tree that represents the hierarchical structure of a string according to some Context-Free Grammar. With the help of parse tree, we can make multiple passes over the data without re-parsing the input. A parse tree for a grammar(G) is a tree where–
The root is the start symbol for G.
The interior nodes are the non-terminal of G.
The leaf nodes are the terminal symbol of G.
The children of a node T (From left to right) correspond to symbols on the right hand side of some production of T in G.
Every valid parse tree represents a string generated by the grammar, called the yield of the parse tree.

S7. Ans.(d)
Sol. The performance of Round Robin algorithm depends on Time Quantum size. If size of Time quantum is small context switches will increase. This causes wastage of time, so CPU utilization decreases. If Time Quantum size is large then Round robin algorithm is regenerated into FCFS scheduling algorithm.

S8. Ans.(a)
Sol. For a software project, the spiral model was developed. When the software product is retired the spiral will stop.

S9. Ans.(d)
Sol. A cookie is a small piece of data sent from a website and stored in a user’s web browser while a user is browsing a website in the future. The data stored in the cookie can be retrieved by the website to notify the website of the user’s previous activity. They helps the websites in remembering the state of the website or activity that the user had done in the past. It is also called as a HTTP cookie, web cookie, Internet cookie, browser cookie, or simply cookie.

S10. Ans.(a)
Sol.
Number of RAM’s = (8K x 32 bits)/(64 x 8 bits) = (8K bits)/(2 x 8 bits)
= (1K bits)/(2 bits) = 25 = 512

Leave a comment

Your email address will not be published. Required fields are marked *