Sunday 29 July 2018

Analytics Skills - Technology DataStage-L1


Question.
Continue action if a lookup on a link fails

a)Drops the row and Job fails
b)Drops the row and will skip next lookup
c) Drops the row and will skill all further lookups
d) Drops the row and continues with the next lookup

Answer: Drops the row and continues with the next lookup

Question.
Fail action if a lookup on a link fails

a) Causes the job to reject records
b) Causes the job to issue a fatal error and continues with next lookup
c) Causes the job to issue a fatal error and stop
d) Causes the job to issue a fatal error and falls records from subsequent lookup

Answer: Causes the job to issue a fatal error and stop

Question.
Which phase is used to compute sum of salary collected together by deptno?
a)Join
b)Aggregate
c)Merge
d) Copy

Answer: Aggregate

Question.
Which activity is used to execute shell scripts or bat files?

a) Wait for File activity
b) Execute Command activity
c) Program activity
d) Run Program activity

Answer: Execute Command activity

Question.
Change_Code value of three of Change Capture Stage in DataStage represents

a) Copy
b) Delete
c) New
d) Edit

Answer: Edit

Question.
Change_Code value of zero of Change Capture Stage in DataStage represents

a) Edit
b) Delete
c) New
d) Copy

Answer: Copy

Question.
Change_Code value of one of Change Capture Stage in DataStage represents
a) Copy
b) Delete
c) Edit
d) New

Answer: New

Question.
Which one is used to remove duplicates in data?

a) Unique property set in Join Stage
b)Unique property set in Merge Stage
c)Remove Duplicate Stage
d)Dedup Sort Stage

Answer: Remove Duplicate Stage

Question.
Which of the below stages are used to achieve Union all operation on input data sources?

a)Join
b) Funnel
c) Lookup
d) Filter

Answer: Funnel

Question.
Which of the following is not type of view in Datastage Director?

a)Job View
b)Log View
c)Status View
d) Parallel View

Answer: Parallel View

Question.
Which one of the following can be used to schedule jobs

a) DataStage Director
b)DataStage Designer
c)DataStage Administrator
d) Data Stage Exporter

Answer: DataStage Director

Question.
Which one is used to create workflows in DataStage?

a) Parallel Jobs
b) Sequence Jobs
c) Server Jobs
d) Workflow Activity

Answer: Sequence Jobs

Question.
Change_Code value of two of Change Capture Stage in DataStage represents

a) Copy
b) Delete
c) New
d) Edit

Answer: Delete

Question.
Change Capture stage is

a) File Stage
b) Database Stage
c) Processing Stage
d) Miscellaneous Stage

Answer: Processing Stage

Question.
Which Stage allows you to specify several Reject links?

a) Lookup
b)Merge
c)Join
d) filter

Answer: Merge

Question.
If two rows in Change Capture have same key columns, you can match the columns in the rows to understand if one is an modified copy of the other.

a) Key Column
b) Value Columns
c)After Data Column
d)Before Data Column

Answer: Value Columns

Question.
Which action will wait for file to seem in a folder?

a)Wait for file activity
b)Job Activity
c)Execute Command Activity
d)Sequential file Stage activity

Answer: Wait for file activity

Question.
Which of the below phases are used to Restrict Data created on Where Clause Predicates?

a)Join
b)Funnel
c) Filter
d) Copy

Answer: Filter

Question.
using Copy stage

a)Order of columns can be changed but data type of columns cannot be changed
b)Order of columns cannot be changed but data type of columns can be changed
c)Order of columns can be changed and data type of columns can be changed
d) both the Order of columns and data type of columns cannot be changed

Answer: Order of columns can be changed but data type of columns cannot be changed

Question.
Which option will send record with null values when a lookup failure happens

a) Reject
b) Drop
c) Fail
d) Continue

Answer: Continue

Wednesday 25 July 2018

Analytics - Hadoop L1


Question.
Which of the following are true about Hadoop?
Open Source
Distributed Processing Framework
Distributed Storage Framework
All of these

Answer: All of these

Question.
Which of the following are false about Hadoop?
Hadoop works in Master-Slave fashion
Master & Slave both are worker nodes
User submit his work on master, which distribute it to slaves
Slaves are actual worker node

Answer: Master & Slave both are worker nodes

