0% found this document useful (0 votes)
69 views7 pages

Set Questions 1

The document discusses various topics related to software architecture and development. It provides answers to 14 questions on topics such as load balancing, the CAP theorem, scalability, clustering, test driven development, microservices architecture, domain driven design, and middle tier clustering. The questions and answers provide concise explanations of these foundational architectural concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views7 pages

Set Questions 1

The document discusses various topics related to software architecture and development. It provides answers to 14 questions on topics such as load balancing, the CAP theorem, scalability, clustering, test driven development, microservices architecture, domain driven design, and middle tier clustering. The questions and answers provide concise explanations of these foundational architectural concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

FullStack.

Cafe - Kill Your Tech Interview

FullStack.Cafe - Kill Your Tech Interview

Q1: What Is Load Balancing? ☆

Topics: Software Architecture Load Balancing

Answer:

Load balancing is simple technique for distributing workloads across multiple machines or clusters. The most
common and simple load balancing algorithm is Round Robin. In this type of load balancing the request is divided
in circular order ensuring all machines get equal number of requests and no single machine is overloaded or
underloaded.

The Purpose of load balancing is to

Optimize resource usage (avoid overload and under-load of any machines)


Achieve Maximum Throughput
Minimize response time

Most common load balancing techniques in web based applications are

1. Round robin
2. Session affinity or sticky session
3. IP Address affinity

Q2: What Is CAP Theorem? ☆

Topics: Software Architecture CAP Theorem

Answer:

The CAP Theorem for distributed computing was published by Eric Brewer. This states that it is not possible
for a distributed computer system to simultaneously provide all three of the following guarantees:

1. Consistency (all nodes see the same data even at the same time with concurrent updates )
2. Availability (a guarantee that every request receives a response about whether it was successful or failed)
3. Partition tolerance (the system continues to operate despite arbitrary message loss or failure of part of the
system)

The CAP acronym corresponds to these three guarantees. This theorem has created the base for modern
distributed computing approaches. Worlds most high volume traffic companies (e.g. Amazon, Google, Facebook)
use this as basis for deciding their application architecture. It's important to understand that only two of these
three conditions can be guaranteed to be met by a system.

Q3: What Is Scalability? ☆☆

Topics: Software Architecture Scalability

Answer:

Page 1 of 7
FullStack.Cafe - Kill Your Tech Interview

Scalability is the ability of a system, network, or process to handle a growing amount of load by adding more
resources. The adding of resource can be done in two ways

Scaling Up
This involves adding more resources to the existing nodes. For example, adding more RAM, Storage or
processing power.
Scaling Out
This involves adding more nodes to support more users.

Any of the approaches can be used for scaling up/out a application, however the cost of adding resources (per
user) may change as the volume increases. If we add resources to the system It should increase the ability of
application to take more load in a proportional manner of added resources.

An ideal application should be able to serve high level of load in less resources. However, in practical, linearly
scalable system may be the best option achievable. Poorly designed applications may have really high cost on
scaling up/out since it will require more resources/user as the load increases.

Q4: What Is A Cluster? ☆☆

Topics: Software Architecture

Answer:

A cluster is group of computer machines that can individually run a software. Clusters are typically utilized to
achieve high availability for a server software. Clustering is used in many types of servers for high availability.

App Server Cluster


An app server cluster is group of machines that can run a application server that can be reliably utilized with
a minimum of down-time.
Database Server Cluster
An database server cluster is group of machines that can run a database server that can be reliably utilized
with a minimum of down-time.

Q5: Why Do You Need Clustering? ☆☆

Topics: Software Architecture

Answer:

Clustering is needed for achieving high availability for a server software. The main purpose of clustering is to
achieve 100% availability or a zero down time in service. A typical server software can be running on one
computer machine and it can serve as long as there is no hardware failure or some other failure. By creating a
cluster of more than one machine, we can reduce the chances of our service going un-available in case one of
the machine fails.

Doing clustering does not always guarantee that service will be 100% available since there can still be a chance
that all the machine in a cluster fail at the same time. However it in not very likely in case you have many
machines and they are located at different location or supported by their own resources.

Q6: What is Test Driven Development? ☆☆

Topics: Agile & Scrum Software Architecture

Answer:

