Oral Questions 2021 - SW Architecture

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Oral Questions 2021 - Software Architecture

1. What is the difference between static and dynamic linking?


Static and dynamic linking are two process of collecting and combining multiple object files to
create a single executable.
Static linking: implemented in compile time, performed by programs called (linkers), file size is
large, recompiled and relinked if the external program changed, constant load time, statically
linked libraries are faster than shared libraries, compatible.
Dynamic Linking: implemented in run time, performed by OS, file size is small, individual shared
module, reduce load time, shared libraries slower than static linked libraries, not compatible.

2. What is the difference between static binding and dynamic binding?


Binding is an association of function calls to object.
Static binding: implemented as method call, implemented in compile time, efficiency, fast
execution, early binding.
Dynamic binding: implemented by interface relationship, implemented in run time, flexible,
slow execution, late binding.
Overloaded methods are bonded using static binding while overridden methods are bonded
using dynamic binding.
. Signature-based - static - compile time
. Protocol-based - dynamic - run time

3. Compare between signature-based and protocol-based connectors?


Signature-based Protocol-based

Signature-based: The method’s name indicates an operation, and the parameters carry
argument values for the execution of the operation.
Protocol-based: A protocol-based connector can implement multiple operation types with a
single binding signature.
4. Compare between blocking and non-blocking connectors?
blocking (sync.) allows one of its incident elements to send a request (method call or message)
to another and wait for a response (method return value or message), and the element will be
blocked from further execution until it receives a response.
non-blocking(async.) allows one of its incident elements to send a request (method call or
message) to another and then continue its execution without waiting for a response.

5. What is an association, aggregation, and composition?

They represent the reusability attribute in object oriented.


Association: is a broad term that encompasses just about any logical connection or relationship
between classes. It is a relationship where all objects have their own lifecycle and there no
owner.
Example: Teacher and Student. Multiple students can associate with a single teacher and a
single student can associate with multiple teachers. Both can create and delete independently.
Aggregation: is a special form of Association where all objects have their own lifecycle, but
there is ownership, and a child object cannot belong to another parent object.
It refers to the formation of a particular class as a result of one class being aggregated or built
as a collection. For example, the class “library” is made up of one or more books, among other
materials. In aggregation, the contained classes are not strongly dependent on the lifecycle of
the container. In the same example, books will remain so even when the library is dissolved.
Example: Department and Teacher. A single teacher cannot belong to multiple departments,
but if we delete the department, teacher will be not affected.
Composition: is a special form of Aggregation. Child object does not have their lifecycle and if
parent object deletes, all child will be deleted.
Example: House and Rooms. House can contain multiple rooms but there is no independent life
of a room, and any room cannot belong to two different houses. If we delete the house, the
rooms will be deleted.

6. What is the difference between logical and physical views?


There are five views in the model: the logical view, the process view, the development view, the
physical view, and the user interface view.
The logical view is used to identify software modules and their boundaries, interfaces, external
environment, usage scenarios, etc.
The process view addresses non-functional requirements such as module communication styles
and performance issues at runtime.
The development view organizes the software units in well-defined ways according to the
actual file or directory structure.
The physical view specifies the deployment infrastructure in terms of software, hardware, and
networking configurations, installation, and deployment for delivery purposes.

7. Compare between reentrant and non-reentrant elements?


Reentrant (multiple-threads can execute concurrently in the element).
Non-reentrant is a single thread, multiplicity(1—1 or 1..*), …
Reentrant elements: it can be implemented by a thread or process. It is more efficient because
they avoid many synchronization issues.
Non-reentrant elements: it must be run on separate threads or process in order to be
threadsafe (means that system behavior is not affected by the multiplicity of threads
executing).

8. What is software portability? How can we achieve it? Give an example?


Portability: This refers to the level of independence of the system on software and hardware
platforms. Systems developed using high-level programming languages usually have good
portability. One typical example is Java –most Java programs need only be compiled once and
can run everywhere.
Portable means the software system runs on any hardware machine.
Dynamic linking satisfies portability.

