Thursday, September 21, 2017

Computer Networking Questions Series 3

The maximum window size for data transmission using the selective reject protocol with n-bit frame sequence numbers is:
(a) 2^n
(b) 2^(n-1)
(c) 2^n – 1
(d) 2^(n-2)
Answer (b)


An organization has a class B network and wishes to form subnets for 64 departments. The subnet mask would be:
(a) 255.255.0.0
(b) 255.255.64.0
(c) 255.255.128.0
(d) 255.255.252.0

Answer (d)
The size of network ID is 16 bit in class B networks. So bits after 16th bit must be used to create 64 departments. Total 6 bits are needed to identify 64 different departments. Therefore, subnet mask will be 255.255.252.0.

 In the slow start phase of the TCP congestion control algorithm, the size of the congestion window
(A) does not increase
(B) increases linearly
(C) increases quadratically
(D) increases exponentially
Answer (D)

Wednesday, September 20, 2017

Computer Networking Questions Series 2

One of the header fields in an IP datagram is the Time to Live (TTL) field. Which of the following statements best explains the need for this field?
(A) It can be used to priortize packets
(B) It can be used to reduce delays
(C) It can be used to optimize throughput
(D) It can be used to prevent packet looping
Answer (D)
Time to Live can be thought as an upper bound on the time that an IP datagram can exist in the network. The purpose of the TTL field is to avoid a situation in which an undeliverable datagram keeps circulating.


Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same netmask N. Which of the values of N given below should not be used if A and B should belong to the same network?
(A) 255.255.255.0
(B) 255.255.255.128
(C) 255.255.255.192
(D) 255.255.255.224

(D)
The last octets of IP addresses of A and B are 113 (01110001) and 91 (01011011). The netmask in option (D) has first three bits set in last octet. If netmask has first 3 bits set, then these bits nmust be same in A and B, but that is not the case. In simple words, we can say option (D) is not a valid netmask because doing binary ‘&’ of it with addresses of A and B doesn’t give the same network address. It must be same address as A and B are on same network

The address resolution protocol (ARP) is used for:
(a) Finding the IP address from the DNS
(b) Finding the IP address of the default gateway
(c) Finding the IP address that corresponds to a MAC address
(d) Finding the MAC address that corresponds to an IP address
Answer (d)

Tuesday, September 19, 2017

Computer Networking Questions Series 1

In the IPv4 addressing format, the number of networks allowed under Class C addresses is
(A) 2^14
(B) 2^7
(C) 2^21
(D) 2^24
Answer (C)
In class C, 8 bits are reserved for Host Id and 24 bits are reserved for Network Id. Out of these 24 Network Id bits, the leading 3 bits are fixed as 110. So remaining 21 bits can be used for different networks

 Which of the following transport layer protocolss is used to support electronic mail?
(A) SMTP
(B) IP
(C) TCP
(D) UDP
Answer (C)

Consider a source computer (S) transmitting a file of size 106 bits to a destination computer (D) over a network of two routers (R1 and R2) and three links (L1, L2 and L3). L1 connects S to R1;L2 connects R1 to R2; and L3 connects R2 to D. Let each link be of length 100km. Assume signals travel over each link at a speed of 10^8 meters per second. Assume that the link bandwidth on each link is 1Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total sum of transmission and propagation delays in transmitting the file from S to D?
(A) 1005ms
(B) 1010ms
(C) 3000ms
(D) 3003ms
Answer (A)
Propagation delay to travel from S to R2 = (Distance) / (Link Speed) = 10^5/10^8 = 1ms
Total prorogation delay to travel from S to D = 3*1 ms = 3ms
Total Ttransmission delay for 1 packet = 3 * (Number of Bits) / Bandwidth = 3*(1000/10^6) = 3ms.

The first packet will take 6ms to reach D. While first packet was reaching D, other packets must have been processing in parallel. So D will receive remaining packets 1 packet per 1 ms from R2. So remaining 999 packets will take 999 ms. And total time will be 999 + 6 = 1005 ms

Consider different activities related to email.
   m1:Send an email from a mail client to mail server
   m2:Download an email from mailbox server to a mail client
   m3:Checking email in a web browser
Which is the applicable level protocol user in each activity?
(A) m1:HTTP, m2:SMTP, m3:POP
(B) m1:SMTP, m2:FTP, m3:HTTP
(C) m1:SMTP, m2:POP, m3:HTTP
(D) m1:POP, m2:SMTP, m3:IMAP
Answer (C)

Wednesday, March 15, 2017

ER Diagram Representation

