Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Zibal

Status

📜📞🔧📝❌

Senior Python Developer

Interview Process

flowchart LR
    sr(Send Resume) --> hr(HR Call) --> ti(Technical Interview) --> task(Task) --rejected--x hri(HR Interview) -.-> o(Offer)

Apply Way

Jobinja

Interview Date

  • Sent Resume
    1404/07/15

  • HR Call
    1404/07/28

  • Technical Interview
    1404/08/03

  • Rejection Email
    1404/08/24

Interview Duration

  • Technical Interview
    1 hour

Interview Platform

Google Meet

Technical Interview

  • Tell me about yourself

  • Do you make decisions on your team, or is there a designated decision-maker?

  • Did you implement the matching engine synchronously or asynchronously? How did you handle race conditions?

  • When you want to learn something new, what is your process (videos, docs, books, etc.)?

  • What is difference between is and == in python?

    Answer

    The is operator checks for identity.
    The == operator checks for equality.

    a = [1, 2, 3]
    b = a     # b references the same list as a
    c = a[:]  # c is a new list with the same content as a
    
    print(a is b)  # True, because b is the same object as a
    print(a is c)  # False, because c is a different object
    print(a == c)  # True, because a and c have the same content
    

  • What is the difference between a @classmethod and a @staticmethod? When would you use a @classmethod?

    Answer

    @classmethod receives the class (cls) and is used for alternative constructors or methods that operate on class-level state. @staticmethod has no implicit first argument and is used for utility functions grouped with the class without accessing class or instance state.
    realpython


  • What is a generator and what are its benefits?

    Answer
    A generator is a function that yields values lazily and returns an iterator. Benefits: low memory usage for large sequences, simple stateful iteration, and easy composition of pipelines.
    https://realpython.com/introduction-to-python-generators/

  • How do you create private methods in Python?

    Answer

    Use a single leading underscore _method to indicate ‘internal’ use (convention). Use double leading underscores __method for name-mangling to reduce accidental access from subclasses; note that nothing is truly private.
    https://www.datacamp.com/tutorial/python-private-methods-explained


  • How does Django ORM address the N+1 query problem?

    Answer

    Django provides select_related for single-valued relationships and prefetch_related for many-to-many or reverse relations to eager-load related objects and avoid N+1 queries. You should profile queries and use .values() or annotations when appropriate.
    https://www.youtube.com/watch?v=zwF5ADW6eKs
    https://docs.djangoproject.com/en/5.2/topics/db/optimization/
    https://docs.djangoproject.com/en/5.2/ref/models/querysets/


  • Can you explain Django’s architecture?

    Answer
    Django follows an MTV (Model–Template–View) pattern: Models hold data/ORM; Views handle requests; Templates render presentation. Requests flow through middleware, URL routing sends them to views, which use models/templates; Django runs on WSGI/ASGI.
    https://dev.to/vincenttommi/2-understanding-djangos-architecture-the-mtv-pattern-1gl

  • Describe the backend architecture you worked on and its layers.

    Answer
    Microservices behind an API gateway, an auth layer, service layer (HTTP/gRPC), business/service layer, repository/data layer, and persistent stores (MySQL/Postgres, Redis). Async work is handled by message brokers and workers; observability uses logs, metrics, and tracing; deployments use Docker + Kubernetes.

  • Why do we use a repository layer in a service?

    Answer
    A repository abstracts persistence, centralizes queries, and decouples domain logic from storage details — making testing, swapping databases, and enforcing consistency simpler.

  • What are serializers in Django REST Framework (DRF)?

    Answer
    Django’s serialization framework provides a mechanism for “translating” Django models into other formats. Usually these other formats will be text-based and used for sending Django data over a wire, but it’s possible for a serializer to handle any format (text-based or not). djangoproject

  • What are custom permissions in DRF and how do you implement them?

    Answer

    Custom permissions encapsulate business authorization rules. Implement them by subclassing rest_framework.permissions.BasePermission and overriding has_permission and/or has_object_permission, then apply to views or viewsets.
    https://www.django-rest-framework.org/api-guide/permissions/


  • How can you ensure only one instance of your database adapter is created in Python?

    Answer
    With singleton pattern

  • How do you track requests and implement rate limiting? At which layers can this be applied?

    Answer
    Track requests with unique request IDs, structured logs, and distributed tracing (OpenTelemetry). Rate limiting can be applied at the edge (CDN, API gateway, reverse proxy), in a middleware layer, or in the application using token-bucket algorithms stored in Redis for shared counters.

  • What’s the difference between inheritance and composition?

    Answer
    Inheritance models an ‘is-a’ relationship and shares behavior via a superclass. Composition models ‘has-a’ and embeds functionality by using other objects. Composition is generally preferred for flexibility and testability.

  • What is dependency injection?

    Answer
    Dependency injection supplies an object’s dependencies from the outside (constructor, setter, or factory) rather than creating them internally; this improves testability, decoupling, and configurability.

  • Which databases have you worked with?

  • What does ACID stand for?

    Answer

  • What is a race condition and how can you solve it?

    Answer
    A race condition happens when concurrent operations interleave and produce incorrect state. Solve it with mutual exclusion (mutexes) for in-process protection, transactions, locks (pessimistic or optimistic), atomic DB operations, idempotency, or by redesigning to avoid shared mutable state.

  • How did you handle race conditions in the matching engine you worked on?

  • What is the difference between a thread and a process?

    Answer
    Threads share a process memory space (lightweight, require synchronization). Processes have separate memory (safer isolation, heavier IPC). Choose threads for shared-memory, processes for isolation.

  • How can use for example 30 core of cpu in production with python?

    Answer
    In Python, you scale CPU usage by running multiple processes, not threads. In production I usually run Uvicorn behind Gunicorn and configure it with one worker per CPU core—so on a 30-core machine, -w 30 lets the app fully utilize all cores.
    gunicorn app:app -k uvicorn.workers.UvicornWorker -w 30
    

  • Have you worked in production or fixed bugs in production?

  • Are you familiar with Uvicorn workers?

    Answer
    Yes — Uvicorn provides worker classes (often used with Gunicorn) to run ASGI apps across multiple processes; understand worker lifecycle, when to scale workers vs async concurrency, and how to supervise them in production.
    https://www.uvicorn.org/deployment/
    https://docs.gunicorn.org/

  • How do you push commits to another branch?

    Answer
    cherry-pick

Task

پس از مصاحبه فنی تسکی فرستادند که می‌تونید از این‌جا ببینید. و همین‌طور جواب من رو.

Score

6.5/10

فرصت ۳ روزه برای این تسک کمه و تنبلی مصاحبه‌کننده در طراحی سنجش رو نشون می‌ده. نیازی به این همه بیل و کلنگ نبود. با این موضوع حال نکردم (اگر چه با مقوله تسک زدن به طور کلی حال نمی‌کنم شما وقت‌ رو می‌ذارید آیا بشود آیا نشود) از طرفی حس کردم اونقدر هم جایی نیست که بتونم چیز یاد بگیرم چون اکثر نیروهاشون جونیور بودند. فید‌بک هم که طبق معمول کسی نمی‌ده. سوالات مرحله اول خوب بود، اون قسمت‌ش رو دوست داشتم.