Feel free to add questions on each sections or you can add another sections like Java, Javascript , go etc. Just send me a pull request. Please read questions carefully before sending pull request. We do not add repeated questions
-
Tell me about mutable and immutable functions
-
What are the mutable and immutable datastructure in python
-
Tell me about generator function.
-
How generator function works
-
How lumbda function works ?
-
Can you please explian lumbda function
-
Is there any restriction on input variable of Lumbda function ?
-
Tell me about list comprehension with an example
-
what is loose couping
-
Explain python namespace
-
Pyhton garbage collection
-
Does pyhton support multiple inheritence? If yes the explain how multiple inheritance works in python
-
Variable scope in pyhton. tell me the output of this code
temp = 10 def func(): temp = 20 print(temp) print(temp) func() print(temp)
-
Expain Stack queue.
-
Expain map on python. (filter and reduce)
-
Is python string are immutable ? Expalin with an example
-
Imagine that you have a lumbda function which take a variable and squire it? If I provide you a list of numners how can your squire them?
Solutions:
Way 1:data = lambda x: x ** 2 numbers = [1, 2, 3, 4] output = [] for number in numbers: output.append(data(number)) print(output)
Best Way:
numbers = [1, 2, 3, 4] result = map(lambda x: x ** 2, numbers) print(list(result))
-
Explain Django middlewire
-
Have you written any custom middlewire by yourself? If yes then please explain me how ?
-
Hove you ever use decorator function
-
Write a code for decorator as caching
-
Is django support multilayer docorator? If support then tell me which order are they works
-
Django request lifecycle
-
How django get data from database? or Explan how orm works
-
How django solve n+1 complex query
Answer: You can find the answer here -
What is the difference between select related and prefetch related
Answer: you can find a solid answer here -
Tell me the difference between get and filter method
filter()
will always give you aQuerySet
, even if only a single object matches the query - in this case, it will be a QuerySet containing a single element.If you know there is only one object that matches your query, you can use the
get()
method on a Manager which returns the object directly:one_entry = Entry.objects.get(pk=1)
You can use any query expression with get(), just like with filter() - again, see Field lookups below.
Note that there is a difference between using get(), and using filter() with a slice of [0]. If there are no results that match the query, get() will raise a DoesNotExist exception. This exception is an attribute of the model class that the query is being performed on - so in the code above, if there is no Entry object with a primary key of 1, Django will raise Entry.DoesNotExist.
-
Pickling QuerySets
-
Write the bast practice of writing django URLs.
- What is the perpose of serialization ?
- What is the benifit of using DRF?
- What problem solve by DRF?
- Write a class based view for crud operaton
- what need to import while creating a class based view?
Answer: APIView
-
Explain REST API Design Principles
Answer: You can find it here -
Tell me the different HTTP status code of REST API
Answer: You can find it here
-
If the request data is not available which status code will invioked ?
Status code: 404
-
Do you have ever implmented your code with SOLID principle? if YES then Explain solid principle
-
How unit test is related to SOLID principle
-
What are the befinfits of Unit test
-
What step should follow when designing a system
-
Which two key item you taking care when writing any kinda code.
-
Design a system which can upload content requirements: - System launched in 3 countries (Canada, Singapore , Australia)
-
Design a system for parking mantainance. Mention that what step you follow and describe each step
- What are the disadvantages of Hashing Algorithm