Accenture
Bitek Solar Interview Questions and Answers
Q1. 2.Write a program to print a string in reverse without using built in methods?
This program reverses a given string without using any built-in methods.
Iterate through the string from the last character to the first character.
Append each character to a new string to reverse the order.
Return the reversed string as the output.
Q2. Sum of unique numbers in the list
Find the sum of unique numbers in a list.
Create an empty set to store unique numbers
Loop through the list and add each number to the set
Sum up the numbers in the set
Q3. Name commonly used inbuilt functions of Python
Commonly used inbuilt functions of Python
print() - prints output to console
len() - returns length of an object
range() - generates a sequence of numbers
type() - returns type of an object
str() - converts an object to string
int() - converts a string or float to integer
float() - converts a string or integer to float
list() - creates a list
dict() - creates a dictionary
set() - creates a set
Q4. Count key frequency in dictionary
Count the frequency of keys in a dictionary.
Use a loop to iterate through the keys in the dictionary.
For each key, use the count() method to count its frequency.
Store the key and its frequency in a new dictionary.
Q5. what is namespace and its types?
Namespace is a way to organize variables and functions in a program to avoid naming conflicts.
Namespace helps in avoiding naming conflicts by providing a unique space for each identifier.
Types of namespaces include global namespace, local namespace, built-in namespace, and module namespace.
Example: In Python, each module has its own namespace where all the variables and functions defined in that module reside.
Q6. define lambda function and give an example?
Lambda function is an anonymous function defined using the lambda keyword in Python.
Lambda functions are used for creating small, one-time use functions without a name.
Syntax: lambda arguments: expression
Example: double = lambda x: x * 2
Q7. write code to explain multiple inheritance
Multiple inheritance in Python allows a class to inherit attributes and methods from more than one parent class.
Python supports multiple inheritance by allowing a class to inherit from multiple parent classes.
The order of parent classes in the inheritance list matters, as methods are searched for in the order they appear.
Diamond problem can occur in multiple inheritance when two parent classes have a common ancestor class.
Super() function can be used to call methods from pare...read more
Q8. difference between list & tuple?
List is mutable, tuple is immutable in Python.
List uses square brackets [], tuple uses parentheses ().
List elements can be changed, added, or removed, tuple elements cannot be changed.
Lists are used for collections of items that may need to be modified, tuples are used for fixed collections of items.
Example: list_example = [1, 2, 3], tuple_example = (4, 5, 6)
More about working at Accenture
Interview Process at Bitek Solar
Top Python Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month