Software Engineering Flashcards
How does version control, specifically Git, facilitate collaborative software development?
Git allows multiple developers to work on a project simultaneously, managing changes, merging, and maintaining a history of revisions.
What is the difference between a thread and a process?
A process is an independent program; a thread is a lightweight, independent unit of execution within a process.
How does a hash table work, and what is its time complexity for common operations?
A hash table uses a hash function to map keys to indices; time complexity for search, insertion, and deletion is generally O(1) on average.
Explain the concept of polymorphism in object-oriented programming.
Polymorphism allows objects to be treated as instances of their parent class, promoting code reusability and flexibility.
Animal. Make Sound
How does garbage collection work in programming languages like Java or JavaScript?
Garbage collection automatically identifies and removes unreferenced objects to free up memory.
Explain the concept of Dependency Injection in software design.
Dependency Injection facilitates loose coupling by injecting dependencies into a class rather than creating them internally.
const loggerInstance = new Logger(); const productService = new ProductService(loggerInstance);
What is the purpose of CORS (Cross-Origin Resource Sharing) in web development?
CORS allows or restricts web resources requested from a different domain, enhancing security and preventing unauthorized access.
Explain the concept of a closure in JavaScript.
A closure is a function that remembers the variables from its outer scope even after the outer function has finished executing.
How does the event loop work in JavaScript?
The event loop manages the execution of tasks in a non-blocking way
Call Stack: Executes synchronous tasks.
Web APIs & Callback Queue: Handle asynchronous tasks.
Event Loop: Monitors Call Stack and Callback Queue.
Explain the concept of a design pattern in software development
A design pattern is a reusable solution to a common problem in software design, providing a template for solving specific issues.
What is the purpose of the “this” binding in JavaScript arrow functions?
Arrow functions inherit the “this” value from their enclosing scope, eliminating the need for explicit binding.
Arrow functions in JavaScript lexically capture the this
value, maintaining the context from their surrounding scope. This contrasts with regular functions, where this
is dynamically determined, potentially leading to unexpected behavior.
Explain the concept of a NoSQL database, and provide an example.
NoSQL databases store and retrieve data using non-tabular models. Example: MongoDB, which uses a document-oriented model.
Explain the concept of a NoSQL database, and provide an example.
What is monolithic programming
Single Unified codebase
Django, WordPress
.Cons:Scalability challenges.Limited technology flexibility.Pros:Simplicity in development.Easier to manage in smaller projects.
4 advantages of Nodejs in comparison with Java
Asynchronous Nature:Event-driven, non-blocking
Unified Language:JavaScript for frontend and backend.
Fast Execution:V8 engine performance.
Lightweight and Fast Startup:Suitable for microservices and serverless. Less resources
3 advantages of using Java versus node JS
Enterprise-Level Scalability
Native Threads Support
Java Memory Model
what is grpc and its feature
Remote Procedure Call
- it’s open source by Google
- it uses HTTP 2 for transport
- protocol buffers (binary data transfer)
- it’s bio-directional streaming
- efficient for serialization
- it’s language agnostic
- microsevices communication
what’s Stateless nature in REST/GRPC/Graphql?
- each request is independent
- system do not maintain a session of client
- it simplifies scalability.
- Fault Tolerance: if one request fails you can direct it to other
stateful: websocket
S,H,E,N,S
When use Rust instead of NodeJs
- Systems Programming: Rust excels in low-level control and memory safety.
- High-performance: Rust is suitable for heavy computation and data processing.
- Embedded Systems: Rust is ideal for firmware and IoT devices.
- Networking: Rust offers strong concurrency and memory safety for networking applications.
- Security: Rust prevents common security vulnerabilities.
R,R,P,E,A
When use Nodejs Instead of Rust
- Rapid Prototyping: Node.js allows for quick development due to its simplicity and large ecosystem.
- Real-time Web Applications: Node.js excels in building real-time applications like chat applications or streaming services.
- Developer Productivity: Node.js has a lower learning curve and offers faster development cycles.
- Rich Ecosystem: Node.js has a mature ecosystem with a wide range of libraries and frameworks.
- Scripting and Automation: Node.js is well-suited for scripting tasks and automating workflows.
Compare Rust and Nodejs Memory managment
Rust: based on system of ownership, borrowing, and lifetimes
NodeJs: uses automatic garbage collection to manage memory
-Rust is better in memory safety
MySql Weaknesses and Strengths
Weaknesses:
- Limited support for advanced features
- scalability concerns.
Strengths:
- Widely used,
- open-source,
- good performance for small to medium-sized databases.
Postgres Weaknesses and Strengths
Weaknesses:
- Can be slower for complex queries,
- higher memory usage
Strengths:
- Advanced features (e.g., JSON support, full-text search)
- strong ACID compliance.
- set of properties that guarantee that database transactions are processed reliably:*
Atomicity, Consistency, Isolation, and Durability.
Oracle Database Weaknesses and Strengths
Weaknesses: Expensive licensing, complex setup and management.
Strengths: High performance, scalability, comprehensive feature set.
SQL Server Weaknesses and Strengths
Weaknesses: Proprietary, limited cross-platform support.
Strengths: Integration with Microsoft ecosystem, strong security features.