9. Why did you choose the web-service in your solution?


Because the quality attributes of WS are required by the company.
1. Loose-coupling is the key attribute of SOA. Each service component is independent from
other services.
2. Scalability: Loosely coupled services make themselves easy to scale.
3. Easy to update: The implementation of a service will not affect the application of the
service as long as the exposed interface is not changed. It makes SOA software much
easier to evolve and update.
4. Interoperability: Technically any client or any service can access other services
regardless of their platform, technology, vendors, or language implementations.
5. Reusability: Any service can be reused by any other service. Because clients of a service
only need to know its public interfaces, service composition and integration become
much easier.
6. Adaptability, Maintainability, Distribution.
In the company,
1. there is an increased number of clients, so scalability is needed.
2. 13 different companies are interconnected, so interoperability is needed.
3. The 13 companies are distributed across multiple locations and needed to be accessed
by the chairman.
4. Maintainability makes the management easier for the holding company.
10. Object vs class?
Object: data and method encapsulated in one unit called object.
Class: attributes and methods are integrated together in one package. An object is an instance
of a class.

11. Compare between web service and components?


Web service is an integration between component technology and Internet technology.
It includes all components features except:
1. The communication in web service is by internet protocols [SOAP, XML, HTTP], while in
component is by local area networks.
2. Web services are independent programs that provide services but don’t require services
while components may provide and require.

12. How to achieve reliability?


Reliability is broadly defined as the probability that a system is running (not down) at a certain
time point, whereas availability is the probability that the system is continuously available
during a time interval.
Reliability or availability is satisfied by:
1. Fault Avoidance: by building perfect system (testing).
2. Fault Tolerance: diversity (different versions and voting) or redundancy.

13. What is Interoperability?


In component or WS, client application interacts with different components implemented in
different PL. Component interact with another component implemented in different PL.

14. What is data structure?


Data structure is a data organization, management and storage format that enables efficient
access and modification. More precisely, a data structure is a collection of data values, the
relationships among them, and the functions or operations that can be applied to the data.
A data structure is a way of organizing the data so that it can be used efficiently in terms of both
the space and time.

15. What is the difference between the broker and the bridge?
Broker: is a middleware architecture used to coordinate and facilitate communication between
different components in distributed systems (over a network), passing on requests and
returning replies.
Examples: .NET, CORBA.
Bridge: is used to hide implementation details when two brokers interoperate. It can connect
two different networks based on different communication protocols.

16. What is the difference between middleware and bridge? in which layer, in the network
model, they exist?
Middleware is the broker that coordinate communication in distributed systems whilst bridge is
used when two brokers interoperate.
They exist in the Application layer.

17. What is the difference between static connectors and dynamic connectors?
Static connectors are in the form of module dependency: Module A is connected to module B if
and only if A needs to invoke some methods in module B during execution.
Static connectors have attributes including Direction (If module A invokes a method of module
B during execution, then there is a unidirectional connector from module A to module B. e.g.
navigation –association uni-direction), Synchronization (A method invocation can be
synchronous or asynchronous) and Sequence (Some connectors must be used in a particular
sequence).
Dynamic (Runtime) connectors have attributes such as:
Multiplicity. One element can be connected to multiple other elements if it needs to invoke
methods of multiple elements at runtime.
Universally invokable. A connector with this attribute set to true allows any external software
system, no matter what hardware/ software platforms that they run on and what programming
languages or software frameworks that they are developed in, can invoke the method at the
connector’s target.
Self-descriptive. A connector with this attribute set to true can allow external software systems
invoke its target method without the pre-installation of any software specific for the method.

18. What is the difference between mobile code and mobile agent?
Similarity: Both have the mobility attribute.
Difference:
Mobile code: Mobile agent:
It is terminated at destination machine. It It must come back to the home machine. It
consists of code and data. consists of code, data, and states (the data
controlled by CPU and OS). It can migrate to
n-machines and comeback to the home
machine.

