Interview Study Flashcards

1
Q

CAP Theorom

A

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)

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

REST

A

REpresentational State Transfer.

REST Server simply provides access to resources and REST client accesses and presents the resources.

No State, every request can be made independently

HTTP protocol.

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

REST Operations

A

GET, POST, PUT, DELETE, OPTIONS, HEAD

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

Difference PUT and POST

A

PUT is idempotent meaning, invoking it any number of times will not have an impact on resources.

However, POST is not idempotent, meaning if you invoke POST multiple times it keeps creating more resources

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

What are NoSQL databases? What are the different types of NoSQL databases?

A

A NoSQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases (like SQL, Oracle, etc.).

Types of NoSQL databases:

Document Oriented
Key Value
Graph
Column Oriented

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

What is SQL injection?

A

SQL injection is one of the most common types of injection attack. To carry it out, an attacker provides malicious SQL statements through the application.

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

Prevent SQL Injection?

A

Prepared statements with parameterized queries

Stored procedures

Input validation - blacklist validation and whitelist validation

Principle of least privilege - Application accounts shouldn’t assign DBA or admin type access onto the database server. This ensures that if an application is compromised, an attacker won’t have the rights to the database through the compromised application

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

What is meant by Continuous Integration?

A

Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.

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

Difference between acceptance test and functional test?

A

Functional testing: This is a verification activity; did we build a correctly working product? Does the software meet the business requirements? A functional test verifies that the product actually works as you (the developer) think it does.

Acceptance testing: This is a validation activity; did we build the right thing? Is this what the customer really needs? Acceptance tests verify the product actually solves the problem it was made to solve. This can best be done by the user (customer), for instance performing his/her tasks that the software assists with.

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

Name some performance testing steps

A
Identify the testing environment
Identify performance metrics
Plan and design performance tests
Configure the test environment
Implement your test design
Execute tests
Analyze, report, retest
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are some advantages of using Go?

A

It is possible to compile a large Go program in a few seconds on a single computer.

Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.

Go’s type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types, the language attempts to make types feel lighter weight than in typical OO languages.

Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.

By its design, Go proposes an approach for the construction of system software on multicore machines.

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

What are the advantages of Web Services?

A

Interoperability: Web services are accessible over network and runs on HTTP/SOAP protocol and uses XML/JSON to transport data, hence it can be developed in any programming language. Web service can be written in java programming and client can be PHP and vice versa.

Reusability: One web service can be used by many client applications at the same time.

Loose Coupling: Web services client code is totally independent with server code, so we have achieved loose coupling in our application.

Easy to deploy and integrate, just like web applications.

Multiple service versions can be running at same time.

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

What does Containerization mean?

A

Containerisation is a type of virtualization strategy that emerged as an alternative to traditional hypervisor-based virtualization.

In containerization, the operating system is shared by the different containers rather than cloned for each virtual machine. For example Docker provides a container virtualization platform that serves as a good alternative to hypervisor-based arrangements.

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

Why Would You Opt For Microservices Architecture?

A

Microservices can adapt easily to other frameworks or technologies.

Failure of a single process does not affect the entire system.

Provides support to big enterprises as well as small teams.

Can be deployed independently and in relatively less time.

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

What Do You Mean By High Availability (HA)?

A

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.

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

What Is ACID Property Of A System?

A

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.

17
Q

Disadvantages of REST

A

Since there is no contract defined between service and client, it has to be communicated through other means such as documentation or emails.

Since it works on HTTP, there can’t be asynchronous calls.

Sessions can’t be maintained.

18
Q

Don’t Repeat Yourself (DRY)

A

duplication in logic should be eliminated via abstraction; duplication in process should be eliminated via automation. Duplication is Waste.

19
Q

What are the difference between Clustered and a Non-clustered index?

A

With a Clustered index the rows are stored physically on the disk in the same order as the index. Therefore, there can be only one clustered index. A clustered index means you are telling the database to store close values actually close to one another on the disk.

With a Non Clustered index there is a second list that has pointers to the physical rows. You can have many non clustered indices, although each new index will increase the time it takes to write new records.

It is generally faster to read from a clustered index if you want to get back all the columns. You do not have to go first to the index and then to the table.

Writing to a table with a clustered index can be slower, if there is a need to rearrange the data.

20
Q

Define continuous delivery

A

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.

21
Q

Define Continuous Deployment

A

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.

22
Q

What is Monolithic Architecture?

A

