Showing posts with label mid sem. Show all posts
Showing posts with label mid sem. Show all posts

May 02, 2019

Cloud Computing - Mid Sem Solution

Note: We have tried solving the question paper in a very short time span as per our understanding and the study material we had. Feel free to contact us through comment box or through email if you have some descriptive answer.

Q1. Answer the following questions in brief                                   
A. What are the two ways by which public cloud helps the customers to reduce their IT costs?
Answer:
  1. Flexible billing models enable customers to pay only for what they use.
  2. It reduces the capital expenditures required for setting up the infrastructure.
 Practice Question - What are the components of a cloud computing environment?
 Answer: client, application, platform, infrastructure, server

B. What are the two limitations of SKI Virtualization?
Answer:
  1. It is not possible, for instance, to run different versions or even different patch levels of a particular operating system on the same machine. 
  2. Whatever versions exist in the host, that same software will be provided in the guest. SKI also sacrifices the security and reliability provided by other virtualization  methods. 
C. A company interested in cloud computing is looking for a service provider who offers a set of basic services such as virtual server provisioning and on-demand storage that can be combined into a platform for deploying and running customized applications. What type of cloud computing model fits these requirements?
Answer: Infrastructure as a Service.

D. How can a software development company leverage the PaaS cloud computing delivery model?
Answer:

Q2. Answer the following questions appropriately.
A. What is 3 - 4 - 5 rule of cloud computing?
Answer: This 3 - 4 - 5 rule stands for:

3 cloud service models
4 deployment models
5 essential characteristics of cloud computing infrastructure

RULE 3 - Cloud service models:
IaaS (Infrastructure as a Service):
The capability provided to the consumer is to provision processing, storage, networks, and other fundamental computing resources where the consumer is able to deploy and run arbitrary software, which can include operating systems and applications.
The consumer does not manage or control the underlying cloud infrastructure but has control over operating systems, storage, deployed applications, and possibly limited control of select networking components (e.g., host firewalls)

PaaS (Platform as a Service):
The capability provided to the consumer is to deploy onto the cloud infrastructure consumer created or acquired applications created using programming languages and tools supported by the provider.
The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, or storage, but has control over the deployed applications and possibly application hosting environment configurations

SaaS(Software as a Service):
The capability provided to the consumer is to use the provider's applications running on a cloud infrastructure. The applications are accessible from various client devices through a thin client interface such as a web browser (e.g., webbased email).
The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, storage, or even individual application capabilities, with the possible exception of limited user specific application configuration settings

RULE 4 - Deployment models:
Private Cloud (Single Org)
The cloud infrastructure is operated solely for a single organization. It may be managed by the
organization or a third party, and may exist on-premises or off-premises, Also called as “Enterprise Cloud”

Community Cloud (Multiple Org)
The cloud infrastructure is shared by several organizations and supports a specific community that has shared concerns (e.g., mission, security requirements, policy, or compliance considerations).
It may be managed by the organizations or a third party and may exist on-premises or off premises.

Public Cloud (For Public)
The cloud infrastructure is made available to the general public or a large industry group and is owned by an organization selling cloud services, Also called as “Internet Cloud”

Hybrid Cloud
The cloud infrastructure is a composition of two or more clouds (private, community, or public)
Leasing public cloud services when private cloud capacity is insufficient, Also called as “Mixed Cloud”

RULE 5 - Characteristics:
On-demand self-service:
Users can provision servers and networks with little human intervention.

Broad network access:
Any computing capabilities are available over the network. Many different devices are allowed access through standardized mechanisms.

Resource pooling:
Multiple users can access clouds that serve other consumers according to demand.
Cloud services need to share resources between users and clients in order to reduce costs.

Elasticity:
Provisioning is rapid and scales out or in based on need.

Metered or measured service:
One of the compelling business use cases for cloud computing is the ability to "pay as you go“, where the consumer pays only for the resources that are actually used by his applications.

April 26, 2019

Data Storage Technologies and Networks - Mid Sem Solution


Note: We have tried solving the question paper in a very short time span as per our understanding and the study material we had. Feel free to contact us through comment box or through email if you have some descriptive answer.