19. What is Software Architecture and Software Architecture style and Software Architecture
reference?
Software Architecture: It is a structured solution for a SW system that meets the functional and
nonfunctional requirements.
Software Architecture Style: It is an architecture pattern that include the following key
components:
1. Elements: that perform functions required by the system.
2. Connectors: that enable the communication, coordination, and cooperation among the
elements.
3. Constraints: that define how the elements can be integrated to form the system.
4. Attributes: that describe advantages and disadvantages of the proposed solution.
Software Architecture Reference: A reference software architecture is a reference model
mapped onto software components and their relations (mapping of functionality onto software
components).

20. What is linked list and array? What is the difference between them?
Linked list: It is a sequence of links which contains items. Each link contains a connection to
another link. (slower access, dynamic size).
A linked list data structure includes a series of connected nodes. Here, each node store the data
and the address of the next node.
Array: It is a data structure that contains a group of elements. Typically these elements are all of
the same data type, such as an integer or string. Arrays are commonly used in computer
programs to organize data so that a related set of values can be easily sorted or searched.
(faster access, fixed size).

21. How do we insert data in link list?


Change in head and next pointers.
1. Insert at the beginning: Allocate memory for new node, Store data, Change next of new
node to point to head, Change head to point to recently created node.
2. Insert at the End: Allocate memory for new node, Store data, Traverse to last node, Change
next of last node to recently created node.
3. Insert at the Middle: Allocate memory and store data for new node, Traverse to node just
before the required position of new node, Change next pointers to include new node in
between.

22. What are the types of sorting algorithms?


1. Merge Sort. (Divide and Conquer) It repeatedly breaks down a list into several sublists
until each sublist consists of a single element and merging those sublists in a manner
that results into a sorted list.
2. Insertion Sort. The array elements are compared with each other sequentially and then
arranged simultaneously in some particular order.
3. Bubble Sort. is a simple sorting algorithm that repeatedly goes through the list,
compares adjacent elements and swaps them if they are in the wrong order. This is the
most simplest algorithm and inefficient at the same time.
4. Quicksort. (Divide and Conquer) It is based on the splitting of an array (partition) into
smaller ones and swapping (exchange) based on the comparison with 'pivot' element
selected.
5. Selection Sort. We divide the array into two parts: sorted and unsorted. Initially, sorted
subarray is empty and unsorted array is the complete given array. We pick the minimum
element from the unsorted subarray. Swap it with the leftmost element of the unsorted
subarray. Now the leftmost element of unsorted subarray becomes a part (rightmost) of
sorted subarray and will not be a part of unsorted subarray.

23. Compare between RPC and RMI? When do we use procedure call and when do we use
method invocation?
It depends on middleware, RPC for CORBA and RMI is for JAVA/RMI
RPC and RMI both are similar but the basic difference between RPC and RMI is that RPC
supports procedural programming, on the other hand, RMI supports object-oriented
programming.
1. RPC is a library and OS dependent platform. RMI is a java platform.
2. RPC supports procedural programming. RMI supports object oriented programming.
3. RPC is less efficient in comparison of RMI.
4. RPC creates more overhead than RML.
5. The parameters passed in RPC are normal data. While in RMI, objects are passed as
parameter.
6. RPC is the older version of RMI.
7. RPC does not provide any security. RMI provides client level security.
8. RPC development cost is huge. RMI development cost is reasonable.

24. What is marshaling and un-marshaling? And how do they work?


Marshaling: the proxy of the client app will change its programming language format (ex. VB) to
network intermediate format.
Unmarshalling: the stub in the server will change the network intermediate format to its
programming language format (ex. C++).
Marshalling and unmarshalling is used on the client and server side. "Marshalling" refers to the
process of converting the data or the objects into a byte-stream, and "Unmarshalling" is the
reverse process of converting the byte-stream back to their original data or object.

25. Which is the best and fastest search algorithm?


