Northcorp Software
Lloyd Healthcare Interview Questions and Answers
Q1. What is the difference between a list and a tuple in python?
List is mutable, tuple is immutable in Python.
List is mutable, meaning its elements can be changed after creation.
Tuple is immutable, meaning its elements cannot be changed after creation.
List is defined using square brackets [], tuple using parentheses ().
Example: list_example = [1, 2, 3], tuple_example = (4, 5, 6)
Q2. If a number is divisible by 2 (number % 2 == 0), it is even ; otherwise, it is odd.
A number is even if it is divisible by 2, otherwise it is odd.
Use the modulo operator (%) to check if a number is divisible by 2.
If number % 2 == 0, then the number is even.
For example, 4 % 2 == 0, so 4 is even; 5 % 2 != 0, so 5 is odd.
Q3. Write a short program to check if a number is even or odd?
A simple program to determine if a number is even or odd.
Use the modulo operator (%) to check if the number divided by 2 leaves a remainder
If the remainder is 0, the number is even. Otherwise, it is odd
Example: num = 6, 6 % 2 = 0 (even); num = 7, 7 % 2 = 1 (odd)
Q4. What is Python generator?
Python generator is a function that returns an iterator object which can be iterated over.
Generators are created using a function with 'yield' statement instead of 'return'.
They allow you to iterate over a sequence of items without creating the entire sequence in memory at once.
Generators are memory efficient and can be used to generate an infinite sequence of items.
Example: def my_generator(): for i in range(5): yield i
Example: gen = my_generator() print(next(gen)) # Output:...read more
Q5. A functions that yields values lazily.
A generator function in Python yields values one at a time, allowing for lazy evaluation.
Use the 'yield' keyword in a function to return values lazily
Generators are memory efficient as they only compute values as needed
Example: def lazy_generator(): for i in range(5): yield i
Call the generator function using next() to get the next value
Q6. What is ETL pipeline?
ETL pipeline stands for Extract, Transform, Load pipeline used to extract data from various sources, transform it, and load it into a data warehouse.
ETL pipeline involves extracting data from multiple sources such as databases, APIs, files, etc.
The extracted data is then transformed by cleaning, filtering, aggregating, and structuring it for analysis.
Finally, the transformed data is loaded into a data warehouse or database for further analysis and reporting.
Popular tools for ...read more
Interview Process at Lloyd Healthcare
Top Python Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month