Question.
What is a Metadata in Hadoop?
Data stored by user
Information about the data stored in datanodes
User information
None of these

Answer: Information about the data stored in datanodes

Question.
What is a Daemon?
Process or service that runs in background
Applications submitted by user
Web application running on web server
None of these

Answer: Process or service that runs in background

Question.
All of the following accurately describe Hadoop EXCEPT?
a. Batch processing
b.Open-source
c. Distributed computing
d. Real-time

Answer: Real-time

Question.
All of the following is a core component of Hadoop EXCEPT?
a. Hive
b. HDFS
c. MapReduce
d. YARN

Answer: Hive

Question.
Hadoop is a framework that uses a variety of related tools. Common tools included in a typical implementation include:
a. MapReduce, HDFS, Spool
b. MapReduce, MySQL, Google Apps
c. Cloudera, HortonWorks, MapR
d. MapReduce, Hive, Hbase

Answer: MapReduce, Hive, Hbase

Question.
Which of the following can be used to create workflows when multiple MapReduce and Pig programs need to be executed?
a. Sqoop
b. Zookeeper
c. Oozie
d. Hbase

Answer: Oozie

Question.
Which of the following can be used to transfer bulk data between Hadoop and structured databases
a. Sqoop
b. Hive
c. Pig
d. Spark

Answer: Sqoop

Question.
How many single points of failure does a High Availability HDFS architecture have?
a. 0
b. 1
c. 2
d. 3

Answer: 0

Question.
If a file of size 300MB needs to be stored in the HDFS (block size=64MB, replication factor=2), how many blocks are created for this file in the HDFS?
a. 10
b. 11
c. 12
d. 15

Answer: 10

Question.
What is not a default value for a data block size in the HDFS?
a. 64MB
b. 128MB
c. 512MB
d. 256MB

Answer: 512MB

Question.
Which of the following architectures best describes the HDFS architecture?
a. High Availability
b. Master-Slave
c. Connected
d. Peer

Answer: Master-Slave

Question.
Which of the following is a master process in the HDFS architecture?
a. Datanode
b. JobTracker
c. Namenode
d. Secondary Namenode

Answer: Namenode

Question.
Which of the following is true about Hadoop?

Before storing data we need to specify the schema
We will loss data if one data node crashes
We can add n no of nodes in cluster on the fly (n ~ 15000)
Data is firstly processed on master then on slaves

Answer: We can add n no of nodes in cluster on the fly (n ~ 15000)

Question.
Choose the correct statement?

Master assigns work to all the slaves
We cannot edit data once written in Hadoop
Client need to interact with master first, as it is the single place where all the meta data is available
All of these

Answer: All of these

Question.
Which of the following is the essential module of HDFS?
Node Manager
Resource Manager
DataNode
ALL of the above

Answer: DataNode

Question.
Which of the below is NOT a kind of metadata in NameNode?

Block locations of files
List of files
File access control information
No. of file records

Answer: No. of file records

Question.
Which statement is true about DataNode?

It is the actual worker node that saves and stores meta data.
It is the slave node that saves and stores metadata.
It is the Master node that saves and stores actual data.
It is the slave node that saves and stores actual data.


Answer: It is the slave node that saves and stores actual data.

Question.
Is the Secondary NameNode is the Backup node?
TRUE
FALSE

Answer: FALSE

Question.
Which of the below is programming model planned for handling out large capacities of data in parallel by dividing the effort into a set of independent tasks.

MapReduce
Hive
Pig
HDFS

Answer: MapReduce

Question.
Mappers sorted output is Input to the-
Reducer
Mapper
Shuffle
All of the mentioned

Answer: Reducer


Question.
Which of the following generate intermediate key-value pair?
Reducer
Mapper
Combiner
Partitioner

Answer: Mapper

Question.
What is the major advantages of storing data in block size 128MB?
It saves disk seek time
It saves disk processing time
It saves disk access time
It saves disk latency time

Answer: It saves disk seek time

Question.
Role of Partitioned in Map Reduce Job is :

a) To partition input data into equal parts
b) Distribute data among available reducers
c) To partition data and send to each mapper
d) Distribute data among available mappers

Answer:  Distribute data among available reducers

Question.
Which of the following is Single point of Failure?
NameNode
Secondary NameNode
DataNode
None of above

