跳转至

45 Solution Architect Interview Questions

Excerpt

A solution architect is the person in charge of leading the practice and introducing the overall technical vision for a particular solution and an Average Solutions Architect Salary in Australia is AU$130K. Follow along and check 45 most commonly asked Software Architect Interview Questions and Answers for experienced developers to know before your next senior technical interview.

: What Is 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.


: Explain the difference between Asynchronous and Parallel programming?

Answer

When you run something asynchronously it means it is non-blocking, you execute it without waiting for it to complete and carry on with other things. Parallelism means to run multiple things at the same time, in parallel. Parallelism works well when you can separate tasks into independent pieces of work. Async and Callbacks are generally a way (tool or mechanism) to express concurrency i.e. a set of entities possibly talking to each other and sharing resources.

Take for example rendering frames of a 3D animation. To render the animation takes a long time so if you were to launch that render from within your animation editing software you would make sure it was running asynchronously so it didn't lock up your UI and you could continue doing other things. Now, each frame of that animation can also be considered as an individual task. If we have multiple CPUs/Cores or multiple machines available, we can render multiple frames in parallel to speed up the overall workload.


: What Is Scalability?

Answer

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.


: What are the advantages of NoSQL over traditional RDBMS?

Answer

NoSQL is better than RDBMS because of the following reasons/properities of NoSQL:

  • It supports semi-structured data and volatile data
  • It does not have schema
  • Read/Write throughput is very high
  • Horizontal scalability can be achieved easily
  • Will support Bigdata in volumes of Terra Bytes & Peta Bytes
  • Provides good support for Analytic tools on top of Bigdata
  • Can be hosted in cheaper hardware machines
  • In-memory caching option is available to increase the performance of queries
  • Faster development life cycles for developers

Still, RDBMS is better than NoSQL for the following reasons/properties of RDBMS:

  • Transactions with ACID properties - Atomicity, Consistency, Isolation & Durability
  • Adherence to Strong Schema of data being written/read
  • Real time query management ( in case of data size < 10 Tera bytes )
  • Execution of complex queries involving join & group by clauses

: What do you mean by lower latency interaction?

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.

: What does the expression “Fail Early” mean, and when would you want to do so?

Answer

Essentially, fail fast (a.k.a. fail early) is to code your software such that, when there is a problem, the software fails as soon as and as visibly as possible, rather than trying to proceed in a possibly unstable state.

Fail Fast approach won’t reduce the overall number of bugs, at least not at first, but it’ll make most defects much easier to find.


: What is Domain Driven Design?

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.


: What is meant by the KISS principle?

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.

: Why Do You Need Clustering?

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.


: Define ACID Properties

Answer

  • Atomicity: It ensures all-or-none rule for database modifications.
  • Consistency: Data values are consistent across the database.
  • Isolation: Two transactions are said to be independent of one another.
  • Durability: Data is not lost even at the time of server failure.

: Explain Deadlock to 5 years old

Answer

Jack and Jill share a sparse kitchen that has only one of everything. They both want to make a sandwich at the same time. Each needs a slice of bread and each needs a knife, so they both go to get the loaf of bread and the knife from the kitchen.

Jack gets the knife first, while Jill gets the loaf of bread first. Now Jack tries to find the loaf of bread and Jill tries to find the knife, but both find that what they need to finish the task is already in use. If they both decide to wait until what they need is no longer in use, they will wait for each other forever. Deadlock.


: Explain the Single Responsibility Principle (SRP)?

Answer

Single responsibility is the concept of a Class doing one specific thing (responsibility) and not trying to do more than it should, which is also referred to as High Cohesion.

Classes don't often start out with Low Cohesion, but typically after several releases and different developers adding onto them, suddenly you'll notice that it became a monster or God class as some call it. So the class should be refactored.


: Is there any difference between a Binary Semaphore and Mutex?