Let us  learn how the ER Model is represented by means of an ER diagram. Any object, for example, entities, attributes of an entity, relationship sets, and attributes of relationship sets, can be represented with the help of an ER diagram.

Entity

Entities are represented by means of rectangles. Rectangles are named with the entity set they represent.
Entities in a school database

Attributes

Attributes are the properties of entities. Attributes are represented by means of ellipses. Every ellipse represents one attribute and is directly connected to its entity (rectangle).
Simple Attributes
If the attributes are composite, they are further divided in a tree like structure. Every node is then connected to its attribute. That is, composite attributes are represented by ellipses that are connected with an ellipse.
Composite Attributes
Multivalued attributes are depicted by double ellipse.
Multivalued Attributes
Derived attributes are depicted by dashed ellipse.
Derived Attributes

Relationship

Relationships are represented by diamond-shaped box. Name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line.

Binary Relationship and Cardinality

A relationship where two entities are participating is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.
  • One-to-one − When only one instance of an entity is associated with the relationship, it is marked as '1:1'. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship.
  • One-to-one
  • One-to-many − When more than one instance of an entity is associated with a relationship, it is marked as '1:N'. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship.
  • One-to-many
  • Many-to-one − When more than one instance of entity is associated with the relationship, it is marked as 'N:1'. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship.
  • Many-to-one
  • Many-to-many − The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship.
  • Many-to-many

Participation Constraints

  • Total Participation − Each entity is involved in the relationship. Total participation is represented by double lines.
  • Partial participation − Not all entities are involved in the relationship. Partial participation is represented by single lines.
Participation Constraints

Tuesday, March 14, 2017

DBMS - Architecture

The design of a DBMS depends on its architecture. It can be centralized or decentralized or hierarchical. The architecture of a DBMS can be seen as either single tier or multi-tier. An n-tier architecture divides the whole system into related but independent n modules, which can be independently modified, altered, changed, or replaced.
In 1-tier architecture, the DBMS is the only entity where the user directly sits on the DBMS and uses it. Any changes done here will directly be done on the DBMS itself. It does not provide handy tools for end-users. Database designers and programmers normally prefer to use single-tier architecture.
If the architecture of DBMS is 2-tier, then it must have an application through which the DBMS can be accessed. Programmers use 2-tier architecture where they access the DBMS by means of an application. Here the application tier is entirely independent of the database in terms of operation, design, and programming.

3-tier Architecture

A 3-tier architecture separates its tiers from each other based on the complexity of the users and how they use the data present in the database. It is the most widely used architecture to design a DBMS.

  • Database (Data) Tier − At this tier, the database resides along with its query processing languages. We also have the relations that define the data and their constraints at this level.
  • Application (Middle) Tier − At this tier reside the application server and the programs that access the database. For a user, this application tier presents an abstracted view of the database. End-users are unaware of any existence of the database beyond the application. At the other end, the database tier is not aware of any other user beyond the application tier. Hence, the application layer sits in the middle and acts as a mediator between the end-user and the database.
  • User (Presentation) Tier − End-users operate on this tier and they know nothing about any existence of the database beyond this layer. At this layer, multiple views of the database can be provided by the application. All views are generated by applications that reside in the application tier.
Multiple-tier database architecture is highly modifiable, as almost all its components are independent and can be changed independently.

Monday, March 13, 2017

Important Questions Series 1

1)       Partial order set is:
a. Reflexive, Transitive
b. Anti Symmetric
c. Symmetric
d. a and b
e. a and c
f. None

if you consider option e then it will become equivalence set..

 2) The Relation R={(1,2),(2,2),(2,3),(3,3),(3,2),(4,4),(4,2)} is Reflexive (True / False)
false a relation will be reflexive if for all x,(x,x) is present here in R there are (2,2)(3,3)(4,4) but no (1,1) so the relation R is not reflexive