Binary search is faster than linear search except for small arrays. However, the array must be
sorted first to be able to apply binary search.
Binary algorithm worst case is O(log n).
A binary search cut down your search to half as soon as you find middle of a sorted list. The
middle element is looked to check if it is greater than or less than the value to be searched.
Accordingly, search is done to either half of the given list.

26. Is RPC dynamic or static?


Dynamic.

27. Compare between grid computing and data computing?

28. What type of connectors have you used in your architecture in the written exam and
why?
It is a static structure with association and navigation relationship.
29. What do you do before start designing your architecture?
Analysis of requirements (functional and non-functional).
Choose an architecture style and software technology based on quality attributes.

30. After the implementation phase, what should u do before deliver the product to your
customer?
Testing.

31. If you have complex software and there is no tool in the market to test it, who can do the
test? Give scenario example?

End users. If a new ODUS system is implemented, it is better to make students test the system.

32. What is the difference between semaphore variable and collective variable?
Semaphore: is a variable or abstract data type used to control access to a common resource by
multiple processes in a concurrent system such as a multitasking operating system.
A semaphore is simply a variable. This variable is used to solve critical section problems and to
achieve process synchronization in the multi-processing environment.
Collective: involves data sharing between more than two tasks, which are often specified as
being members in a common group, or collective. Tasks wait (do not finish execution) for each
other to finish. Then join them together.

33. What is the difference between reusability in component technology and reusability in
web services technology?
Reusability of WS: Any service can be reused by any other service,. Because clients of a service
only need to know its public interfaces, service composition and integration become much
easier.
Object Oriented Component
Reusability

During the coding of application.

During run-time. After compilation.

34. What is software portability? How can we achieve it? Give an example?
Portability: This refers to the level of independence of the system on software and hardware
platforms. Systems developed using high-level programming languages usually have good
portability. One typical example is Java –most Java programs need only be compiled once and
can run everywhere.
Can be achieved using dynamic linking and virtual machine.
35. How to achieve high availability?
Availability is the probability that the system is continuously available during a time interval.
Reliability or availability is satisfied by:
1. Fault Avoidance: by building perfect system (testing).
2. Fault Tolerance: diversity (different versions and voting) or redundancy.

36. Compare between Virus & Worm?


The primary difference between a virus and a worm is that viruses must be triggered by the
activation of their host; whereas worms are stand-alone malicious programs that can
selfreplicate and propagate independently as soon as they have breached the system.
A computer virus is a type of malware that propagates by inserting a copy of itself into and
becoming part of another program. It spreads from one computer to another, leaving infections
as it travels. Viruses can range in severity from causing mildly annoying effects to damaging
data or software and causing denial-of-service (DoS) conditions. Almost all viruses are attached
to an executable file, which means the virus may exist on a system but will not be active or able
to spread until a user runs or opens the malicious host file or program. When the host code is
executed, the viral code is executed as well. Viruses spread when the software or document
they are attached to is transferred from one computer to another using the network, a disk, file
sharing, or infected email attachments.
Computer worms are similar to viruses in that they replicate functional copies of themselves
and can cause the same type of damage. In contrast to viruses, which require the spreading of
an infected host file, worms are standalone software and do not require a host program or
human help to propagate. To spread, worms either exploit a vulnerability on the target system
or use some kind of social engineering to trick users into executing them. A worm enters a
computer through a vulnerability in the system and takes advantage of file-transport or
information-transport features on the system, allowing it to travel unaided. More advanced
worms leverage encryption, wipers, and ransomware technologies to harm their targets.
------------------------------------------------------
1. What is Mobile Agents?
are computational software processes capable of roaming wide area networks (WANs) such as
www, interacting with foreign hosts, gathering information on behalf of its owner and coming
back to home machine having performed duties set by its user.
Consist of: Code, Data, State (data managed and controlled by CPU and operating system).