Answer: NameNode

Question.
Apache Hbase is

a) Column family oriented NoSQL database
b) Relational Database
c) Document oriented NoSQL database
d) Not part of Hadoop eco system

Answer: Column family oriented NoSQL database

Question.
Which of the following is a Table Type in Hive ?

a)Managed Table
b)Local Table
c)Persistent Table
d)Memory Table

Answer: Managed Table

Question.
Which of the following is a demon process in Hadoop?

a) NameNode
b) JobNode
c) taskNode
d) mapreducer

Answer: NameNode

Question.
Information about locations of the blocks of a file is stored at ________

a)data nodes
b)name node
c)secondary name node
d)job tracker

Answer: name node

Question.
Apache Sqoop is used to

a) Move data from local file system to HDFS
b) Move data from streaming sources to HDFS
c) Move data from RDBMS to HDFS
d) Move data between Hadoop Clusters

Answer: Move data from RDBMS to HDFS

Question.
In a Map Reduce Program, role of combiner is

a) To combine output from multiple map tasks
b) To combine output from multiple reduce tasks
c) To merge data and create a single output file
d) To aggregate the output of each map task

Answer: To aggregate the output of each map task

Question.
Hive External tables store data in

a) default Hive warehouse location in HDFS
b) default Hive warehouse location in Local file system
c) a custom location in HDFS
d) a custom location in local file system

Answer: a custom location in HDFS

Question.
MapReduce programming model is ________

a)Platform Dependent but not language-specific
b)Neither platform- nor language-specific
c)Platform independent but language-specific
d)Platform Dependent and language-specific

Answer: Neither platform- nor language-specific

Question.
Hive generates results using

a) DAG of Map Reduce Jobs
b) sequencial processing of files
c) MySQL query engine
d) List processing

Answer: DAG of Map Reduce Jobs

Question.
Clients access the blocks directly from ________for read and write

a)data nodes
b)name node
c)secondarynamenode
d)primary node

Answer: data nodes

Question.
In Apache Pig, a Data Bag stores

a) Set of columns
b) set of columns with the same data type
c) set of columns with different data type
d) Set of tuples

Answer: set of columns with the same data type

Question.
You can execute a Pig Script in local mode using the following command

a) pig -mode local
b) pig -x local
c) pig -run local
d) pig -f

Answer: pig -x local

Question.
Default bock size in HDFS is____________

a)128 KB
b)64 KB
c)32 MB
d)128MB

Answer:128MB

Question.
Apache Flume is used to

a) Move data from RDBMS to HDFS
b) Move data from HDFS to RDBMS
c) Move data from One HDFS Cluster to another
d) Move data from Streaming source to HDFS

Answer: Move data from Streaming source to HDFS

Question.
Default data field delimiter used by Hive is

a) Ctrl-a character
b) Tab
a) Ctrl-b character
d) Space

Answer: Ctrl-a character

Question.
What are the characteristics of Big Data?

a)volume, quality, variety
b)volume,velocity, variety
c)volume, quality, quantity
d)qantity and quality only

Answer: volume,velocity, variety

Question.
Which is optional in map reduce program?

a)Mapper
b)Reducer
c)both are optional
d)both are mandatory

Answer: Reducer

Question.
In Hive tables, each table partition data is stored as ?

a) files in separate folders
b) multiple files in same folder
c) a single file
d) multiple xml files

Answer: files in separate folders

Question.
What is the default storage class in Pig Called ?

a)TextStorage
b)DefaultStorage
c)PigStorage
d)BinaryStorage

Answer: PigStorage

Informatica PowerCenter - MCQS


Question.
In a Workflow , you need to run an operating system script between two sessions. How can you best accomplish this?
a)Call from Post SQL
b)Call the script from a Command task
c)Use a custom transformation
d)Use Event raise and Event wait tasks

Answer: Call the script from a Command task

Question.
An Active Transformation :

a)Does not change the number of rows that pass through it
b)Represents the data flow between sources and targets
c)Can change the number of rows that pass through it
d)Creates a target definition based on a source definition

Answer: Can change the number of rows that pass through it

Question.
NetSal= bassic+hra. In which transformation we can achieve this?

Lookup
Expression
Filter
Aggregator

Answer: Expression

Question.
How many return ports are allowed in unconnected lookup transformation ?

