PyData Careers
20.7K subscribers
196 photos
4 videos
26 files
342 links
Python Data Science jobs, interview tips, and career insights for aspiring professionals.
Download Telegram
Interview Question

What does it mean that a QuerySet in Django is "lazy"?

Answer: "Lazy" QuerySet means that Django does not make a database query at the moment of creating the QuerySet. When you call .filter(), .exclude(), .all(), etc., the query itself is not executed yet — only an object describing the future SQL is created.

The actual database access happens only when the results are really needed: when iterating over the QuerySet, calling list(), count(), first(), exists(), and other methods that require data.

This approach helps avoid unnecessary database hits and improves performance — queries are executed only at the moment of real necessity.


tags: #interview

https://t.iss.one/DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
🚀 THE 7-DAY PROFIT CHALLENGE! 🚀

Can you turn $100 into $5,000 in just 7 days?
Lisa can. And she’s challenging YOU to do the same. 👇

https://t.iss.one/+AOPQVJRWlJc5ZGRi
https://t.iss.one/+AOPQVJRWlJc5ZGRi
https://t.iss.one/+AOPQVJRWlJc5ZGRi
Interview question

What is the difference between calling start() and run() on threading.Thread?

Answer: The start() method creates a new thread and automatically calls run() inside it.

If you call run() directly, it will execute in the current thread like a normal function — without creating a new thread and without parallelism.

This is the key difference: start() launches a separate execution thread, while run() just runs the code in the same thread.


tags: #interview

https://t.iss.one/DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
👩‍💻 Python Question / Quiz;

What is the output of the following Python code?
Please open Telegram to view this post
VIEW IN TELEGRAM
5
Channel name was changed to «PyData Careers»
Channel photo updated
Interview Question

What does nonlocal do and where can it be used?

Answer: nonlocal allows you to modify a variable from the nearest enclosing function without creating a new local one. It only works inside a nested function when you need to change a variable declared in the outer, but not global, scope.

This is often used in closures to maintain and update state between calls to the nested function.


tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
2
💸 PacketSDK--A New Way To Make Revenue From Your Apps

Regardless of whether your app is on desktop, mobile, TV, or Unity platforms, no matter which app monetization tools you’re using, PacketSDK can bring you additional revenue!

● Working Principle: Convert your app's active users into profits 👥💵

● Product Features: Ad-free monetization 🚫, no user interference

● Additional Revenue: Fully compatible with your existing ad SDKs

● CCPA & GDPR: Based on user consent, no collection of any personal data 🔒

● Easy Integration: Only a few simple steps, taking approximately 30 minutes

Join us:https://www.packetsdk.com/?utm-source=SyWayQNK

Contact us & Estimated income:
Telegram:@Packet_SDK
Whatsapp:https://wa.me/85256440384
Teams:https://teams.live.com/l/invite/FBA_1zP2ehmA6Jn4AI

Join early ,earn early!
2
🐍 Tricky Python Interview Question

> What will this code output and why?


def extend_list(val, lst=[]):
    lst.append(val)
    return lst

list1 = extend_list(10)
list2 = extend_list(123, [])
list3 = extend_list('a')

print(list1, list2, list3)


Question: Why are list1 and list3 the same?

🔍 Explanation:

Default arguments in Python are evaluated once — at function definition, not at each call.

So lst=[] is created once and preserved between calls if you don't explicitly pass your own list.

🧠 What happens:

- extend_list(10) → uses the shared list [], now it is [10]

- extend_list(123, []) → creates a new list [123]

- extend_list('a') → again uses the shared list → [10, 'a']

👉 Result:

[10, 'a'] [123] [10, 'a']

How to fix:

If you want a new list created by default on each call, do this:


def extend_list(val, lst=None):
    if lst is None:
        lst = []
    lst.append(val)
    return lst


This is a classic Python interview trap — mutable default arguments.

It tests if you understand how default values and memory scope work.

https://t.iss.one/DataScienceQ ⭐️
Please open Telegram to view this post
VIEW IN TELEGRAM
1