Answer

  • A mutex (or Mutual Exclusion Semaphores) is a locking mechanism used to synchronize access to a resource. Only one task (can be a thread or process based on OS abstraction) can acquire the mutex. It means there will be ownership associated with mutex, and only the owner can release the lock (mutex).

  • Semaphore (or Binary Semaphore) is signaling mechanism (“I am done, you can carry on” kind of signal). For example, if you are listening songs (assume it as one task) on your mobile and at the same time your friend called you, an interrupt will be triggered upon which an interrupt service routine (ISR) will signal the call processing task to wakeup. A binary semaphore is NOT protecting a resource from access. Semaphores are more suitable for some synchronization problems like producer-consumer.

Short version:

  • A mutex can be released only by the thread that had acquired it.
  • A binary semaphore can be signaled by any thread (or process).

: What Do You Mean By High Availability (HA)?

Answer

Availability means the ability of the application user to access the system, If a user cannot access the application, it is assumed unavailable. High Availability means the application will be available, without interruption. Using redundant server nodes with clustering is a common way to achieve higher level of availability in web applications.

Availability is commonly expressed as a percentage of uptime in a given year.


: What Is ACID Property Of A System?

Answer

ACID is a acronym which is commonly used to define the properties of a relational database system, it stand for following terms

  • Atomicity - This property guarantees that if one part of the transaction fails, the entire transaction will fail, and the database state will be left unchanged.
  • Consistency - This property ensures that any transaction will bring the database from one valid state to another.
  • Isolation - This property ensures that the concurrent execution of transactions results in a system state that would be obtained if transactions were executed serially.
  • Durable - means that once a transaction has been committed, it will remain so, even in the event of power loss.

: What Is Sticky Session Load Balancing? What Do You Mean By "Session Affinity"?

Answer

Sticky session or a session affinity technique is another popular load balancing technique that requires a user session to be always served by an allocated machine.

In a load balanced server application where user information is stored in session it will be required to keep the session data available to all machines. This can be avoided by always serving a particular user session request from one machine. The machine is associated with a session as soon as the session is created. All the requests in a particular session are always redirected to the associated machine. This ensures the user data is only at one machine and load is also shared.

This is typically done by using SessionId cookie. The cookie is sent to the client for the first request and every subsequent request by client must be containing that same cookie to identify the session.

What Are The Issues With Sticky Session?

There are few issues that you may face with this approach

  • The client browser may not support cookies, and your load balancer will not be able to identify if a request belongs to a session. This may cause strange behavior for the users who use no cookie based browsers.
  • In case one of the machine fails or goes down, the user information (served by that machine) will be lost and there will be no way to recover user session.

: What are the DRY and DIE principles?

Answer

In software engineering, Don't Repeat Yourself (DRY) or Duplication is Evil (DIE) is a principle of software development.


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

Answer

S.O.L.I.D is an acronym for the first five object-oriented design (OOD) principles by Robert C. Martin.

  • 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.

: What does program to interfaces, not implementations mean?

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.


: What does it mean "System Shall Be Resilient"?

Answer

System is Resilient if it stays responsive in the face of failure. This applies not only to highly-available, mission critical systems — any system that is not resilient will be unresponsive after a failure.

Resilience is achieved by:

  • replication,
  • containment,
  • isolation and
  • delegation.

Failures are contained within each component, isolating components from each other and thereby ensuring that parts of the system can fail and recover without compromising the system as a whole. Recovery of each component is delegated to another (external) component and high-availability is ensured by replication where necessary. The client of a component is not burdened with handling its failures.


: What does the CAP Theorem actually say?

Answer

The CAP Theorem says that it is impossible to build an implementation of read-write storage/system in an asynchronous network that satisfies all of the following three properties:

  • Availability - will a request made to the data store always eventually complete?
  • Consistency - will all executions of reads and writes seen by all nodes be atomic or linearizably consistent?
  • Partition tolerance - the network is allowed to drop any messages.