Monolithic Architecture is similar to a big container wherein all the software components of an application are assembled together and tightly packaged.

23
Q

Service-Oriented Architecture

A

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.

24
Q

Define Microservice Architecture

A

Microservice Architecture is an architectural style that structures an application as a collection of small autonomous services, modeled around a business domain.

25
Q

What is the difference between JOIN and UNION?

A

UNION puts lines from queries after each other, while JOIN makes a cartesian product and subsets it – completely different operations.

26
Q

What is the difference between WHERE clause and HAVING clause?

A

HERE clause introduces a condition on individual rows; HAVING clause introduces a condition on aggregations, i.e. results of selection where a single result, such as count, average, min, max, or sum, has been produced from multiple rows. Your query calls for a second kind of condition (i.e. a condition on an aggregation) hence HAVING works correctly.

27
Q

What is a reverse proxy?

A

A reverse proxy is a type of proxy that retrieves data from one or more servers on behalf of a client. This data is then returned to the client appearing as if it originated from the reverse proxy server itself. A reverse proxy is often used to balance the load.

28
Q

Explain what the API Gateway pattern means?

A

An API Gateway is a server that is the only possible entry point to the system. It is similar to the Facade pattern from object-oriented design. API Gateway encapsulates the architecture of the entire system and provides an API that is already adapted for each client. This API can also have other functions such as authentication, caching, monitoring, and load balancing

29
Q

What are the benefits of using B-trees index?

A

Such indexes save a lot of time, because look-ups, deletions, and insertions can all be done in logarithmic time. Also, the data that is stored inside B-trees can be easily sorted.

30
Q

What’s the difference between faking, mocking, and stubbing?

A

Fake objects have working implementations but will require a reduction, which makes them unusable for production.

Stubs are standard responses to calls made during a test. They can also record call information, such as an email gateway stub that remembers the messages it ‘sent “.

Mocks are objects with preprogrammed expectations that shape the specifics of the call.

31
Q

When to use Redis?

A

Redis is an in-memory, persistent data structure store that should be used to enable the performance of common operations with minimal complexity and maximum performance.

32
Q

When to use Mongo?

A

MongoDB is a document-oriented, disk-based database that should be used for ensuring operational simplicity, creating a schema-free design, and processing very large data volumes.

33
Q

Give examples of the mitigation tactics you’d use for various types of API attacks.

A

Injection: I’d validate and sanitize all data in API requests as well as limit response data to prevent the unintentional leakage of sensitive data.

Cross-Site Scripting (XSS): I’d validate input as well as use character escaping and filtering.

Distributed Denial-of-Service (DDoS): I’d limit the number of requests and payload size.

Man-in-the-Middle (MitM): I’d encrypt traffic in transit.

34
Q

What is the difference between software architecture and software design?

A

Software design is about designing individual modules/components.

Software architecture is about the complete architecture of the overall system.

35
Q

Define “stack” and “heap.” What is a stack overflow?

A

A stack is a special area of computer’s memory which stores temporary variables created by a function. In stack, variables are declared, stored and initialized during runtime.

It is a temporary storage memory. When the computing task is complete, the memory of the variable will be automatically erased. The stack section mostly contains methods, local variable, and reference variables.

The heap is a memory used by programming languages to store global variables. By default, all global variable are stored in heap memory space. It supports Dynamic memory allocation.

The heap is not managed automatically for you and is not as tightly managed by the CPU. It is more like a free-floating region of memory.

36
Q

What do “high cohesion” and “loose coupling” mean?

A

Coupling means to what extent various modules are interdependent and how the other modules are affected on changing some/considerable functionality of a module.

Low coupling is emphasized as the dependency has to be maintained low so that very least/negligible changes are made to other modules.

37
Q

What are the pros and cons of holding domain logic in stored procedures?

A

Pros:

One place to contain all of the business logic

Possibly faster applications because multiple SQL queries and such can be performed in one “round trip” to the database

Trivial to make use of the stored procedures from multiple applications

CONS:

A DBA will be required for performance tuning

All developers will have to be very well versed in your particular SQL dialect(T-SQL, Pl/SQL, etc)

SQL code isn’t as expressive and thus harder to write when covering higher level concepts that aren’t really related to data
A lot more unnecessary load on the database

38
Q

When use anon functions

A

Single use methods are a perfect example of when to use this principle! It’s also very useful when you are planning to use the method straight away, or inside an if statement or a for loop.