questions Flashcards

1
Q

What is scalability?

A

The property of a system to handle a growing amount of work by adding resources to the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is clustering and what’s its purpose?

A

A system of interconnected nodes that by working together help in executing an application - helps handle load balancing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name the differences between object-oriented and component-based design.

A

Object-oriented programming focuses on the relationships between classes that are combined into one large binary executable, while component-oriented programming focuses on interchangeable code modules that work independently and don’t require you to be familiar with their inner workings to use them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is session replication?

A

Session replication is a mechanism used to replicate the data stored in a session across different instances. However, the replicated instance must be part of the same cluster. When session replication is enabled in a cluster environment, the entire session data is copied on a replicated instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the best way to pass configuration variables to applications?

A

Imo, config file as it is committable, but command line is possible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Walk me through the process of gathering system requirements.

A

Write out usecases and divide them into the two types of requirements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 2 types of requirements?

A

Functional - capabilities, usability, features, and operations as they relate to the intended purpose of the product
Non-functional - Tends to be more technical in application, performance, stability, security and technical specifications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How would you design a payment processing system?

A
  • Front end system takes customer payment
  • Create record for customer payment to handle payment status
  • Front end system drops a message on the payment queue referencing newly created db record as well as any additional payment details
  • If anything fails for this or previous step, notify user
  • Async processor pulls from queue processing individual payment tasks. This is typically done via 3rd parties (such as Visa)
  • If any of these steps fail notify user (typically via e-mail).
  • If it passes, payment succeeds - continue to next step in business flow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a distributed system?

A

A distributed system in its most simplest definition is a group of computers working together as to appear as a single computer to the end-user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does idempotent mean?

A

idempotence refers to the ability of a system to produce the same outcome, even if the same file, event or message is received more than once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is crash-tolerance?

A

This means that the data service’s daemon processes must be relatively stateless, in that they write all updates to disk synchronously. Aka- the ability for a system to continue working if one of the components fail

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does “program to interfaces, not implementations” mean?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the differences between continuous integration, continuous delivery, and continuous deployment?

A

Developers practicing continuous integration merge their changes back to the main branch as often as possible. By doing so, you avoid the integration hell that usually happens when people wait for release day to merge their changes into the release branch.
Continuous delivery is an extension of continuous integration to make sure that you can release new changes to your customers quickly in a sustainable way. This means that on top of having automated your testing, you also have automated your release process and you can deploy your application at any point of time by clicking on a button.
Continuous deployment goes one step further than continuous delivery. With this practice, every change that passes all stages of your production pipeline is released to your customers. There’s no human intervention, and only a failed test will prevent a new change to be deployed to production.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q3: What does SOLID stand for? What are its principles?

A
S - Single-responsiblity principle. A class should have one and only one reason to change, meaning that a class should have only one job.
O - Open-closed principle. Objects or entities should be open for extension, but closed for modification.
L - Liskov substitution principle. Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T.
I - Interface segregation principle. A client should never be forced to implement an interface that it doesn't use or clients shouldn't be forced to depend on methods they do not use.
D - Dependency Inversion Principle. Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What Is BASE Property Of A System?

A

Basically available indicates that the system is guaranteed to be available
Soft state indicates that the state of the system may change over time, even without input. This is mainly due to the eventually consistent model.
Eventual consistency indicates that the system will become consistent over time, given that the system doesn’t receive input during that time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What Is CAP Theorem?

A

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:

Consistency (all nodes see the same data even at the same time with concurrent updates )
Availability (a guarantee that every request receives a response about whether it was successful or failed)
Partition tolerance (the system continues to operate despite arbitrary message loss or failure of part of the system)
The CAP acronym corresponds to these 3 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. Its important to understand that only two of these three conditions can be guaranteed to be met by a system.

17
Q

The Twelve-Factor App principles?

A

Codebase - There should be exactly one codebase for a deployed service with the codebase being used for many deployments.
Dependencies - All dependencies should be declared, with no implicit reliance on system tools or libraries.
Config - Configuration that varies between deployments should be stored in the environment.
Backing services All backing services are treated as attached resources and attached and detached by the execution environment.
Build, release, run - The delivery pipeline should strictly consist of build, release, run.
Processes - Applications should be deployed as one or more stateless processes with persisted data stored on a backing service.
Port binding - Self-contained services should make themselves available to other services by specified ports.
Concurrency - Concurrency is advocated by scaling individual processes.
Disposability - Fast startup and shutdown are advocated for a more robust and resilient system.
Dev/Prod parity - All environments should be as similar as possible.
Logs - Applications should produce logs as event streams and leave the execution environment to aggregate.
Admin Processes - Any needed admin tasks should be kept in source control and packaged with the application.

18
Q

What are Heuristic Exceptions?

A

A Heuristic Exception refers to a transaction participant’s decision to unilaterally take some action without the consensus of the transaction manager, usually as a result of some kind of catastrophic failure between the participant and the transaction manager.

In a distributed environment communications failures can happen. If communication between the transaction manager and a recoverable resource is not possible for an extended period of time, the recoverable resource may decide to unilaterally commit or rollback changes done in the context of a transaction. Such a decision is called a heuristic decision. It is one of the worst errors that may happen in a transaction system, as it can lead to parts of the transaction being committed while other parts are rolled back, thus violating the atomicity property of transaction and possibly leading to data integrity corruption.

Because of the dangers of heuristic exceptions, a recoverable resource that makes a heuristic decision is required to maintain all information about the decision in stable storage until the transaction manager tells it to forget about the heuristic decision. The actual data about the heuristic decision that is saved in stable storage depends on the type of recoverable resource and is not standardized. The idea is that a system manager can look at the data, and possibly edit the resource to correct any data integrity problems.

19
Q

What Is Shared Nothing Architecture? How Does It Scale?

A

A shared nothing architecture (SN) is a distributed computing approach in which each node is independent and self-sufficient, and there is no single point of contention required across the system.

This means no resources are shared between nodes (No shared memory, No shared file storage)
The nodes are able to work independently without depending on each other for any work.
Failure on one node affects only the users of that node, however other nodes continue to work without any disruption.
This approach is highly scalable since it avoid the existence of single bottleneck in the system. Shared nothing is recently become popular for web development due to its linear scalability. Google has been using it for long time.

In theory, A shared nothing system can scale almost infinitely simply by adding nodes in the form of inexpensive machines.

20
Q

What Does Eventually Consistent Mean?

A

Unlike relational database property of Strict consistency, eventual consistency property of a system ensures that any transaction will eventually (not immediately) bring the database from one valid state to another. This means there can be intermediate states that are not consistent between multiple nodes.

Eventually consistent systems are useful at scenarios where absolute consistency is not critical. For example in case of Twitter status update, if some users of the system do not see the latest status from a particular user its may not be very devastating for system.

Eventually consistent systems can not be used for use cases where absolute/strict consistency is required. For example a banking transactions system can not be using eventual consistency since it must consistently have the state of a transaction at any point of time. Your account balance should not show different amount if accessed from different ATM machines.