More informally, the CAP theorem tells us that we can't build a database/system that both responds to every request and returns the results that you would expect every time.


: What is Elasticity (in contrast to Scalability)?

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.

: What is the difference between Concurrency and Parallelism?

Answer

  • Concurrency is when two or more tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean they'll ever both be running at the same instant. For example, multitasking on a single-core machine.

  • Parallelism is when tasks literally run at the same time, e.g., on a multicore processor.

For instance a bartender is able to look after several customers while he can only prepare one beverage at a time. So he can provide concurrency without parallelism.


: What is the difference between Monolithic, SOA and Microservices Architecture?

Answer

  • 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.

: When should I use a NoSQL database instead of a relational database?

Answer

Relational databases enforces ACID. So, you will have schema based transaction oriented data stores. It's proven and suitable for 99% of the real world applications. You can practically do anything with relational databases.

But, there are limitations on speed and scaling when it comes to massive high availability data stores. For example, Google and Amazon have terabytes of data stored in big data centers. Querying and inserting is not performant in these scenarios because of the blocking/schema/transaction nature of the RDBMs. That's the reason they have implemented their own databases (actually, key-value stores) for massive performance gain and scalability.

If you need a NoSQL db you usually know about it, possible reasons are:

  • client wants 99.999% availability on a high traffic site.
  • your data makes no sense in SQL, you find yourself doing multiple JOIN queries for accessing some piece of information.
  • you are breaking the relational model, you have CLOBs that store denormalized data and you generate external indexes to search that data.

: Compare "Fail Fast" vs "Robust" approaches of building software

Answer

: Could you provide an example of the Single Responsibility Principle?

Answer

: Two customers add a product to the basket in the same time whose the stock was only one (1). What will you do?

Answer

: What Is Sharding?

: What is GOD class and why should we avoid it?

Answer

: What is Starvation?

Answer

: What is BASE property of a system?

Answer

: What is Unit test, Integration Test, Smoke test, Regression Test and what are the differences between them?

Answer

: What's the difference between Deadlock and Livelock?

Answer

: What's the difference between principles YAGNI and KISS?

Answer

: Why layering your application is important? Provide some bad layering example.

Answer

: Why should you structure your solution by components?

Answer

: Are you familiar with The Twelve-Factor App principles?

Answer

: Cache miss-storm: Dealing with concurrency when caching invalidates for high-traffic sites

Answer

: What Does Eventually Consistent Mean?

Answer

: What Is Shared Nothing Architecture? How Does It Scale?

Answer

: What are heuristic exceptions?

Answer

: What does Amdahl's Law mean?

Answer

: What is the difference between Cohesion and Coupling?

Answer

: What is the most accepted transaction strategy for microservices?

Answer

Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...

Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...

Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...

Cosmos DB has gained popularity among developers and organizations across various industries, including finance, e-commerce, gaming, IoT, and more. Follow along and learn the 24 most common and advanced Azure Cosmos DB interview questions and answers...

More than any other NoSQL database, and dramatically more than any relational database, MongoDB's document-oriented data model makes it exceptionally easy to add or change fields, among other things. It unlocks Iteration on the project. Iteration f...

Unit Tests and Test Driven Development (TDD) help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outpu...

Domain-Driven Design is nothing magical but it is crucial to understand the importance of Ubiquitous Language, Domain Modeling, Context Mapping, extracting the Bounded Contexts correctly, designing efficient Aggregates and etc. before your next DDD p...

At its core, Microsoft Azure is a public cloud computing platform - with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual c...

As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Follow along to refresh your knowledge and explore the 52 most frequently asked and advanced Node JS Interview Questions and Answers every...

Dependency Injection is most useful when you're aiming for code reuse, versatility and robustness to changes in your problem domain. DI is also useful for decoupling your system. DI also allows easier unit testing without having to hit a database and...

捐赠本站(Donate)

weixin_pay
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))