Question) 
It is required to transfer a file of size 8000 bytes at a rate of 4MB/sec with a seek time of 12ms. The disk is rotating at 1000 RPM. Compute the time required for the transfer?
Answer)
Transfer time (T = b/r*N)
  • b number of bytes to be transferred 
  • N number of bytes on a track
  • r is rotation speed in revolution per second
Question) How is the priority sequence established in a wide SCSI environment?
Answer)
In a wide SCSI, the device IDs from 8 to 15 have the highest priority, but the entire sequence of wide SCSI-IDs has lower priority than narrow SCSI IDs.

Therefore, the overall priority sequence for a wide SCSI is 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, and 8.

Question) Firewall configuration is difficult for which NFS version? Justify.
Answer)
NFS is a client server protocol that allows users to share files across a network. There are some problems with NFS as stated below:
● NFS relies on the inherently insecure UDP protocol
● Transactions between host and client are NOT encrypted
● Hosts and users cannot be easily authenticated, IP Spoofing is possible
● Persmissions are granted by normal access rules
● Firewall configuration is difficult because of the way NFS daemons work

NFSv3 requires dynamic ports between the NFS server and client which can cause problems getting through your firewall.

Question)
What are the three types of nodes maintained by JFFS2? Mention percentage hit by ‘Garbage Collector’ to reclaims space from various types of nodes.
Answer)
JFFS is a log structured file system, Nodes containing data and metadata are stored on the flash chips sequentially. There are three types of nodes defined and implemented by JFFS2. These are as follows:

  1. JFFS2_NODETYPE_INODE - It contains all the inode metadata, as well as potentially a range of data belonging to the inode. However, it no longer contains a file name or the number of the parent inode.
  2. JFFS2_NODETYPE_DIRENT - this node represents a directory entry, or a link to an inode. It contains the inode number of the directory in which the link is found, the name of the link and the inode number of the inode to which the link refers. 
  3. JFFS2_NODETYPE_CLEANMARKER -- this node is written to a newly erased block to show that the erase operation has completed successfully and the block may safely be used for storage.
Garbage Collector (GC):
  • JFFS2 has a Garbage Collector (GC). The GC is calld directly from JFFS2 or from a background thread called GC thread.
  • If a user process tries to allocate space for a write and there is not enought free space then it calls the GC to produce the neccesery free space if it is possible.
Question) Can we install SAMBA on Windows? Justify. What is the name of the file to configure SAMBA?
Answer)
Samba is an open-source software suite that runs on Unix/Linux based platforms but is able to communicate with Windows clients like a native application. So Samba is able to provide this service by employing the Common Internet File System (CIFS).

Can we install on windows ? - No we can not install it on Windows. Samba can be run on many different platforms including Linux, Unix, OpenVMS and operating systems other than Windows and allows the user to interact with a Windows client or server natively. It can basically be described as the Standard Windows interoperability suite of programs for Linux and Unix.

Name of file to configure SAMBA: smb.conf

Question )
In a SCSI based interface, a target has to support multiple initiators. Explain how a target will handle an incoming read request when it is busy, giving complete steps of read request between such initiator and a target components (handling multiple imitators) of a SCSI interface. Clearly indicate any assumptions made.

Answer)
Assumptions :Let us assume we have one target T1 and three initiators I1, I2 and I3 with below SCSI IDs :

Initiator  SCSI ID
I1              6
I2              3
I3              5

The device with SCSI ID 7 has the highest priority on the SCSI bus and is usually assigned to the host adapter. The priority of other SCSI IDs is descending from 6 to 0.

Phases of SCSI bus :
There are basically 3 phases :
Bus Free Phase
–Bus is not being used by anyone

Arbitration Phase
–One or more initiators request use of the bus and
the one with the highest priority (SCSI ID order) is allowed to proceed

Selection / Re-selection phase
–Initiator asserts BUS BUSY signal and
•places target’s address on the bus thus establishing a connection/session
–Re-selection applies for a target resuming an interrupted operation:
•target asserts BUS BUSY signal and places initiator’s address on the bus.

