PyData Careers
20.8K subscribers
206 photos
4 videos
26 files
352 links
Python Data Science jobs, interview tips, and career insights for aspiring professionals.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
Interview Question

What do you know about NoSQL databases?

Answer: NoSQL databases do not use a rigid tabular model and work with more flexible data structures. They do not require a fixed schema, so different records can have different sets of fields.

These databases scale well horizontally: data is distributed across cluster nodes, which helps handle high loads and large volumes. Different storage models are supported — key-value, document, columnar, and graph. This allows choosing the appropriate structure for a specific task.

Common systems include MongoDB (documents), Cassandra (columns), Redis (key-value), and Neo4j (graphs). They are used where scalability, speed, and data flexibility are important.


tags: #interview

https://t.iss.one/DataScienceQ
Please open Telegram to view this post
VIEW IN 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
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
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
3
Interview question

How does Django handle an HTTP request?

Answer: When Django receives an HTTP request, it goes through several stages. First, the request enters the routing system (URLconf), where the appropriate view is selected by the address. Then a function or class-based view is called, which executes the logic: it may access models, prepare data, and select the appropriate template.

After that, the template forms an HTML response based on the provided data, and Django sends it back to the client.

This is how Django organizes work following the MVT pattern: URL → view → logic and data → template → HTTP response.


tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
2
Interview Question

How does the module import mechanism work in Python and what is sys.path?

Answer: When importing a module, Python searches for it in the directories listed in sys.path. This list includes the current directory, standard Python installation paths, and manually added paths. If the module is not found, a ModuleNotFoundError is raised.

tags: #interview

➡️ @DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
3
Interview Question

What are optimistic and pessimistic locking in the context of databases?

Answer: These are two approaches to managing concurrent data access.

Pessimistic locking assumes conflicts are likely. Therefore, data is locked immediately upon reading or writing and remains locked until the end of the transaction. This prevents concurrent modifications but reduces scalability and can lead to deadlocks.

Optimistic locking assumes conflicts are rare. Data is read without locking, and before committing changes, a version check is performed to see if someone else has modified the data. If so, the transaction is rolled back and retried. This approach offers better performance under low contention.


tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
3
Interview question

What is ORM and what is SQLAlchemy used for?

Answer: ORM (Object-Relational Mapping) allows interacting with the database through Python classes and objects instead of writing SQL queries manually.

With SQLAlchemy, you can describe tables as classes, rows as objects, and perform SELECT, INSERT, UPDATE, DELETE operations through Python methods.

This simplifies working with databases, makes the code more readable, reduces the risk of SQL injections, and facilitates maintenance and migrations.


tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
6
Interview Question

What is the difference between pass, continue, and break?

Answer:

▶️ pass — this is a no-op, which does nothing. It is used as a placeholder when syntax requires the presence of code (for example, inside a function, class, or condition), but the logic is not yet implemented

▶️ continue — terminates the current iteration of the loop and moves to the next, skipping the remaining code in the loop body

▶️ break — completely terminates the execution of the loop, exiting it prematurely, regardless of the condition

tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
7👏1
Interview Question

How does the map() function work?

Answer:map() takes a function and an iterable object, and returns an iterator that sequentially yields the result of applying this function to each element. The map() itself does not create a list — it lazily forms values on demand. If a list is needed, the result can be wrapped in list().

tags:#interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
5
Interview Question

What can be a key in a dictionary?

Answer: Dictionaries in Python are hash tables. Instead of keys in the dictionary, hashes are used. Consequently, any hashable data type can be a key in the dictionary, which includes all immutable data types.

tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
4👏3
Question from the interview

Why does isinstance(True, int) return True?

Answer: In Python, bool is a subclass of int. True and False are instances of int with values 1 and 0, respectively.

tags: #interview

➡️ @DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
6👍1
Question from the interview

What is Big O notation?

Answer: Big O notation is a way of describing how quickly the running time or memory consumption of an algorithm increases as the size of the input data increases. It shows the asymptotic complexity: the upper bound of the algorithm's behavior, without taking into account constants and minor details.

For example, O(n) grows linearly, O(n²) - quadratically, O(1) - does not depend on the size of the input.

Big O does not give exact figures, but allows you to compare algorithms in terms of their scalability.


tags: #interview

@DataScienceQ ⭐️
Please open Telegram to view this post
VIEW IN TELEGRAM
7
Interview question

What is __slots__?

Answer: By default, class instances store their attributes in the internal dictiondictct__. This is flexible, but it requires more memory and makes access to fields a bit slower, because the search is done in the dictionarslotsts__ allows you to fix a set of allowed attributes and abandon the usedictct__. Instead of a dictionary, Python allocates compact slots — thereby reducing the memory consumption for each object and speeding up access to attributes. This is especially important when millions of class instances are created in a program or the performance of data access is critical.

There is one restriction: it is not possible to add an attribute that is notslotsts__. To retain the ability to dynamically create fields, you can dictct__ to the list of slots.

tags:
#interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
5👎1
Question from the interview

What is a message broker and which ones are typically used with Python?

Answer: A message broker is an intermediary component that accepts messages from one service and delivers them to another, allowing microservices and asynchronous tasks to interact without direct connection. It ensures reliable delivery, queues, routing, and scalability.

In Python projects, RabbitMQ, Apache Kafka, and Redis are often used as simple broker solutions (for example, in combination with Celery). The choice depends on the tasks: Kafka for stream processing, RabbitMQ for flexible routing, and Redis for simple queues.


tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
4
Interview question

What is an S3 storage and what is it used for?

Answer: S3 (Simple Storage Service) is a cloud-based object storage service designed for storing any type of files, from images and backups to static websites.

It is scalable, reliable, and provides access to files via URLs. Unlike traditional file systems, S3 does not have a folder hierarchy — everything is stored as objects in "buckets" (containers), and access can be controlled through policies and permissions.


tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
6
Question from the interview

Why don't you need to store a session when using JWT?

Answer: JWT contains all the necessary information about the user directly in the token, including the expiration date and roles. The server simply verifies the token's signature and does not store any data between requests, so a separate session storage is not required.

tags: #interview

@DataScienceQ
Please open Telegram to view this post
VIEW IN TELEGRAM
2