3
2
1
Any number

Answer: 1

Question.
Which one is not correct about filter transformation?

Act as a 'where' condition
Can't passes multiple conditions
Act like 'Case' in pl/sql
If one record does not match condition, the record is blocked

Answer: Act as a 'where' condition

Question.
Are user-defined events supported in PowerCenter workflows?

a)No, because only File Wait events are supported in the Event-Wait task.
b)Yes, but only in workflows containing worklets.
c)No, because Event-raise tasks do not support user-defined events.
d)Yes, using a combination of Event-Raise and Event-Wait tasks

Answer: Yes, using a combination of Event-Raise and Event-Wait tasks

Question.
Every mapping must contain which of the following components :

a)Source definition
b)Target definition
c)Source definition, Target definition, Transformation, Links
d)Source and Target definition

Answer: Source definition, Target definition, Transformation, Links

Question.
Which transformation is used to combine data from different sources?

Lookup
Joiner
Union
Expression

Answer: Union

Question.
Aggregator Transformation performs :

a)calculation of values in a single row
b)concatenation of columns/ports in a row
c)aggregate calculations, such as averages and sums
d)calculations on a row-by-row basis

Answer: aggregate calculations, such as averages and sums

Question.
For triming leading & trailing spaces of a in Informatica the following function is used

a)TRIM(VALUE)
b)LTRIM(VALUE)
c)LTRIM(RTRIM(VALUE))
d)AllTRIM(VALUE)

Answer: LTRIM(RTRIM(VALUE))

Question.
In Joiner Transformation, if Master Outer Join type is used, it will :

a)Keep all rows of data from the detail source and the matching rows from the master source, and discards the unmatched rows from the master source
b)Discard all rows of data from the master and detail source that do not match, based on the condition
c)Keep all rows of data from the master source and the matching rows from the detail source, and discards the unmatched rows from the detail source
d)Keep all rows of data from both the master and detail sources

Answer: Keep all rows of data from the detail source and the matching rows from the master source, and discards the unmatched rows from the master source

Question.
Chrological details of workflow tasks can be viewed in

a)Gantt chart view
b)task view
c)Workflow view
d)we cant view chronological details in worklow monitor

Answer: Gantt chart view

Question.
Which transformation only works on relational source?

Lookup
Joiner
Union
SQL

Answer: SQL

Question.
A transformation that does not change the number of rows that pass through it, is called :

a)Passive Transformation
b)Connected Transformation
c)Mapplet
d)Source Qualifier

Answer: Passive Transformation

Question.
which command is used to execute workflow tasks from the command line

REPCMD
PMCMD
CMD
PMREP

Answer: PMCMD

Question.
Which of the following transformations does not have variable port ?

Filter
Expression
Rank
Aggregator

Answer: Filter

Question.
A set of instructions to execute tasks such as sessions, emails, shell commands etc is called :

a)Mapping
b)Load Balancer
c)Workflow
d)Transformation

Answer: Workflow

Question.
Which of the following is a type of workflow task?

Ranking
Database Bulk Loading
sorting
Event Raise

Answer: Event Raise

Question.
Which of the following is not a Active Transformation ?

Router
Filter
Sequence Generator
Update Strategy

Answer: Sequence Generator

Question.
How to execute PL/SQL script from Informatica mapping?

Lookup
Store Procdure
Expression
Non of these
Answer: Store Procdure

Question.
What is a mapplet?

Combination of reusable transformation.
Set of transformations and it allows us to reuse
None of these

Answer: Set of transformations and it allows us to reuse

Question.
Which one is not a type of  fact?

Semi-aditive
Additive
Confirm fact
Not additive

Answer: Confirm fact

Question.
Which one is not a type of dimension ?

Conformed dimension
Rapidly changing dimension
Junk dimension
Degenerated dimension

Answer: Rapidly changing dimension

Question.
What does reusable transformation mean?

It can be re-used across repositories
I can only be used in mapplet.
It can use in multiple mapping only once
It can use in multiple mapping multiple times

Answer: It can use in multiple mapping multiple times

Question.
Which one is not an option in update strategy?

dd_reject
4
2
dd_delete

Answer: 4 

Monday 23 July 2018

Brief about IRCTC Proposed System - OOAD