Page 2 of 7
FullStack.Cafe - Kill Your Tech Interview

Test Driven Development (TDD) is also known as test-driven design. In this method, developer:

1. first writes an automated test case which describes new function or improvement and
2. then creates small codes to pass that test, and
3. later re-factors the new code to meet the acceptable standards.

Q7: What is meant by the KISS principle? ☆☆

Topics: Software Architecture

Answer:

KISS, a backronym for "keep it simple, stupid", is a design principle noted by the U.S. Navy in 1960. The KISS
principle states that most systems work best if they are kept simple rather than made complicated; therefore
simplicity should be a key goal in design, and that unnecessary complexity should be avoided.

Q8: What defines a software architect? ☆☆

Topics: Software Architecture

Answer:

An architect is the captain of the ship, making the decisions that cross multiple areas of concern (navigation,
engineering, and so on), taking final responsibility for the overall health of the ship and its crew (project and its
members), able to step into any station to perform those duties as the need arises (write code for any part of the
project should they lose a member). He has to be familiar with the problem domain, the technology involved, and
keep an eye out on new technologies that might make the project easier or answer new customers' feature
requests.

Q9: Why is it a good idea for “lower” application layers not to be


aware of “higher” ones? ☆☆

Topics: Software Architecture Layering & Middleware

Answer:

The fundamental motivation is this:

You want to be able to rip an entire layer out and substitute a completely different (rewritten) one, and
NOBODY SHOULD (BE ABLE TO) NOTICE THE DIFFERENCE.

The most obvious example is ripping the bottom layer out and substituting a different one. This is what you do
when you develop the upper layer(s) against a simulation of the hardware, and then substitute in the real
hardware.

Also layers, modules, indeed architecture itself, are means of making computer programs easier to understand
by humans.

Q10: Define Microservice Architecture ☆☆

Topics: Microservices Software Architecture

Answer:

Page 3 of 7
FullStack.Cafe - Kill Your Tech Interview

Microservices, aka Microservice Architecture, is an architectural style that structures an application as a


collection of small autonomous services, modeled around a business domain.

Q11: What do you mean by lower latency interaction? ☆☆

Topics: WebSockets Software Architecture

Answer:

Low latency means that there is very little delay between the time you request something and the time you get
a response. As it applies to webSockets, it just means that data can be sent quicker (particularly over slow links)
because the connection has already been established so no extra packet roundtrips are required to establish the
TCP connection.

Q12: Why use WebSocket over HTTP? ☆☆

Topics: WebSockets Software Architecture

Answer:

A WebSocket is a continuous connection between client and server. That continuous connection allows the
following:

1. Data can be sent from server to client at any time, without the client even requesting it. This is often called
server-push and is very valuable for applications where the client needs to know fairly quickly when
something happens on the server (like a new chat messages has been received or a new price has been
udpated). A client cannot be pushed data over http. The client would have to regularly poll by making an http
request every few seconds in order to get timely new data. Client polling is not efficient.

2. Data can be sent either way very efficiently. Because the connection is already established and a webSocket
data frame is very efficiently organized, one can send data a lot more efficiently that via an HTTP request
that necessarily contains headers, cookies, etc...

Q13: What is Domain Driven Design? ☆☆

Topics: Software Architecture DDD

Answer:

Domain Driven Design is a methodology and process prescription for the development of complex systems
whose focus is mapping activities, tasks, events, and data within a problem domain into the technology artifacts
of a solution domain.

It is all about trying to make your software a model of a real-world system or process.

Q14: What Is Middle Tier Clustering? ☆☆☆

Topics: Software Architecture Layering & Middleware

Answer:

Middle tier clustering is just a cluster that is used for service the middle tier in a application. This is popular since
many clients may be using middle tier and a lot of heavy load may also be served by middle tier that requires it
be to highly available.

Page 4 of 7
FullStack.Cafe - Kill Your Tech Interview

Failure of middle tier can cause multiple clients and systems to fail, therefore its one of the approaches to do
clustering at the middle tier of a application. In general any application that has a business logic that can be
shared across multiple client can use a middle tier cluster for high availability.

Q15: What Is Session Replication? ☆☆☆

Topics: Software Architecture

Answer:

