Aspire Systems - Level I - Python Full Stack Developer Interview
Anonymous User
141

📍 Round: Technical Interview

Topics Covered: Python Core, JWT, Logging, and Decorators

👋 Self Introduction

The interview began with a brief self-introduction round.

💬 Technical Questions

🔹 Python Concepts

  • What are decorators in Python?
  • Explain generators and how they differ from normal functions.
  • What are built-in decorators in Python?
  • Difference between @staticmethod and @classmethod.

🔹 JWT and Security

  • What is JWT (JSON Web Token) and how does it work?
  • Difference between encoding and encryption.
  • What algorithm type is used for JWT signing/verification?

🔹 Logging and Error Handling

  • How do you implement logging using the logging package in Python?
  • How would you handle exceptions and log them properly in production code?

💻 CODING QUESTION

Problem Statement:
Design a sophisticated Python decorator that implements a comprehensive logging mechanism for function calls.

Your decorator should capture and log the following details for each function invocation:

  • Timestamp of function execution
  • Function name and arguments passed
  • Execution duration

Return value or any exceptions raised

The decorator should be flexible enough to work with functions of varying signatures and handle potential errors gracefully without disrupting the original function's behavior.

💡 Notes

Focus on writing clean, production-quality code and be ready to explain your approach, especially around decorators and logging mechanisms.

Comments (1)