Topic: IRCTC
Subject: OOAD
Task: Assignment
Subject: Object Oriented Analysis and Design
Prepared by: Srinivas

REQUIREMENT ANALYSIS

Objective and scope of the Project:
   
The objective of the Project
In order to overcome the drawback of the current IRCTC website, we have tried to offer passenger a growing facility for booking tickets which is not provided by IRCTC.

The scope of the Project
  • To understand the current system and implement the software with the current system.
  • To execute the software without any problems or error without creating any complications.
  • Automating the set.
PROPOSED SYSTEM
  • The proposed system is fully computerized, making ticket booking easier and cheaper.
  • It provides the user with more options for traveling.
  • According to the user's trust, you can book tickets between the source and the destination by breaking the journey in two half.
  • The price is calculated on the basis of the end to end distance rather than calculating for two different transaction.
  • The second part of the journey should start within 48 hours of the first part of the journey. The ticket for the second part of the trip is invalid without the first part of the trip.
  • A senior citizen is provided with discount only if they have valid ID proof of their age. 
  • The ticket can be printed and downloaded in pdf format.
 UML DIAGRAM:

https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

USE CASE DIAGRAMS:

https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

CLASS DIAGRAMS:


SEQUENCE DIAGRAM:

For Registration:

https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For the invalid user:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For the Valid user:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For Reservation:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For Cancellation:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

ACTIVITY DIAGRAM

For Registration:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For Login:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For Reservation:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

For Cancellation:
https://www.waseian.com/2018/07/brief-about-irctc-proposed-system-ooad.html

GRASP PATTERN 
  • GRASP defines General Responsibility Assignment Software Patterns.
  • A collection of general objected‐oriented design patterns related to assigning defining objects.
  • There are nine GRASP patterns, maybe some are already recognizable and some not:
  1. Creator 
  2. Information Expert (or just Expert) 
  3. Low Coupling 
  4. Controller 
  5. High Cohesion 
  6. Polymorphism 
  7. Pure Fabrication
  8. Indirection 
  9. Protected Variations.
CREATOR
•    This pattern generally avoids adding the coupling to a design.
•    When creation is a complex process or varies depending upon an input, often you’ll want to create using a different class implementing the GoF pattern Concrete Factory or Abstract Factory.

INFORMATION EXPERT
•    This is a general principle and probably the most used of any GRASP pattern.
•    This generally is key to loose coupling and high cohesion, but not always so. – Imagine a case where it is better to do better handheld data to preserve a large functional segmentation and support consolidation.
•    We're fully talking about the information organized by software objects, but if there are no relevant software classes, try the domain model.

LOW COUPLING
•    The higher coupling can lead to:
– More difficulty in understanding
– Changes propagating excessively
– More obstacles to code reuse
•    Less coupling often goes into the hands with a high cohesion
•    Consider this principle with every design decision.
•   The more unbalanced the class joined to, the more concerning the connection – Example. consider a language’s ordinary library vs. a class a colleague just defined a couple days ago.

CONTROLLER
•   A controller tries to organize the work without doing too much of it itself
•   A simple example of this is that UI substances shouldn’t execute business logic; there are further classes for that.
•    The controller in the Model‐View‐Controller (MVC) architecture is effectively the same thing. – This, or its variation Model‐View‐Presenter, is frequently used in web applications
HIGH COHESION
•    Very similar to Low Coupling
– Often related (but not always)
– Should be considered in every design decision.
•    Lower cohesion almost always means:
•    Low cohesion suggests that more delegation should be used.

POLYMORPHISM
•    With respect to implementation, this usually means the use of a super (parent) class or interface – Coding to an interface is generally preferred and avoids committing to a particular class hierarchy.

PURE FABRICATION
•    In other words, getting class concepts from a good domain model or real‐life objects won’t always work out well!
•   An example of a possible pure construction class: Determined Storage – May very well not be in the domain model, May very well not map to an actual‐lifetime object – But it might be the answer to attain our goals of low coupling / high cohesion while still taking a clear accountability

INDIRECTION
•   Frequently an indirection intermediary is also a pure construction. – The Determined Storage example could very well be an indirection between a Sale class and the database
•    Goff Pattern Adapter, Bridge, Facade, Observer, and Arbitrator all accomplish it.
•    The main benefit is lower coupling.