3)A B-tree of minimum degree t has maximum pointer in a node
(1) t-1
(2) 2t-1
(3) 2t
(4)t
4) Unix operating system is an example of
(a) batch os
(b) multi user os
(c) partially multi user os
(d) single user os
5) Which of the following allows a simple email service and is responsible for moving messages from one mail server to another?
A. IMAP B. DHCP
C. SMTP D. FTP
E. POP3
6) Device on one network can communicate with devices in another network via a
1. Hub/Switch
2.utility Server
3. File Server
4. Gateway
7) Congestion control is done by:
1.Network layer
2.Physical Layer
3.Transport Layer
4.Application Layer
8) Which storage device is mounted on 'reels'?
1 Floppy Disk
2 Hard Disk
3 Magnetic Tapes
4 CDROM
9) Consider a relation (A,B,C,D,E,F,G,H).And its Functional Dependencies are ABC ->DE, F->FG, H->G, G->H,ABCD->EF.Here the answer is it is in 2nf.
as you see abc is the candidate key and E,F,G,H are the non prime attributes. so no partial dependency is present here as no proper subset of ABC points to any non prime attribute.and here non key points to another non key(condition of 2nf)and transitive dependency also present F--G , G---H SO ANS IS 2NF
10)which type of links are used for a connection between two DTE devices
1. X.21
2. Frame relay
3. ATM
4. Modem
11) what does 'B' in B tree stands for:                          its "balanced tree"........
12) One can convert a binary tree into its mirror image by traversing it in
(1) postorder
(2) inorder
(3) preorder
(4)any order
post order..inorder gives nodes in ascendng order..., preorder gives depth first ordering...
13) Given the following expressions of a
grammar
E --> E * F / F + E / F
F --> F – F / id
Which of the following is true ?
(A) * has higher precedence than +
(B) – has higher precedence than *
(C) + and – have same precedence
(D) + has higher precedence than *
lower priority operator is alwayas comes at first level and then higher priority and so on .since * and + comes at first level and then - is at next level .hence - is having higher priority then *.
14) The amount of uncertainty in a system of symbol is called
1.Bandwidth
2.Entropy
3.Loss
4.Quantum
15) A 10Base-2 network is limited to
1.20 bytes per data field
2.30 stations per segment
3.40 segments
4.50 feet of cable
16) 76% like UGC exam and 63% like Gate exam; how many like both
76+63-100=39
17) RAID stands for
(1) rapid action in disaster
(2) random access internal disks
(3) rapid application interface design
(4) redundant arrays of independent disks
18) Which of the following statements is/are true ?
1 Cache Memories are bigger than RAM
2 Cache Memories are smaller than RAM
3 ROM are faster than RAM
4 Information in ROM can be written by users
19) The graphic method of LP uses
a. Objective function equation
b. Constraint equation
c. linear equations.
d. all of the above
20) In a high resolution mode, the number of dots in a line will usually be ----
1 320
2 640
3 760
4 900

Wednesday, March 8, 2017

Asymptotic Analysis

Asymptotic analysis of an algorithm refers to defining the mathematical boundation/framing of its run-time performance. Using asymptotic analysis, we can very well conclude the best case, average case, and worst case scenario of an algorithm.
Asymptotic analysis is input bound i.e, if there's no input to the algorithm, it is concluded to work in a constant time. Other than the "input" all other factors are considered constant.
Asymptotic analysis refers to computing the running time of any operation in mathematical units of computation. For example, the running time of one operation is computed as f(n) and may be for another operation it is computed as g(n2). This means the first operation running time will increase linearly with the increase in n and the running time of the second operation will increase exponentially when n increases. Similarly, the running time of both operations will be nearly the same if n is significantly small.
Usually, the time required by an algorithm falls under three types −
  • Best Case − Minimum time required for program execution.
  • Average Case − Average time required for program execution.
  • Worst Case − Maximum time required for program execution.

Asymptotic Notations

Following are the commonly used asymptotic notations to calculate the running time complexity of an algorithm.
  • Ο Notation
  • Ω Notation
  • θ Notation

Big Oh Notation, Ο

The notation Ο(n) is the formal way to express the upper bound of an algorithm's running time. It measures the worst case time complexity or the longest amount of time an algorithm can possibly take to complete.
Big O Notation
For example, for a function f(n)
Ο(f(n)) = { g(n) : there exists c > 0 and n0 such that f(n) ≤ c.g(n) for all n > n0. }

Omega Notation, Ω

The notation Ω(n) is the formal way to express the lower bound of an algorithm's running time. It measures the best case time complexity or the best amount of time an algorithm can possibly take to complete.
Omega Notation
For example, for a function f(n)
Ω(f(n)) ≥ { g(n) : there exists c > 0 and n0 such that g(n) ≤ c.f(n) for all n > n0. }

Theta Notation, θ

The notation θ(n) is the formal way to express both the lower bound and the upper bound of an algorithm's running time. It is represented as follows −
Theta Notation
θ(f(n)) = { g(n) if and only if g(n) =  Ο(f(n)) and g(n) = Ω(f(n)) for all n > n0. }

Common Asymptotic Notations

Following is a list of some common asymptotic notations −
constantΟ(1)
logarithmicΟ(log n)
linearΟ(n)
n log nΟ(n log n)
quadraticΟ(n2)
cubicΟ(n3)
polynomialnΟ(1)
exponential2Ο(n)