






















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























































































Question 1. Which data structure provides O(1) average‑time complexity for insert, delete, and lookup when using a good hash function? A) Array B) Linked list C) Hash table D) Binary search tree Answer: C Explanation: A hash table uses a hash function to map keys to buckets, giving constant‑time operations on average. Question 2. In Big‑O notation, which of the following describes the worst‑case time complexity of quicksort when the pivot is always the smallest element? A) O(n) B) O(n log n) C) O(n²) D) O(log n) Answer: C Explanation: Choosing the smallest element as pivot repeatedly produces highly unbalanced partitions, leading to quadratic time. Question 3. Which logical operator is NOT associative? A) AND (∧) B) OR (∨) C) XOR (⊕) D) NOT (¬) Answer: D
Explanation: NOT is unary; associativity applies only to binary operators. Question 4. In discrete mathematics, the principle that the sum of the degrees of all vertices in an undirected graph equals twice the number of edges is known as: A) Handshaking lemma B) Pigeonhole principle C) Inclusion‑exclusion principle D) Euler’s formula Answer: A Explanation: Each edge contributes to the degree count of its two incident vertices. Question 5. Which of the following is a characteristic of functional programming? A) Mutable state is encouraged B) Functions have side effects C) Emphasis on higher‑order functions and immutability D) Inheritance is the primary reuse mechanism Answer: C Explanation: Functional languages favor pure functions, immutability, and higher‑order functions. Question 6. In object‑oriented design, the “Liskov Substitution Principle” (LSP) primarily addresses: A) Encapsulation of data B) Ability to replace a base class with a derived class without altering correctness C) Minimizing code duplication D) Dependency inversion
A) Hash index B) B‑tree index C) Bitmap index D) Full‑text index Answer: B Explanation: B‑tree indexes maintain sorted order, facilitating efficient range scans. Question 10. RESTful services should be stateless. What does this imply about server‑side session data? A) Session data must be stored on the server between requests B) Each request must contain all information needed to process it C) Cookies are mandatory for authentication D) Server must maintain a connection pool per client Answer: B Explanation: Statelessness means the server does not retain client context; the client sends all required state with each request. Question 11. Which of the following threats is mitigated by implementing input validation and output encoding? A) Denial‑of‑service (DoS) B) SQL injection C) Man‑in‑the‑middle (MITM) D) Phishing Answer: B Explanation: Proper validation/encoding prevents malicious data from being interpreted as code by the database.
Question 12. The SOLID principle that encourages “single responsibility” is primarily concerned with: A) Reducing coupling between modules B) Ensuring a class has only one reason to change C) Providing a common interface for unrelated classes D) Delegating object creation to factories Answer: B Explanation: SRP states a class should have one responsibility, thus one reason to be modified. Question 13. In Git, which command creates a new branch and immediately switches to it? A) git branch <name> B) git checkout - b <name> C) git merge <name> D) git pull <name> Answer: B Explanation: git checkout - b both creates and checks out the new branch. Question 14. Which Git workflow model uses a long‑lived “develop” branch where feature branches are merged, and a “master” branch only for releases? A) GitFlow B) Forking workflow C) Centralized workflow D) Trunk‑based development Answer: A
C) Write test → Write code → Refactor D) Write code → Refactor → Write test Answer: C Explanation: TDD follows the “red‑green‑refactor” cycle: write a failing test, make it pass, then improve the code. Question 18. Which Agile ceremony is primarily used to synchronize the team’s daily progress and surface impediments? A) Sprint Planning B) Daily Stand‑up C) Sprint Review D) Retrospective Answer: B Explanation: The Daily Stand‑up (or Daily Scrum) is a short meeting for status sharing and issue identification. Question 19. In Scrum, what is the maximum recommended length of a Sprint for a product that requires rapid feedback? A) 1 week B) 2 weeks C) 4 weeks D) 6 weeks Answer: B Explanation: Two‑week Sprints balance feedback frequency and delivery of valuable increments.
Question 20. Which DevOps practice enables infrastructure to be provisioned and versioned in the same way as application code? A) Continuous Integration B) Infrastructure as Code (IaC) C) Blue‑Green Deployment D) Feature Toggles Answer: B Explanation: IaC treats infrastructure definitions as code, allowing version control and automated provisioning. Question 21. Docker containers share the host’s _____ while providing isolated user spaces. A) Kernel B) BIOS C) GPU drivers D) Network stack only Answer: A Explanation: Containers share the host operating system kernel but have isolated file systems, namespaces, and cgroups. Question 22. Which Kubernetes object defines a desired number of identical Pods and ensures they are always running? A) Service B) Deployment C) ConfigMap D) PersistentVolume
B) To document lessons learned and improve future processes C) To certify the product for release D) To finalize financial accounting Answer: B Explanation: Post‑mortems focus on understanding root causes and preventing recurrence. Question 26. Which design pattern provides a way to create families of related objects without specifying their concrete classes? A) Singleton B) Factory Method C) Abstract Factory D) Builder Answer: C Explanation: Abstract Factory abstracts the creation of related object families. Question 27. In a layered (N‑tier) architecture, where should business rules ideally reside? A) Presentation layer B) Data access layer C) Business logic layer D) Infrastructure layer Answer: C Explanation: The business logic layer encapsulates domain rules, separate from UI and persistence concerns. Question 28. Which of the following is a behavioral design pattern?
A) Adapter B) Strategy C) Composite D) Bridge Answer: B Explanation: Strategy defines a family of interchangeable algorithms (behaviors). Question 29. A deadlock can occur when four conditions hold simultaneously. Which condition is NOT one of them? A) Mutual exclusion B) Hold and wait C) No preemption D) Resource starvation Answer: D Explanation: The four Coffman conditions are mutual exclusion, hold‑and‑wait, no preemption, and circular wait. Resource starvation is a symptom, not a condition. Question 30. Which algorithm is most appropriate for finding the shortest path in a graph with non‑negative edge weights? A) Dijkstra’s algorithm B) Bellman‑Ford algorithm C) Floyd‑Warshall algorithm D) Kruskal’s algorithm Answer: A Explanation: Dijkstra’s algorithm efficiently computes shortest paths when edge weights are non‑negative.
Answer: D Explanation: Acceptance testing is performed by stakeholders to verify that requirements are satisfied. Question 34. In a microservices architecture, which pattern helps to avoid cascading failures when a downstream service becomes unresponsive? A) Circuit Breaker B) Singleton C) Lazy Loading D) Facade Answer: A Explanation: The Circuit Breaker pattern monitors failures and short‑circuits calls to prevent overload. Question 35. Which of the following best describes continuous deployment? A) Automated testing after each commit, but manual release B) Manual testing before release to production C) Every change that passes automated tests is released to production automatically D) Deploying on a scheduled nightly build Answer: C Explanation: Continuous deployment pushes every passing change directly to production without human intervention. Question 36. Which of the following is a primary benefit of using graphQL over traditional REST for data fetching? A) Fixed endpoint URLs
B) Over‑fetching data is prevented by client‑specified queries C) Statelessness is enforced automatically D) Native support for SOAP envelopes Answer: B Explanation: GraphQL lets clients request exactly the fields they need, eliminating over‑fetching. Question 37. Which of the following statements about garbage collection in managed languages is FALSE? A) It reclaims memory occupied by objects no longer reachable B. It can introduce nondeterministic pause times C. It requires the programmer to manually free each object D. It may move objects in memory to compact the heap Answer: C Explanation: In managed runtimes, the programmer does not manually free objects; the collector does it automatically. Question 38. In a concurrent program, which Java construct provides a lock that can be attempted without blocking? A) synchronized block B) ReentrantLock.tryLock() C) volatile variable D) Thread.sleep() Answer: B Explanation: tryLock() attempts to acquire the lock and returns immediately with a boolean result.
Explanation: The Ishikawa (fishbone) diagram helps identify causes contributing to a problem. Question 42. Which of the following best describes technical debt? A) Money owed to vendors for software licenses B) The cost of refactoring code to improve maintainability C) Delayed features due to resource constraints D) The interest accrued on a loan for hardware purchases Answer: B Explanation: Technical debt quantifies the future effort required to address shortcuts taken in code. Question 43. Which of the following is a behavioral software metric? A. Lines of Code (LOC) B. Cyclomatic Complexity C. Defect Density D. Code Churn Answer: D Explanation: Code churn measures the amount of code added, modified, or deleted over time—a behavior‑related metric. Question 44. In a Kanban board, what does a “WIP limit” control? A) Maximum number of users on the system B) Number of tasks allowed in a column simultaneously C) Total story points per sprint D) Frequency of retrospectives
Answer: B Explanation: Work‑In‑Progress limits cap the number of items in a stage to improve flow. Question 45. Which of the following is an example of pair programming benefit? A. Increased code base size B. Faster individual learning curves C. Reduced need for code reviews D. Higher likelihood of merge conflicts Answer: B Explanation: Pair programming promotes knowledge sharing and accelerates skill acquisition. Question 46. Which of the following statements about CAP theorem is correct? A) A distributed system can simultaneously provide Consistency, Availability, and Partition tolerance. B) In the presence of a network partition, a system must choose between Consistency and Availability. C. CAP only applies to relational databases. D. Consistency means eventual consistency. Answer: B Explanation: The theorem states that under a partition, a system can guarantee at most two of the three properties. Question 47. Which of the following is a design principle that encourages reusing code by removing duplication? A) Open/Closed Principle
A) Randomly altering code to see if existing tests detect the change B) Measuring code coverage percentages C) Running tests in parallel to reduce execution time D) Generating test data automatically from specifications Answer: A Explanation: Mutation testing injects small faults (mutants) to evaluate the effectiveness of the test suite. Question 51. Which of the following is a behavioral software design pattern that defines a one‑to‑many dependency between objects so that when one object changes state, all its dependents are notified? A) Observer B) Factory Method C) Decorator D) Proxy Answer: A Explanation: The Observer pattern enables automatic notification of dependent objects. Question 52. In a relational database, which command is used to enforce referential integrity between two tables? A) CREATE INDEX B) ALTER TABLE … ADD CONSTRAINT FOREIGN KEY C) INSERT INTO … VALUES D) DROP TABLE Answer: B
Explanation: Adding a foreign key constraint ensures that referenced values exist in the parent table. Question 53. Which of the following is a characteristic of a layered architecture? A) Direct communication between any two components B) Strict separation of concerns via defined layers C) All business logic resides in the presentation layer D) No need for an explicit data access layer Answer: B Explanation: Layered architecture enforces separation of concerns, with each layer only interacting with adjacent layers. Question 54. Which of the following is a common security control implemented at the architectural level to mitigate cross‑site scripting (XSS)? A) Input validation only on the client side B) Content Security Policy (CSP) headers C. Disabling TLS D. Using HTTP basic authentication Answer: B Explanation: CSP restricts the sources from which scripts can be loaded, reducing XSS risk. Question 55. Which of the following best defines idempotent in the context of a RESTful API operation? A) The operation can be called only once B. Repeating the operation has the same effect as calling it once C. The operation always returns the same HTTP status code