Software Engineering Practice Assessment - 25
Questions
Q1. What is the time complexity of binary search?
Answer: O(log n). Each step halves the search space.
Q2. Explain how a hash table achieves average O(1) lookup time.
Answer: By computing a hash function that maps keys to indices. Collisions are handled via
chaining or open addressing.
Q3. Write an algorithm to reverse a linked list.
Answer: Iterate through the list, changing each node’s next pointer to its previous node. Time O(n),
Space O(1).
Q4. What is the difference between stack and queue?
Answer: Stack is LIFO (Last In First Out), Queue is FIFO (First In First Out).
Q5. What sorting algorithm has average O(n log n) complexity and is stable?
Answer: Merge Sort. It divides and merges sorted halves while preserving order of equal elements.
Q6. What does this code output? x = [1,2,3] y = x y.append(4) print(x)
Answer: [1,2,3,4]. Explanation: y references the same list object as x.
Q7. What is recursion?
Answer: A function calling itself, with a base case to stop. Example: factorial function.
Q8. Difference between pass by value and pass by reference?
Answer: Pass by value copies data; pass by reference passes memory address. Python uses
'object reference' model.
Q9. What will this JavaScript output? console.log(0.1 + 0.2 === 0.3)
Answer: false. Due to floating point precision issues (0.1+0.2 = 0.30000000000000004).
Q10. Explain polymorphism in OOP.
Answer: Ability of different classes to implement the same interface/method differently. Example:
shape.draw() for circle vs square.
Q11. Write an SQL query to count the number of orders per customer.
Answer: SELECT customer_id, COUNT(*) FROM Orders GROUP BY customer_id;
Q12. What is a primary key?
Answer: A unique identifier for each row in a table. Cannot be null.
Q13. Difference between INNER JOIN and LEFT JOIN?
Answer: INNER JOIN returns rows with matching keys in both tables, LEFT JOIN returns all rows
from left table even if no match.
Q14. Write an SQL query to find customers who have never placed an order.
Answer: SELECT c.customer_id FROM Customers c LEFT JOIN Orders o ON
c.customer_id=o.customer_id WHERE o.order_id IS NULL;
Q15. What is database normalization?
Answer: Process of organizing data to reduce redundancy and improve integrity. Normal forms
(1NF, 2NF, 3NF, etc).
Q16. What is the difference between monolithic and microservices architecture?
Answer: Monolithic: all components in one application. Microservices: independent services
communicating via APIs.
Q17. Explain REST API principles.
Answer: Stateless, client-server, uniform interface, cacheable, layered system.
Q18. What is the Model-View-Controller (MVC) pattern?
Answer: MVC separates data (Model), presentation (View), and logic (Controller). Improves
modularity.
Q19. Explain the concept of scalability.
Answer: System’s ability to handle increased load by adding resources. Vertical vs horizontal
scaling.
Q20. What is caching and why is it useful?
Answer: Storing frequently accessed data in faster memory. Reduces load, improves performance.
Q21. What is Continuous Integration (CI)?
Answer: Frequently merging code into shared repo, followed by automated builds/tests.
Q22. Difference between black-box and white-box testing?
Answer: Black-box: tests external behavior without seeing code. White-box: tests internal structure
and logic.
Q23. Explain Agile methodology.
Answer: Iterative development in short sprints, focusing on customer feedback and flexibility.
Q24. What is technical debt?
Answer: Extra rework cost caused by quick/inefficient coding decisions instead of clean solutions.
Q25. Explain difference between authentication and authorization.
Answer: Authentication verifies identity (who you are), Authorization grants permissions (what you
can do).