Steps for Bus Phase Sequence Read Operation
  1. When bus is free, initiator enters into arbitration (with other possible initiators).
  2. Since we have multiple initiators on the same SCSI bus ,the selection phase allows arbitration for control of the bus.According to our assumptions I1 has the highest priority therefore I1 will be the first initiator to set  connection with target.
  3. On arbitration, initiator I1 selects the bus and places target address on bus.
  4. Target acknowledges selection by a message
  5. Initiator I1 sends command
  6. Target acknowledges command by a message
  7. The bus will be in free status after the target sends the status as FREE
  8. After the initiator I1 is successful,I3 will be able to place target address on the bus as I3 is on second priority and sends selection by a message.
  9. Same steps from 4 to 8 are performed for I3 and I2.

April 17, 2019

Network Security - Mid Sem Solution

Mid-Sem Paper Solutions:


Question:
What are the different types of active security attack ?

Answer:
Security Attack: Any action that compromises the security of information owned by an organization. There are 2 types of attack as shown below.

Active Attack:
An Active attack attempts to alter system resources or effect their operations. The attacker changes the data or harms the system.

Passive Attacks:
The attacker’s goal is to just obtain the information. The attack does not harm the system.

Types of active attacks include:
  • Denial of service (DoS) - It prevents normal use of communication facilities. Slowing down or totally interrupt the service of the system. E.g. multiple requests to bring an exam result server down.
  • Session replay - Subsequent retransmission of a captured message to produce an unauthorized effect. E.g. Bill payment fake reminders.
  • Masquerade - Masquerade attack takes place when one entity pretends to be different entity. E.g. Hoax bank sites. 
  • Message modification - It means that some portion of a message is altered or that message is delayed or reordered to produce an unauthorized effect.
  • Repudiation - Sender denies that it sent the message or the receiver denies that it received the message.
  • Trojans - A Trojan horse, or Trojan, is a type of malicious code or software that looks legitimate but can take control of your computer. A Trojan is designed to damage, disrupt, steal, or in general inflict some other harmful action on your data or network.
Types of passive attack include:
  • Snooping - Data is intercepted by an unauthorized person. E.g. Tapping
  • Traffic Analysis - May be the data is masked, so no information can be extracted but some patterns like - sender, receiver, message length, time of the message etc. can be extracted to make intelligent guesses.

April 15, 2019

Software Architecture - Mid Sem Solution

Mid-Sem Paper Solutions:



Question:
Q.1 Choose the most appropriate architectural pattern (one) for the 5 descriptions below. Give reasons for choosing the pattern (in 1-2 line maximum)

1. Wants to split a system into a number of computationally independent execution structures (groups of software and hardware) such as database, business logic, web interface and client, connected by some communication media. The structure is chosen to provide a specific server environment optimized for operational requirements and resource usage.

2. A set of heterogeneous specialized modules which dynamically change their strategies as a response to unpredictable events, and the system has to deal with uncertain knowledge.

3. Wants a system that can be divided into reusable, loosely coupled components that can be flexibly combined and arranged to transform between various data formats.

4. Wants a distributed system with a structure that enables that service users do not need to know the nature or location of service providers.  

5. A program relationship in which one program requests a service or resource from another Program.

Nominees:
(a) Layered 
(b) Broker 
(c) Model-view-controller
(d) Pipe-and-Filter 
(e) Client-Server 
(f) Blackboard 
(g) Service-Oriented 
(h) Publish-Subscribe 
(i)  Map-Reduce

For Practice:
  • Wants a system that quickly can analyze enormous volumes of data by sorting the data and then analyzing the grouped data. -> Map-Reduce
  • Wants to set up a set of equal distributed computational entities that are connected via a common protocol to share their services and provide high availability and scalability. -> Peer-to-peer
Answer:

1. Multi-tier
2. Blackboard
3. Pipe-and-Filter 
4. Broker
5. Client-Server

Question:
Q.2. Write brief notes on followings:

2.1  Discuss whether this statement is true or false: “Architecture is a transferable and reusable model”.
Answer:
Yes, it is true. Architecture can be created as transferable, reusable model that forms the heart of a product line.
Below is some key-point which does prove the importance of this.
Architecture can provide the basis for evolutionary prototyping.
Architecture is the key artifact that allows the architect and project manager to reason about cost and schedule.
By restricting design alternatives, architecture channels the creativity of developers, reducing design and system complexity.
Architecture defines a set of constraints on subsequent implementation.

2.2 What parameters (inputs) are typically used in models for analyzing performance
Answer:
Parameters (inputs) for analytic modeling of performance (candidates):
Arrival rate of events
queuing discipline
scheduling algorithm
service time for events
network topology 
network bandwidth
routing algorithm 