PROTECTED VARIATIONS
•    The solution "interface" is in the general sense; But to implement the solution you often want to build an interface programming (in Java, for example)!
•    Benefits: – Easy to extend functionality at PV points – Lower coupling – Implementations can be updated without affecting clients – Reduces the impact of change
•   Similar to the concealment of open-ended theory or information (not to hide data)
•    “Novice developers tend to brittle designs, intermediate developers point to highly fancy and flexible, generalized (which is never used in any way). Expert designers choose with insights."”

Note: The above-proposed system/Assignment for OOAD has been prepared by Srinivas which I have posted here. Give your blessings to him whoever find helpful for them :)

Friday 20 July 2018

Real Time Operating System Importance - Important QnA


Text Books
T1 Liu, Jane W.S., Real Time Systems, Pearson Education, 2000
T2 Laplante, Phillip A., Real-Time Systems Design and Analysis, Wiley, 3rd Ed., 2004
T3 Jared Hendrix, Raspberry Pi: Essential guide on starting your own raspberry pi3 projects with ingenious tips and tricks
T4 Arshdeep Bahga, Vijay Madisetti, Internet Of Things A hands on Approach


 

Question.1
Design a Biometric Facial Authentication device for a small company of 25 employees. The device should be capable of Enrolling and verifying the face. If the face matches then allow access into the company. The enrollment of New Ids should be stored in the organization database server and the ex-employees access should be denied.Draw the block diagram including the Components required for the design.List out the tasks: periodic, aperiodic and sporadic tasks of the system. Which scheduling algorithm should be used. Illustrate the same with an example. 

Answer:

Components required:




Periodic tasks
LCD  display 
Reading data base till match is found or END of database- 

Aperiodic Task
Face sensing through sensor 
Temporary storing of minutiae points from the image 
Matching the temporary image and database image 
Allowing access into organization(ex: opening of gate etc)

Sporadic tasks: None

Clock driven scheduling algorithm using the above parameters.

Question. 2
Consider a task set comprising of 5 tasksT(e,d) T1(13,20), T2(12,30), T3(18,40), T4(15,50) and T5(14,60) to be scheduled on 2 processors. Which scheduling strategy would ensure tasks get an optimal share of resources. The resource actually consumed is 20% (rounded off to the nearest integer). Assume the first task starts at 0.Construct the schedule and obtain the makespan.

 Answer:

The algorithm for Optimal utilization is Uniform Laxity based method as it uniformly dispenses slack improving resource allocation.

Minimum execution time = 20% of Actual execution time
Min 1 =0.2*13=2.6 = 3 (approx)
Min2= 0.2*12=2.4 = 2(approx)
Min3=0.2*18=3.6=4 (approx)
Min4=0.2*15=3(approx)
Min5=0.2*14=2.8=3(approx)

Laxity = (deadline –(current time +minimum execution time))
L1=(20-(0+3))=17
L2=(30-(20+2))=8
L3=(50-(40+3))=7
L4=(60-(50+3))=7
L5=(30-(25+2))=3
Average Laxity=9

Time utilized =Min exec time + Average Laxity
TU1=3+9=12
TU2=2+9=11
TU3=4+9=13
TU4=3+9=12
TU5=3+9=12

Slack Available = WCET-Time Utilised
S1=13-12=1
S2=12-11=1
S3=18-13=5
S4=15-12=3
S5=14-12=2


Makespan on P1= 12+11 = 23 units
Makespan on P2= 13+12+12 = 37 units

Question. 3
Draw petrinet model for vending machine, The machine dispenses two kinds of snack bars – 20c and 15c.
Only two types of coins can be used – 10c coins and 5c coins. The machine does not return any change.


Answer:
3 scenarios can be considered,
  Scenario 1: 
Deposit 5c, deposit 5c, deposit 5c, deposit 5c, take 20c snack bar.

  Scenario 2:
Deposit 10c, deposit 5c, take 15c snack bar.

  Scenario 3:

Deposit 5c, deposit 10c, deposit 5c, take 20c snack bar.


Question. 4
Given seven tasks, A, B, C, D, E, F, and G, construct the precedence graph from the
following precedence relations:.
A → C
B →C B→ D
C →E C→ F
D →F D→ G
Then, assuming that all tasks arrive at time t = 0, have deadline D = 25, and computation
times 2, 3, 3, 5, 1, 2, 5, respectively, modify their arrival times and deadlines to schedule
them by EDF.

