Top 100 Technical Interview Questions Flashcards
What are design patterns?
Design patterns are reusable solutions to common software design problems.
Explain the Singleton pattern.
The Singleton pattern ensures a class has only one instance and provides a global point of access to that instance.
What is the Factory pattern?
The Factory pattern creates objects without specifying the exact class of object that will be created.
Describe the Observer pattern.
The Observer pattern defines a dependency between objects, so that when one object changes state, all its dependents are notified and updated automatically.
How does the Strategy pattern work?
The Strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable.
What is the Decorator pattern?
The Decorator pattern attaches additional responsibilities to an object dynamically.
Explain the Adapter pattern.
The Adapter pattern allows incompatible interfaces to work together by providing a wrapper with a compatible interface.
Describe the Template Method pattern.
The Template Method pattern defines the structure of an algorithm but allows subclasses to provide certain steps’ implementations.
What is the Command pattern?
The Command pattern turns a request into a stand-alone object, containing all information about the request.
Explain the Proxy pattern.
The Proxy pattern provides a surrogate or placeholder for another object to control access to it.
What is the Chain of Responsibility pattern?
The Chain of Responsibility pattern sends a request along a chain of handlers, where each handler decides whether to process the request or pass it along.
Describe the State pattern.
The State pattern allows an object to change its behavior when its internal state changes.
What is the Composite pattern?
The Composite pattern composes objects into tree structures to represent part-whole hierarchies.
Explain the Iterator pattern.
The Iterator pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Describe the Memento pattern.
The Memento pattern captures and restores an object’s internal state.
What does SOLID stand for?
SOLID stands for Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle.
Explain the Single Responsibility Principle (SRP).
SRP states that a class should have only one reason to change, i.e., it should have only one responsibility.
What is the Open-Closed Principle (OCP)?
OCP suggests that software entities should be open for extension but closed for modification.
Describe the Liskov Substitution Principle (LSP).
LSP states that objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.
What does the Interface Segregation Principle (ISP) state?
ISP states that clients should not be forced to depend on interfaces they don’t use.
Explain the Dependency Inversion Principle (DIP).
DIP states that high-level modules should not depend on low-level modules, both should depend on abstractions, and abstractions should not depend on details.
What is Dependency Injection (DI)?
DI is a design pattern that allows the creation of dependent objects outside of a class and provides them to the class through constructors, methods, or properties.
What is Inversion of Control (IoC)?
IoC is a principle where the control of an object’s lifecycle and dependencies are handed over to a container or framework.
Why is Dependency Injection beneficial?
DI promotes loose coupling, easier testing, and better maintainability by decoupling components and their dependencies.
Explain Constructor Injection.
Constructor Injection involves passing dependencies through a class’s constructor.
What is Property Injection?
Property Injection involves setting the dependencies through public properties on a class.
Describe Method Injection.
Method Injection involves passing dependencies as parameters to methods where they’re needed.
What is the role of an IoC container?
An IoC container manages the instantiation and injection of dependencies, following the IoC principle.
Name a few popular IoC containers in .NET.
Some examples include Unity, Autofac, Ninject, and StructureMap.
What is MVC (Model-View-Controller)?
MVC is a design pattern that separates an application into three interconnected components: Model, View, and Controller.
Explain the Model in MVC.
The Model represents the application’s data and business logic.
What is the View in MVC?
The View presents the data to the user and receives user input.
Describe the Controller in MVC.
The Controller handles user input, processes it, and updates the Model and View accordingly.
What is MVVM (Model-View-ViewModel)?
MVVM is a design pattern that separates an application into Model, View, and ViewModel components.
Explain the ViewModel in MVVM.
The ViewModel acts as an intermediary between the Model and the View, providing data and behavior for the View.
How does data binding work in MVVM?
Data binding automatically synchronizes the data between the ViewModel and the View, ensuring consistency.
What is a microservices architecture?
Microservices is an architectural style where an application is composed of loosely coupled, independently deployable services.
What are the advantages of microservices?
Advantages include scalability, independent deployment, technology diversity, and easier maintenance.
Describe the communication between microservices.
Microservices often communicate over lightweight protocols like HTTP/REST or messaging systems like RabbitMQ.
What are the challenges of microservices?
Challenges include managing distributed data, ensuring consistency, dealing with network latency, and monitoring complex systems.
How does microservices architecture relate to containers and orchestration?
Microservices are often deployed within containers (e.g., Docker) and orchestrated using tools like Kubernetes for efficient management.
What is software architecture?
Software architecture is the high-level structure and organization of a software system.
Explain the difference between monolithic and microservices architectures.
Monolithic architecture consists of a single codebase, while microservices architecture divides an application into smaller, independently deployable services.
What is the role of an architect in software development?
An architect designs the overall structure of the system, defines technical standards, and ensures that the design aligns with business goals.
Describe the concept of modularity in software design.
Modularity involves breaking down a system into smaller, self-contained units to improve maintainability and reusability.
What is coupling in software design?
Coupling refers to the degree of interdependence between different components or modules in a system.
Explain cohesion in software design.
Cohesion measures how closely the responsibilities of a module or component align with its intended functionality.
What is architectural scalability?
Architectural scalability refers to the ability of a system to handle increased load by adding more resources or components.
Describe the difference between horizontal and vertical scaling.
Horizontal scaling involves adding more machines to distribute load, while vertical scaling involves upgrading a single machine’s resources.
What are design anti-patterns?
Design anti-patterns are common mistakes or bad practices in software design that should be avoided.
Explain the concept of code maintainability.
Code maintainability refers to how easy it is to make changes to the codebase without introducing errors or negatively impacting the system.
What is technical debt?
Technical debt refers to the consequences of choosing a suboptimal solution in the short term, leading to increased effort required for maintenance or future improvements.
Describe the role of documentation in software architecture.
Documentation helps communicate design decisions, architecture, and usage of components to developers, stakeholders, and future maintainers.
What is a software design review?
A software design review is a formal evaluation of a system’s architecture and design to ensure they meet requirements and follow best practices.
Why is testing important in software development?
Testing helps identify defects, ensures the software meets requirements, and increases overall software quality.
Explain unit testing.
Unit testing involves testing individual components or functions in isolation to ensure they work as expected.
What is integration testing?
Integration testing verifies interactions between different components, ensuring they work together correctly.
Describe regression testing.
Regression testing involves retesting a system after changes to ensure that existing functionalities are not negatively impacted.
What is continuous integration (CI)?
CI is a practice of frequently integrating code changes into a shared repository, followed by automated builds and tests.
What is continuous delivery (CD)?
CD extends CI by automating the deployment process, allowing for frequent and reliable releases.
What is version control?
Version control is a system that tracks changes to files and helps teams collaborate on software development.
Explain the difference between Git and other version control systems.
Git is distributed, allowing developers to work offline and commit changes locally before syncing with a remote repository.
What is a repository in Git?
A repository is a storage location where a project’s files, history, and metadata are stored.
Describe the concepts of branching and merging in Git.
Branching allows developers to work on separate features or fixes, and merging combines those changes back into the main codebase.
What is a pull request in Git?
A pull request is a mechanism for submitting changes to a repository and initiating a review process before merging.
What is concurrency in software?
Concurrency is the ability of a system to handle multiple tasks simultaneously.
Explain the difference between threads and processes.
Threads are lighter-weight than processes and share the same memory space, while processes have their own memory space.
What is multithreading?
Multithreading is the concurrent execution of multiple threads within the same process.
What are the challenges of multithreading?
Challenges include race conditions, deadlocks, and synchronization issues.
Describe the purpose of locks and mutexes in multithreading.
Locks and mutexes are synchronization mechanisms used to prevent multiple threads from accessing shared resources simultaneously.
Why is software security important?
Software security is essential to protect sensitive data, prevent unauthorized access, and ensure the integrity of the system.
What is authentication in software security?
Authentication is the process of verifying the identity of a user, device, or system.
Explain the concept of authorization.
Authorization determines what actions or resources a user is allowed to access after successful authentication.
What is SQL injection?
SQL injection is a type of attack where malicious SQL queries are inserted into input fields to manipulate or access a database.
Describe Cross-Site Scripting (XSS)
XSS is a vulnerability where malicious scripts are injected into web pages viewed by other users.
Why is performance optimization important in software development?
Performance optimization ensures that software runs efficiently, responds quickly, and uses resources effectively.
What is profiling in performance optimization?
Profiling involves analyzing a program’s runtime behavior to identify performance bottlenecks.
Explain caching as a performance optimization technique.
Caching stores frequently used data in memory to reduce the need for repeated resource-intensive operations.
What is load balancing?
Load balancing distributes network or application traffic across multiple servers to ensure optimal resource utilization.
What is cloud computing?
Cloud computing involves delivering computing services (such as servers, storage, databases) over the internet.
Explain the difference between Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).
IaaS provides virtualized computing resources, PaaS offers a platform for application development, and SaaS delivers ready-to-use software applications.
What is auto-scaling in cloud environments?
Auto-scaling automatically adjusts the number of resources (such as servers) based on traffic or load, ensuring optimal performance.
What is the Waterfall model?
The Waterfall model is a sequential software development process where each phase must be completed before the next one starts.
Explain Agile methodology.
Agile is an iterative and incremental approach to software development that emphasizes collaboration, flexibility, and customer feedback.
What is Scrum?
Scrum is an Agile framework that divides work into time-boxed iterations called sprints, focusing on incremental development and adaptability.
Describe the concept of User Stories in Agile.
User Stories are short, simple descriptions of a feature or requirement from the perspective of an end user.
What is Test-Driven Development (TDD)?
TDD is a development approach where tests are written before writing the actual code, ensuring that the code meets requirements.
Explain Behavior-Driven Development (BDD).
BDD is an extension of TDD that emphasizes collaboration between developers, testers, and non-technical stakeholders to define system behavior.
What is containerization?
Containerization is a technology that packages applications and their dependencies into isolated environments called containers.
Explain Docker.
Docker is a popular platform for developing, shipping, and running applications in containers.
What are Docker images and containers?
Docker images are templates for containers, and containers are instances of those images running as isolated processes.
How does Docker differ from virtualization?
Docker containers share the host OS kernel, making them more lightweight and efficient compared to virtual machines.
What is DevOps?
DevOps is a cultural and technical practice that emphasizes collaboration between development and operations teams to automate and streamline software delivery.
Describe continuous monitoring in DevOps.
Continuous monitoring involves continuously collecting and analyzing data to ensure that a system is performing optimally and securely.
What is a DevOps pipeline?
A DevOps pipeline automates the steps involved in building, testing, and deploying software, ensuring a smooth and consistent delivery process.
Why is ethics important in software development?
Ethics in software development ensures that software is developed and used in a responsible and accountable manner, taking into consideration the impact on users and society.