2.3 What is the difference between reference architecture and an architectural pattern? 
Answer:

An important difference between a pattern and reference architecture is that a pattern must be a recurrent solution that was already used on existing implementations. On the other hand, reference architecture can propose new, innovative solutions in its structure, whose usage was not yet proven in existing software. As a consequence, reference architecture is more suitable to propose a structure for new domains, which are not still well established.

Patterns and reference architectures document solutions in different levels of granularity. While a pattern focus on a single problem and in a single recurrent solution, reference architecture usually considers the target domain as a whole.

Question:
Q.3. Write any five availability tactics for fault detection. Explain each one briefly. 

Answer
Below are the 5 availability tactics for fault detection:
Ping
– Client (or fault-detector) pings the server and gets response back
– To avoid less communication bandwidth- use hierarchy of fault-detectors,
the lowest one shares the same h/w as the server
Heartbeat
– Server periodically sends a signal
– Listeners listen for such heartbeat. Failure of heartbeat means that the server is dead
– Signal can have data (ATM sending the last txn)
Exception Detection
– Adding an Exception handler means error masking
Voting (TMR)
– Three identical copies of a module are connected to a voting system which compares outputs from all the three components. If there is an inconsistency in their outputs when subjected to the same input, the voting system reports error/inconsistency.
– Majority voting, or preferred component wins
Timer and Time-stamping
– If the running process does not reset the timer periodically, the timer triggers off and announces failure
- Time-stamping: assigns a timestamp (can be a count, based on the local clock) with a message in a decentralized message passing system. Used to detect inconsistency.


November 12, 2018

Data Mining - Mid Sem Solutions


Question:
Give an example for each of the following preprocessing activates
a. Incomplete
b. Inconsistent

Answer:
Data Processing: It is a data mining technique that involves transforming raw data into an understandable format. Our Real-world data is often incomplete, inconsistent, and/or lacking in certain behaviors or trends, and is likely to contain many errors. Hence it is needed for resolving such issues.
"Preprocessing is needed to improve data quality"

A. Incomplete: Lacking attribute values, lacking certain attributes of interest, or containing only aggregate data.
E.g. Many tuples have no recorded value for several attributes,
Occupation = “ ” (missing data)

B. Inconsistent: Containing discrepancies in codes or names.
E.g.
Age = “42”, Birthday = “03/07/2010”
Was rating “1, 2, 3”, now rating “A, B, C”
discrepancy between duplicate records

Software Testing Methodologies - Mid Sem Solutions




Question
One of your friends has written a program to search a string in a string and requested you to test the below function using equivalent class portioning :

function strpos_generic( $haystack, $needle, $nth,  $insensitive)
Following are terminology definitions:
  • $haystack= the string in which you need to search value
  • $needle= the character that needs to be searched, the $needle should be a single character
  • $nth= occurrence you want to find, the value can be number between 1,2,3
  • $insensitive= 1- case insensitive, 0 or any other value is case sensitive
  • Passing as Null as parameter in haystack or needle is not a valid scenario and will return boolean false
  • The function will return mixed integer either the position of the $nth occurrence of $needle in $haystack, or Boolean false if it can't be found.
a) Derive positive and negative domain equivalence class portioning with the value in the following format     

$haystack
$needle
$nth
$insensitive




                                                                             
b) And drive test case for weak robust variant in following format and use the variable efficiently and cover  all the paths:
 
Sl.no
$haystack
$needle
$nth
$insensitive
Expected  results

Answer:
NOTE : The above question is for your exercise,kindly try solving it using below reference questions

Question
ABC Transportation Company has implemented an online ticket booking system for their buses, and they have created a simple screen to search the bus and following are some of the business rules they have incorporated in the screen.
From and To location should be minimum 3 characters and maximum  of  25 characters
Date of travel cannot be lesser than today’s date
Time : Morning, Afternoon, Night
No of Passengers can be 1 to 6
Service class can be: Premium, Deluxe, Express
a) Identify the positive and negative domain.
b) Write test case for weak robust variant.

November 05, 2018

Design and Analysis of Algorithms - Mid Sem Solution


Question 1A)
The time factor when determining the efficiency of algorithm is measured by
a) Counting microseconds
b) Counting the number of key operations
c) Counting the number of statements
d) Counting the kilobytes of algorithm