Answer:

The precedence graph is shown below:









Question. 5
Let us consider an automatic car body painting machine has two robotic arms R1 and R2. The real time system that is responsible for paint operation has five different processes P1, P2, P3, P4 and P5. The release time and CPU burst time of each process is ri=(7, 5, 4, 2 and 0) and ei=(3, 3, 2, 6 and 6) respectively. The process P1 requires the robotic arm R1 for duration of 1 unit of time and it is required at time 8. Similarly the process P2 and P5 needs another arm R2 at time 6 and 1 respectively. The process P2 and P5 needs those resources for a period of 1 and 4 unit of time respectively. However, the process P4 required both the robotic arm R1 and R2 for a period of 4 and 1.5 unit of time and at 3 and 9 unit of time. The priority of the process varies with its number i.e. P1 has maximum and P5 has minimum priority. Now schedule those processes by considering the priority ceiling protocol. Determine that if there is any process will be blocked because of resource conflict also find the time of block. Also draw the time line diagram illustrating the above example. Assume you have only one CPU and the robotic arm are non-pre-emptible.

Answer:



Wednesday 18 July 2018

Important QnA on Multimedia Computing


Text Books

T1 Ze-Nian Li & Mark S. Drew, "Fundamentals of Multimedia", Pearson Education, 2004


Question.1 
Explain the difference between Temporal and Frequency masking.

Answer:
Frequency Masking: When an audio signal consists of multiple frequencies the sensitivity of the ear changes with the relative amplitude of the signals. If the frequencies are close and the amplitude of one is less than the other close frequency then the second frequency may not be heard. 

Temporal masking
  • After the ear hears a loud sound, consisting of multiple frequencies, it takes a further short while before it can hear a quieter sound close in frequency.
  • Temporal Masking accomplished 50% overlap between consecutive transform windows and then relating frequency masking.
  • MPEG Audio encrypts frequency masking by quantizing each filter bank with adaptive values from nearby bands, defined by a look up table.
