Advanced_enterprise_general Flashcards

1
Q

What is n-tier (or multi-tier) architecture?

A
  • N-tier architecture is a software design approach where an application is divided into multiple layers or tiers, each responsible for specific functions, such as presentation, business logic, and data access.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are microservices? Advantages and disadvantages?

A
  • Microservices are a specific architectural style where a software system is built as a collection of separate services, each running as its own independent application. These services are designed to do specific tasks and communicate with each other through well-defined APIs, often over networks. Advantages include scalability and flexibility, while challenges may include complexity in management.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Separation of Concerns?

A
  • Separation of Concerns refers to the practice of breaking down the functionality of a software system into distinct and independent parts, often referred to as concerns. These concerns address specific aspects of the system’s behavior, like data storage, business logic, user interface, etc. Separation of concerns is a design principle that aims to make the codebase more manageable by isolating different responsibilities from each other.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a layered design and why is it important in enterprise applications?

A
  • Layered design organizes an application into distinct layers (e.g., presentation, business logic, data access). It improves maintainability, scalability, and enables changes to one layer without affecting others.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Dependency Injection?

A
  • Dependency Injection is a design pattern in which the components of a system receive their dependencies (e.g., services or objects) from external sources rather than creating them internally.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the DAO pattern? When and how to implement?

A
  • The DAO (Data Access Object) pattern separates data access logic from the rest of the application. It’s used to encapsulate interactions with a data source (e.g., a database). Implement it when you want to abstract data access and decouple it from the business logic.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is SOA? When to use?

A
  • SOA (Service-Oriented Architecture) is an architectural style that focuses on organizing software as a collection of services that communicate with each other. Use SOA when you need modular, reusable, and loosely-coupled services in your system.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are unit test, integration test, system test, regression test, acceptance test? What is the major difference between these?

A
  • Unit Test: Tests individual components or functions.
  • Integration Test: Tests interactions between components.
  • System Test: Tests the entire system.
  • Regression Test: Ensures new changes don’t break existing functionality.
  • Acceptance Test: Validates if the system meets the user’s requirements.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is code coverage? Why is it used? How you can measure?

A
  • Code coverage measures the percentage of code that is executed during testing. It’s used to assess the thoroughness of testing. It’s measured using tools that analyze which parts of the code were executed during test runs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does mocking mean? How would you do it ‘manually’ (i. e. without using any fancy framework)?

A
  • Mocking involves creating simulated versions of objects or components to isolate the unit being tested. To do it manually, you’d create simple “fake” objects or functions that mimic the behavior of the real components without relying on external frameworks.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a test case? What is an assertion? Give examples!

A

A test case is a specific scenario or condition you test to verify the behavior of a component. An assertion is a statement that checks whether the expected outcome of a test case matches the actual outcome. Example:
- Test case: Validate user login.
- Assertion: The user should be authenticated and directed to the dashboard.

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

What is TDD? What are the benefits?

A
  • TDD (Test-Driven Development) is a development approach where tests are written before the actual code. Benefits include improved code quality, faster development, and increased confidence in the system’s behavior.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the unit testing best practices? (Eg. how many assertion should a test case contain?)

A
  • Test a single unit (function or method) in isolation.
  • Keep tests independent and isolated from each other.
  • Test boundary conditions and edge cases.
  • Use meaningful test names.
  • Aim for one logical assertion per test case.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is arrange/act/assert pattern?

A

The Arrange-Act-Assert (AAA) pattern is a structure for writing unit tests.

  • Arrange: Set up the test by initializing objects and preparing the environment.
  • Act: Perform the action you’re testing.
  • Assert: Verify that the action’s outcome matches the expected result.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is continuous integration? Why is CI important?

A
  • Continuous Integration (CI) is the practice of frequently integrating code changes into a shared repository. It’s essential because it helps catch integration issues early, improves collaboration, and enables automated testing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why are tests important in the CI workflow?

A
  • Tests are crucial in the CI workflow because they ensure that code changes don’t introduce regressions or break existing functionality. Automated tests help catch issues before they reach production.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Name some software that help the CI workflow!