Answer: b
Justification: It is hardware and language independent , rest are dependent on hardware or on software

1B) The concept of order Big O is important because
a) It can be used to decide the best algorithm that solves a given problem
b) It determines the maximum size of a problem that can be solved in a given  amount of time
c) It is the lower bound of the growth rate of algorithm
d) Both A and B

Answer: a
Justification: We know that Big Oh notation is used in time complexity . the reason why we called Big Oh because it says "at any condition this is worst time that an algorithm could take " where as Big Omega says its is "best time that you can get , You cant get better than this.

1C) In worst case Quick Sort has order
A) O (n log n)            B. O (n2 /2)                C. O (log n)                         D. O (n2 /4)

Answer: A
Justification: In the worst case of quick sort has order O(n2). Quick sort is the quickest comparison-based sorting algorithm. It is very fast and requires less additional space, only O(n log n) space is required.

1D) Consider the following program segment. What is the Space complexity?
Begin
i=0;
S=0;
S=s+1;
Return s;
End

Answer: [If i,S considered as integers] => Space Complexity = 4 +(4*2)  = 12 bytes, where additional 4 bytes is for return value

To calculate the Space complexity of an algorithm, we need to follow the below instruction first:
It is the amount of memory used by the algorithm (including the input values to the algorithm) to execute and produce the result.

Space Complexity = Auxiliary Space + Input space

Calculating the Space Complexity:

For calculating the space complexity, we need to know the value of memory used by different type of datatype variables, which generally varies for different operating systems, but the method for calculating the space complexity remains the same.
TypeSize
bool, char, unsigned char, signed char1 byte
short, unsigned short,2 bytes
float, int, unsigned int, long, unsigned long4 bytes
double, long double, long long8 bytes
1E)  What is the time complexity of optimal binary search
(1) a)O(n) b) O(1) c)O(2n/2 d) O(n2)

Answer: d
Justification:
An optimal binary search tree is a binary search tree for which the nodes are arranged on levels such that the tree cost is minimum.

For Reference:
The complexity of linear search algorithm is
a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)

Answer: a
Justification: It refers to n values complexity in the algorithm which can be reduced by choosing the other algorithms.

The complexity of Bubble sort algorithm is
a) O(n)
b) O(log n)
c) O(n2)
d) O(n log n)

Answer: c
Justification: Bubble sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order.

Question
Randomised algorithms are also called as __________________ and whose behavior is dependent  on  _______________ in decision making as part of its logic

Answer: probabilistic algorithm and randomness

Question:
Match the following    


Problem

Recurrence Equation
1
Binary Search 
A
tn – tn-1 = 1
2
Merge Sort
B
T(n)=2T(n/2)+n-1
3
Sequential Search
C
tn =  tn-1 + n
4
Factorial
D
T(n)=7T(n/2)+18(n/2)2
5
Strassen Matrix Multiplication
E
T(n)=T(n/2)+1
6
Selection Sort
F
T(n)=T(n/2)+n-1









Answer:

T(n) = Time Complexity
 

Problem

Recurrence Equation
1
Binary Search
E
T(n)=T(n/2)+1
2
Merge Sort
B
T(n)=2T(n/2)+n-1
3
Sequential Search
A
tn – tn-1 = 1
4
Factorial
F
T(n)=T(n/2)+n-1
5
Strassen Matrix Multiplication
D
T(n)=7T(n/2)+18(n/2)2
6
Selection Sort
C
tn =  tn-1 + n

Additional Reference:


7
Insertion sort
-
T(N) = T(N-1) + N-1
8
Tree traversal
-
T(n) = 2T(n/2) + 1
9
Quicksort
-
(n) = 2T(n/2) + n
10
Master Theorm
-
T(n)=aT(n/b)+f(n)












Tip:
Merge Sort: The merge sort algorithm deals with the problem of sorting a list of n elements. It is able to sort a list of n elements in O(n log n) run-time, which is considerably faster than insertion sort, which takes O(n2).
Merge sort uses a divide and conquer method:
1. If the length of the list is 1, the list is sorted. Return the list.
2. Otherwise, split the list in two (roughly) equal halves and then recursively merge sort the two halves
3. Merge the two sorted halves into one sorted list.