Cognizant
10+ Alum Forms Interview Questions and Answers
Q1. Tell me the logic of program to reverse a given string word by word without using any built in function.
The logic of the program is to reverse a given string word by word without using any built-in function.
Split the string into an array of words using whitespace as the delimiter.
Iterate through the array of words in reverse order.
Append each word to a new string, separated by a space.
Q2. What is the difference between variable and object?
Variables are names given to memory locations while objects are instances of a class with attributes and methods.
Variables are used to store values while objects are used to represent real-world entities.
Variables can be reassigned to different values while objects have a fixed identity.
Variables are created when they are assigned a value while objects are created using constructors.
Variables can be of different data types while objects are instances of a specific class.
Examp...read more
Q3. Have you done anything on python related developments.
Yes, I have worked on various python projects including web development, data analysis and automation.
Developed a web application using Django framework
Automated data extraction and analysis using pandas library
Created a chatbot using Python and Dialogflow API
Implemented machine learning algorithms for predictive analysis
Integrated Python scripts with other technologies like AWS and Docker
Q4. What is decorator?why we are using decorator? Write a program for decorator?
A decorator is a design pattern in Python that allows modifying the behavior of a function or class without changing its source code.
Decorators are functions that take another function as an argument and return a new function.
They are used to add functionality to an existing function or class.
They can be used to modify the behavior of a function, such as adding logging or timing functionality.
They can also be used to enforce security or access control.
A decorator is denoted b...read more
Q5. What is inheritance and what are its types?
Inheritance is a way to create a new class by inheriting properties and methods from an existing class.
It allows code reusability and saves time.
Types of inheritance are single, multiple, multilevel, and hierarchical.
Single inheritance involves inheriting properties and methods from a single parent class.
Multiple inheritance involves inheriting properties and methods from multiple parent classes.
Multilevel inheritance involves inheriting properties and methods from a parent c...read more
Q6. Have you heard about pickling and non pickling?
Pickling is a way to serialize Python objects, while non-pickling refers to objects that cannot be pickled.
Pickling is used to convert Python objects into a byte stream that can be stored or transmitted.
Non-pickling objects are those that cannot be serialized using the pickle module.
Examples of non-pickling objects include file objects, network sockets, and database connections.
To make an object picklable, it must be able to be reduced to a string of bytes and then reconstruc...read more
Q7. Find second highest number from list without using inbuilt functions
Find second highest number from list without using inbuilt functions
Sort the list in descending order
Return the second element of the sorted list
Q8. Have you heard about init method?
Yes, init method is a special method in Python classes used to initialize objects.
The init method is called automatically when an object is created from a class.
It is used to set initial values for object attributes.
The init method always takes the 'self' parameter as the first argument.
Example: def __init__(self, name, age): self.name = name; self.age = age
The init method can also be used to perform any other setup or initialization tasks.
Q9. How do you rate yourself in python
I rate myself as an experienced Python developer with strong skills in various Python libraries and frameworks.
I have worked on various Python projects and have a good understanding of the language syntax and concepts.
I am proficient in using popular Python libraries such as NumPy, Pandas, and Matplotlib for data analysis and visualization.
I have experience in developing web applications using Python frameworks such as Django and Flask.
I am familiar with using Python for mach...read more
Q10. Why python is used in reality
Python is used in reality due to its simplicity, versatility, and wide range of applications.
Python is easy to learn and read, making it a popular choice for beginners.
It has a large standard library and many third-party modules, allowing for rapid development.
Python is used in web development, data analysis, machine learning, scientific computing, and more.
It is cross-platform and can run on various operating systems.
Python is also used in automation, scripting, and testing....read more
Q11. Difference between tuple and list.
Tuple is immutable and ordered while list is mutable and ordered.
Tuple uses () while list uses []
Tuple is faster than list for accessing elements
Tuple can be used as keys in dictionaries while list cannot
Tuple can be used in string formatting while list cannot
Q12. Give one recursion problem .
One recursion problem is to find the factorial of a number.
The base case is when the number is 0 or 1.
The recursive case is to multiply the number with the factorial of (number-1).
Example: factorial(5) = 5 * factorial(4) = 5 * 4 * factorial(3) = ... = 5 * 4 * 3 * 2 * 1 = 120.
More about working at Cognizant
Interview Process at Alum Forms
Top Python Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month