A
  • Popular CI/CD tools include Jenkins, Travis CI, CircleCI, GitLab CI/CD, and GitHub Actions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is Continuous Delivery?

A
  • Continuous Delivery is the practice of automatically deploying code changes to a staging or production environment after passing automated tests and reviews.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is Continuous Deployment?

A
  • Continuous Deployment is an extension of Continuous Delivery where code changes are automatically deployed to production after passing tests without manual intervention.
20
Q

What is DevOps?

A
  • DevOps is a set of practices, principles, and cultural philosophies that aim to improve collaboration and communication between development (Dev) and IT operations (Ops) teams in order to streamline and accelerate the software delivery lifecycle. The primary goal of DevOps is to enable organizations to deliver high-quality software more quickly, reliably, and efficiently.
21
Q

What kind of software-lifecycle models do you know?

A
22
Q

What is a UML diagram? What kind of diagram types do you know?

A
  • UML (Unified Modeling Language) diagrams are visual representations used for designing and documenting software systems.
  • I know class diagrams
23
Q

What is a UML class diagram? What are the typical elements?

A
  • A UML class diagram shows the classes in a system and the relationships between them. Elements include classes, attributes, methods, associations, inheritance, and multiplicity.
24
Q

What kind of design patterns do you know? Bring at least 3 examples.

A
  • Singleton
  • Factory
  • Observer
  • Iterator
25
Q

What is the purpose of the Iterator Pattern?

A
  • The Iterator Pattern provides a way to access elements of a collection without exposing its underlying representation, allowing traversal through the collection’s elements.
26
Q

What do you know about the SOLID principles?

A

SOLID is an acronym representing five design principles for creating maintainable and extensible software:

  • Single Responsibility Principle (SRP)
  • Open/Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
  • Dependency Inversion Principle (DIP)
27
Q

How would you separate data storage code and business logic code (which uses stored data) in an application?

A
  • Using design patterns like the Repository Pattern to encapsulate data storage code. The business logic should interact with the repository interface, allowing for flexible and testable data access while keeping it separate from the business logic.
28
Q

What is the difference between Stack and Queue data structure?

A
  • Stack: A stack is a linear data structure that follows the Last In First Out (LIFO) principle. Elements are added and removed from the top.
  • Queue: A queue is a linear data structure that follows the First In First Out (FIFO) principle. Elements are added at the rear (back) and removed from the front (head).
29
Q

What is a graph? What are simple graphs? What are directed graphs? What are weighted graphs?

A
  • Graph: A graph is a collection of nodes (vertices) and edges that connect pairs of nodes. It’s used to represent relationships between different entities.
  • Simple Graph: A simple graph is a graph where each pair of distinct nodes is connected by at most one edge.
  • Directed Graph: In a directed graph (or digraph), edges have a direction, meaning they go from one node to another.
  • Weighted Graph: A weighted graph assigns a weight or cost to each edge, representing some value associated with traversing that edge.
30
Q

What are trees? What are binary trees? What are binary search trees?

A
  • Tree: A tree is a hierarchical data structure with a root node and subtrees of child nodes. It does not contain
    cycles.
  • Binary Tree: A binary tree is a type of tree in which each node has at most two children, referred to as the
    left child and the right child.
  • Binary Search Tree (BST): A binary search tree is a binary tree where for each node, all nodes in the left
    subtree have values less than the node’s value, and all nodes in the right subtree have values greater than the node’s value.
31
Q

How can you store graphs in programs? What are the advantages/disadvantages per each?

A

Graphs can be stored in programs using various data structures, including adjacency matrices (2D arrays), adjacency
lists (arrays/lists of neighbors for each node), and edge lists (list of edges).
- Advantages of Adjacency Matrix: Constant time to check if there’s an edge between two nodes. Suitable for dense graphs.
- Disadvantages of Adjacency Matrix: Consumes more memory for sparse graphs. Inefficient for large graphs.
- Advantages of Adjacency List: Efficient memory usage for sparse graphs. Faster for traversing neighbors.
- Disadvantages of Adjacency List: Slower edge existence checks compared to matrices.

