1. What are Python decorators and how are they commonly used? Python decorators are functions that take another function as input, modify or enhance its behavior, and return the modified function. They are commonly used for logging, access control, memoization, and instrumentation. --- **2. What is the difference between a shallow copy and a deep copy in Python?** A shallow copy copies references to objects, so changes to nested objects affect the original. A deep copy creates new instances of all nested objects, so changes do not affect the original. --- **3. Explain the use of virtual environments in Python development.** Virtual environments create isolated Python environments for projects, allowing specific dependencies and versions to be installed without affecting global packages or other projects. --- **4. What does PEP 8 refer to in Python?** PEP 8 is the Python Enhancement Proposal that provides style guidelines for writing readable and consistent Python code. --- **5. What’s the difference between INNER JOIN and LEFT JOIN in SQL?** INNER JOIN returns only rows with matching values in both tables. LEFT JOIN returns all rows from the left table and matching rows from the right table, with NULLs for non-matches. --- **6. What are some best practices for writing maintainable Python code?** Use the DRY principle, write modular code, follow PEP 8, use clear variable names, include comments and docstrings, and apply proper error handling. --- **7. What are indexes in a database and why are they important?** Indexes are data structures that improve the speed of data retrieval operations on a database table, especially for queries using WHERE, JOIN, or ORDER BY clauses. --- **8. How would you handle a situation where your SQL query is taking too long to execute?** I would analyze the execution plan, add proper indexes, reduce unnecessary joins or subqueries, and optimize the query structure. --- **9. Explain ACID properties in relational databases.** ACID stands for Atomicity, Consistency, Isolation, and Durability—principles that ensure reliable database transactions. --- **10. What is prompt engineering and why is it important when working with LLMs?** Prompt engineering involves designing effective input prompts to guide language models in producing accurate, relevant, and context-specific outputs. --- **11. What is LangChain and how does it relate to AI agent development?** LangChain is a framework for building applications with language models. It supports chaining prompts and integrating tools like APIs and memory for AI agent development. --- **12. What factors would you consider when deploying an AI agent in a client environment?** I would consider security, scalability, performance, API access, data privacy, and integration compatibility. --- **13. Why is it important to ensure modularity and documentation when building AI agents?** Modularity makes the code easier to manage and scale. Documentation helps other developers understand, maintain, and enhance the agent efficiently. --- **14. What are some challenges in integrating AI agents with third-party APIs or databases?** Common challenges include authentication, data format inconsistencies, API rate limits, latency, error handling, and versioning. --- **15. What is the role of memory and tools in a LangChain agent?** Memory allows the agent to retain context across interactions. Tools enable the agent to perform tasks like web access, math, or data retrieval. --- **16. Name one advantage of deploying AI applications on AWS or Azure.** Cloud platforms like AWS offer scalability, built-in CI/CD pipelines, and secure infrastructure for deploying AI applications efficiently. --- **17. What is the significance of using RESTful APIs in AI agent workflows?** RESTful APIs provide a standard way for agents to interact with external systems, enabling reliable data exchange and service integration. --- **18. What is containerization, and why might Docker be used in agent deployment?** Containerization packages an application with all its dependencies. Docker ensures it runs consistently across different environments without conflicts. --- **19. How would you handle large datasets in an AI-based application?** I would process the data in chunks and use distributed frameworks like Apache Spark for scalability and efficiency. --- **20. Which AWS service is commonly used to manage containerized applications?** Amazon ECS (Elastic Container Service) and Amazon EKS (Elastic Kubernetes Service) are commonly used to manage containerized applications on AWS.