Question. 2
Consider the following set of protocols (SIP, RTSP, RSVP, RTCP, RTP on top of UDP. If you want to design a protocol stack (control and data plane) for Video‐On‐Demand (VOD) service between client and server, (a) which protocols would you use and why, and (b) in which order would you apply your selected protocols? Explain how the protocol stack of selected protocols would be used ?

Answer:
To design the Video‐On‐Demand service,
RTP protocol : for transmission of the video . RTP/UDP enables real‐time transmission. 
RTCP : The accompanying control protocol for RTP is the RTCP that would allow the receiver to provide feedback to the sender if some parameters need to be adjusted during the streaming session. 
RTSP : Since VOD will use commands such as play, stop, pause, fast forward, rewind, so anyone should use the RTSP protocol because it specifies signaling for completing these control tasks between the client and the server.
RSVP: If an IP level also requires the built-in reservation capabilities of VOD traffic, it is important to enable the RSVP protocol to start integrated Guaranteed Services using the RSVP Reservation Protocol.
 
RSVP to reserve bandwidth for the VOD session. 

Once the resources are reserved, VOD traffic should be transmitted via RTP which is on top of UDP/IP. 


Along with this, RTP RTCP and RTSP should provide (1) RTP (Control) to provide control feedback about the status of traffic and receiver, and (2) controlling the channel through signaling (RTSP) control , Stop, and otherwise control the VOD playback.

Question. 3
Compress the string “DEAF!DEFEATED” using LZW algorithm. Find compression ratio by

supposing that originally the characters are represented in 8-bit (B=66, A = 65, ,., Z = 90, Y = 89, , ! = 33).

Answer:
Input: DEAF!DEFEATED

Previous
Current
Output
Code
String

065
A
068
D
069
E
070
F
084
T
033
!
D
E
068
256
DE
E
A
069
257
EA
A
F
065
258
AF
F
!
070
259
F!
!
D
033
260
!D
D
E



DE
F
256
261
DEF
F
E
070
262
FE
E
A



EA
T
257
263
EAT
T
E
084
264
TE
E
D
069
265
ED
D
End Of File
068



The compressed output is 068 069 065 070 033 256 070 257 084 069 068
Compression ratio = 13/11 = 1.18181

Question. 4
Suppose we use a predictor as follows: 

Also, suppose we adopt the quantizer equation

If the input signal has values as follows 20  32  42  54   78   97 115  129  150  173   205
Then find the following using DPCM
a. Predicted signal
b. Error signal
c. Quantized error signal
d. Reconstructed signal

Answer:




Question. 5
Complete the following table:


# of frequency bands
Min # of Samples
Max # of Samples
MPEG Layer 1



MPEG Layer 2



MPEG Layer 3




Answer:


# of frequency bands
Min # of Samples
Max # of Samples
MPEG Layer 1
32
12
12
MPEG Layer 2
32
36
36
MPEG Layer 3
32
12
36

Question. 6
You have to design a DVR server which may serve up to 100 simultaneous users over a 1 gbps connection. One of the key requirements is to support trick modes for video, including aspects like 16X rewind. Typical video will be stored in high definition approx. 20 mbps, 24 frames per second.  Each I frames take 8x data, while P frame takes 2x and B frames take 1x data.  What would be the average size for each I, P and B frames in bytes. 

Answer:
24 fps. It has IBBPBBPBBPBB
In this 1-I, 3-P, 8-B
Each of these has
I- 8X, P-2X and B-1X data
1*8X+3*2X+8*1X=22X
22X = 0.5 sec
1 sec -> 20 mb
0.5 sec -> ?  => 10 mb
22X = 10 mb

X= 106 bits/ 22 = 106 /(22*8) bytes = 5682 bytes

Question. 7
Using the following frequency table compress the string “DEED” (originally 8-bit representation) & find the compression ratio using arthimetic compression(64-bit arthimetic).
Character
A
B
C
D
E
F
G
H
frequency
10
20
10
20
50
70
90
30

Answer:

Characters
Frequency
Range
A
10
[0, 0.03)
B
20
[0.03, 0.1)
C
10
[0.1, 0.13)
D
20
[0.13, 0.2)
E
50
[0.2, 0.36]
F
70
[0.36, 0.6]
G
90
[0.6, 0.9)
H
30
[0.9, 1)
Compression

Symbol
Low
High
Range

0
1.0
1.0
D
0.13
0.2
0.07
E
0.144
0.1552
0.0112
E
0.14624
0.148032
0.001792
D
0.14647296
0.1465984
0.00012544

After compression consider the lower value 0.14647296

Compression ratio = 64/18 =3.555

Question. 8
Ten channels, each with a 150-kHz bandwidth, are to be multiplexed together. What is the minimum bandwidth of the link if there is a need for a guard band of 20 kHz between the channels to prevent interference?

Answer:
For ten channels, we need at least nine guard bands. This means that the required bandwidth is at least
10*150KHz + 9*20 KHz =  1680 KHz

Question. 9
Integrating RTP / RTCP type protocols works better for applications like Skype as opposed to relying on RSVP. Mention True or False and Briefly explain the reason.

Answer:
RSVP will not provide QoS across multiple autonomous systems, especially because the user base is world-wide. While RTP can be used with/without RSVP (i.e. explicit reservation)for Skype, the feedback uses RTCP like mechanism to find delay/jitter/loss-rates and adjust its approach accordingly. In other works rather than expecting quality from network, it modifies application behaviour to align with observed network characteristics.

Question. 10
The LZ compression is used to compress a text document. The dictionary table contains 512 entries. The average character per word in the document is 5. Calculate the compression achieved.

Answer:
The dictionary table contains 512 entries. Hence, it is represented by a 10 – bit code word (2"9 = 512). Thus, the index of each word in the document is a 9-bit number. If the compression scheme was not applied, each character would have been represented by a 7-bit ASCII code. Since there is an average of 5 characters per word, each word would need to be represented by a 35-bit number. However, after compression each word is represented by a 9-bit number. Hence, the compression ratio is 35:9

Question. 11
Calculate the storage capacity per image for SVGA given its resolution as 1920x1080 pixels and the color format is 24bits/pixel.

Answer:
Image Resolution=1920x1080 pixels, Colour Depth=24bits/pixel
Storage capacity = Resolution X (no. of bits per pixel / 8 bits per byte)
    = 1920x1080 x(24/8) bytes = 6220800 bytes

Facebook