2. How metadata was used in the scenario by agent? How you draw metadata in the exam?
Mobile agent collect metadata from registers of remote machines and store them in integrated
database in home machine.
3. What is ruggedness in agent? What is flexibility of agent?
Ruggedness: if an agent is required to traverse networks, both large and small, it must be
rugged able to deal with errors, low resources, underpowered servers, interpret different kinds
of data, and so on.
Flexibility: the architecture is created during run time, it can be changed from one run time to
another.

4. What is the bridge?


• These optional components are used to hide implementation details when two brokers
interoperate.
• They can take requests and parameters in one format and translate them to another
format.
• A bridge can connect two different networks based on different communication protocols.

5. Where we implement protocol based connectors?


In interface class (dynamic binding during run time).

6. How to achieve scalability in components?


By two methods:
Symmetric Multiprocessing. Symmetric multiprocessing (SMP) involves a multiprocessor
computer hardware and software architecture where two or more identical processors are
connected to a single, shared main memory, have full access to all input and output devices,
and are controlled by a single operating system instance that treats all processors equally,
reserving none for special purposes.
Flexible deployment. By design the entity component as a set of pipelined components. This
satisfies scalability and performance.

7. What is the function of JVM? How to translate byte code to machine code?
It is a software tool that translates the byte code to target machine code. (it helps to achieve
portability in mobile agents).
8. Explain Thin and Fat client-server architectures?
Thin: presentation layer in client machines / business and data management layers in the server
machine.
Fat: presentation and business layers in client machines / data management layer in the server
machine.
Quality attributes comparison:
1. Performance: Fat > Thin
2. Traffic: Fat = Thin using no. of requests / Thin > Fat using amount of data and no. of
requests.
3. Scalability: Fat > Thin
4. Management (cost of replacing old versions): Thin > Fat

9. What is depth-first and breadth-first search?


BFS: This algorithm selects a single node (initial or source point) in a graph and then visits all the
nodes adjacent to the selected node. It continue iterating until all the nodes of the graph have
been successfully visited.
DFS: The execution of the algorithm begins at the root node and explores each branch before
backtracking.
KEY DIFFERNCES:
1. BFS is implemented using FIFO list on the other hand DFS is implemented using LIFO list.
2. In BFS, you can never be trapped into finite loops whereas in DFS you can be trapped into
infinite loops.
3. BFS uses Queue data structure for finding the shortest path. DFS uses Stack data structure.

10. What is the difference between Queue and Stack?


Stack and Queue both are data structures. The main differences between stack and queue are
that stack uses LIFO (last in first out) method to access and add data elements whereas Queue
uses FIFO (First in first out) method to access and add data elements.

11. What is static structure and dynamic structure? Give Examples


Static: At software development time, the main software elements are source code modules.
The connectors at this level are in the form of module dependency. (one time)
Dynamic: At runtime, elements are threads, processes, functional units, and data units. The
connectors are method invocations. The same element in static structure can implement
multiple runtime elements. (change from one run to another).
Example:

12. What is call by value and call by reference?


Functions can be invoked in two ways: Call by Value or Call by Reference.
The parameters passed to function are called actual parameters whereas the parameters
received by function are called formal parameters.
Call By Value: In this parameter passing method, values of actual parameters are copied to
function’s formal parameters and the two types of parameters are stored in different memory
locations. So any changes made inside functions are not reflected in actual parameters of the
caller.
Call by Reference: Both the actual and formal parameters refer to the same locations, so any
changes made inside the function are actually reflected in actual parameters of the caller.

13. In mobile agent based system, when architecture is created?


During the run time. It can be changed from run time to another. (flexible distributed
deployment architecture)

14. What is the difference between stateless and stateful servers?


In Stateless, server is not needed to keep the server information or session details to itself. In
stateful, a server is required to maintain the current state and session information. In stateless,
server and client are loosely coupled and can act independently. In stateful, server and client
are tightly bound.

15. In written exam, what grid is used?


Hybrid, to share data and HW resources.

You might also like