Session replication is used in application server clusters to achieve session failover. A user session is replicated
to other machines of a cluster, every time the session data changes. If a machine fails, the load balancer can
simply send incoming requests to another server in the cluster. The user can be sent to any server in the cluster
since all machines in a cluster have copy of the session.

Session replication may allow your application to have session failover but it may require you to have extra cost
in terms of memory and network bandwidth.

Q16: What is Back-Pressure? ☆☆☆

Topics: Availability & Reliability Software Architecture

Answer:

When one component is struggling to keep-up, the system as a whole needs to respond in a sensible way. It is
unacceptable for the component under stress to fail catastrophically or to drop messages in an uncontrolled
fashion. Since it can’t cope and it can’t fail it should communicate the fact that it is under stress to upstream
components and so get them to reduce the load.

This back-pressure is an important feedback mechanism that allows systems to gracefully respond
to load rather than collapse under it. The back-pressure may cascade all the way up to the user, at which
point responsiveness may degrade, but this mechanism will ensure that the system is resilient under load, and
will provide information that may allow the system itself to apply other resources to help distribute the load.

Q17: What is Elasticity (in contrast to Scalability)? ☆☆☆

Topics: Scalability Software Architecture

Answer:

Elasticity means that the throughput of a system scales up or down automatically to meet varying demand as
resource is proportionally added or removed. The system needs to be scalable to allow it to benefit from the
dynamic addition, or removal, of resources at runtime. Elasticity therefore builds upon scalability and expands on
it by adding the notion of automatic resource management.

Q18: What is the difference between Monolithic, SOA and


Microservices Architecture? ☆☆☆

Topics: Microservices Software Architecture SOA

Answer:

Page 5 of 7
FullStack.Cafe - Kill Your Tech Interview

Monolithic Architecture is similar to a big container wherein all the software components of an application
are assembled together and tightly packaged.
A Service-Oriented Architecture is a collection of services which communicate with each other. The
communication can involve either simple data passing or it could involve two or more services coordinating
some activity.
Microservice Architecture is an architectural style that structures an application as a collection of small
autonomous services, modeled around a business domain.

Q19: WebSockets vs Rest API for real time data? Which to choose?
☆☆☆

Topics: API Design Software Architecture WebSockets REST & RESTful

Problem:

I need to constantly access a server to get real time data of financial instruments. The price is constantly
changing so I need to request new prices every 0.5 seconds. Which kind if API would you recommend?

Solution:

The most efficient operation for what you're describing would be to use a webSocket connection between client
and server and have the server send updated price information directly to the client over the webSocket ONLY
when the price changes by some meaningful amount or when some minimum amount of time has elapsed and
the price has changed.

Here's a comparison of the networking operations involved in sending a price change over an already open
webSocket vs. making a REST call.

webSocket

1. Server sees that a price has changed and immediately sends a message to each client.
2. Client receives the message about new price.

Rest/Ajax

1. Client sets up a polling interval


2. Upon next polling interval trigger, client creates socket connection to server
3. Server receives request to open new socket
4. When connection is made with the server, client sends request for new pricing info to server
5. Server receives request for new pricing info and sends reply with new data (if any).
6. Client receives new pricing data
7. Client closes socket
8. Server receives socket close

As you can see there's a lot more going on in the Rest/Ajax call from a networking point of view because a new
connection has to be established for every new call whereas the webSocket uses an already open call. In
addition, in the webSocket cases, the server just sends the client new data when new data is available - the
client doens't have to regularly request it.

A webSocket can also be faster and easier on your networking infrastructure simply because fewer network
operations are involved to simply send a packet over an already open webSocket connection versus creating a
new connection for each REST/Ajax call, sending new data, then closing the connection. How much of a
difference/improvement this makes in your particular application would be something you'd have to measure to
really know.

Page 6 of 7
FullStack.Cafe - Kill Your Tech Interview

Q20: What does program to interfaces, not implementations


mean? ☆☆☆

Topics: Design Patterns Software Architecture

Answer:

Coding against interface means, the client code always holds an Interface object which is supplied by a
factory.

Any instance returned by the factory would be of type Interface which any factory candidate class must have
implemented. This way the client program is not worried about implementation and the interface signature
determines what all operations can be done.

This approach can be used to change the behavior of a program at run-time. It also helps you to write far better
programs from the maintenance point of view.

Page 7 of 7

You might also like