32
Q

What are graph traversal algorithms? What is BFS, how does it work? What is DFS, how does it work?

A

Graph traversal algorithms are techniques used to systematically visit all the nodes or vertices of a graph, navigating through its edges according to a certain strategy.

  • BFS (Breadth-First Search): BFS explores all nodes at the current depth level before moving to the next level. It uses a queue data structure.
  • DFS (Depth-First Search): DFS explores as far as possible along one branch before backtracking. It uses a stack (or recursion).
33
Q

How does dictionary work?

A
  • A dictionary, often referred to as a hashmap or associative array, is a data structure that stores key-value pairs. It uses a hash function to map keys to indices in an underlying array, allowing for efficient retrieval and storage of values based on their keys.
34
Q

Why is it important for keys in a hashmap to have an immutable type? (Consider string for example.)

A
  • Immutable keys are important in a hashmap to ensure the stability of the key’s hash value. If the key could change after being inserted, the hashmap could lose track of the value’s location, making retrieval impossible. Immutable keys guarantee that the hash value remains consistent.
35
Q

What is QuickSort? Describe the main logic of this sorting algorithm.

A
  • QuickSort is a popular sorting algorithm that follows the divide-and-conquer strategy:
  1. Choose a pivot element.
  2. Partition the array into two subarrays: elements less than the pivot and elements greater than the pivot.
  3. Recursively sort the subarrays.
  4. Combine the sorted subarrays and the pivot to get the final sorted array.
36
Q

What is OAuth2?

A
  • OAuth2 is an authorization framework that allows third-party applications to access a user’s data without exposing their credentials. It provides a secure way for users to grant limited access to their resources on one site (resource server) to another site (client application).
37
Q

What is Basic Authentication?

A
  • Basic Authentication is a simple authentication mechanism where the user’s credentials (username and password) are encoded and sent as a header in each request. It’s not very secure on its own, as credentials can be easily intercepted.
38
Q

What is CORS, why it’s needed in browsers?

A
  • CORS is a security feature implemented by web browsers to control which origins are allowed to access resources from a different origin. It prevents unauthorized cross-origin requests, thus enhancing web security.
39
Q

How can you initialize a CSRF attack?

A
  • CSRF is an attack where a malicious website tricks a user’s browser into making an unintended request to a different site where the user is authenticated. This can lead to unauthorized actions being performed on the victim’s behalf.
40
Q

What is JWT used for? Where to store it on client side?

A
  • JWT is a compact, URL-safe means of representing claims between two parties. It’s often used for authentication and information exchange. JWTs can be stored on the client side, typically in cookies or local storage.
41
Q

When do you need to use threads in an application?

A
  • Threads are used in applications to achieve concurrent execution of tasks, allowing multiple parts of a program to run simultaneously and improve overall performance and responsiveness.
42
Q

What is a daemon thread?

A
  • A daemon thread is a thread that runs in the background, providing services to other threads without preventing the program from exiting if only daemon threads are running.
43
Q

What is the difference between concurrent and parallel execution of code?

A
  • Concurrent Execution: Multiple tasks are being executed in overlapping time intervals, but not necessarily simultaneously.
  • Parallel Execution: Multiple tasks are executed simultaneously, often utilizing multiple processors or cores.
44
Q

What is the most important problem developers are faced when using threads?

A
  • The most important challenge when using threads is ensuring proper synchronization and coordination to avoid issues like data races, deadlocks, and inconsistent states.
45
Q

In what kind of situations can deadlocks occur?

A
  • Deadlocks occur when two or more threads are unable to proceed because each is waiting for the other to release a resource.
46
Q

What are possible ways to prevent deadlocks from occurring?

A
  • Using a single lock hierarchy.
  • Employing timeouts for acquiring locks.
  • Using deadlock detection algorithms.
47
Q

What does critical section or critical region mean in the context of concurrent programming?

A
  • A critical section (or critical region) is a part of the code where shared resources are accessed, and only one thread should access it at a time. Proper synchronization mechanisms are used to ensure mutual exclusion and prevent data corruption.