
Cognizant


100+ Cognizant GenC Interview Questions and Answers
Q101. define array?
An array is a collection of elements of the same data type, stored in contiguous memory locations.
Arrays can be of any data type, including integers, floats, and objects.
Arrays are accessed using an index, starting from 0.
Arrays can be initialized with a fixed size or dynamically resized.
Example: string[] names = {"John", "Jane", "Bob"};
Example: int[] numbers = new int[5];
Example: object[] objects = new object[3] {1, "hello", true};
Q102. OOPs in java
OOPs in Java is a programming paradigm that focuses on objects and their interactions.
Encapsulation, Inheritance, Polymorphism, and Abstraction are the four pillars of OOPs in Java.
Encapsulation is the process of hiding implementation details from the user.
Inheritance is the process of inheriting properties and methods from a parent class.
Polymorphism is the ability of an object to take on many forms.
Abstraction is the process of hiding implementation details while showing on...read more
Q103. oops in detail
Object-oriented programming paradigm that focuses on data encapsulation, inheritance, and polymorphism.
Encapsulation: bundling of data and methods that manipulate the data within a single unit
Inheritance: ability of a class to inherit properties and methods from a parent class
Polymorphism: ability of objects to take on multiple forms or behaviors depending on the context
Examples: Java, C++, Python
Q104. code for factorial
Factorial code calculates the product of all positive integers up to a given number.
Use a loop to multiply all positive integers up to the given number
Handle edge cases like 0 and negative numbers
Example: Factorial of 5 is 5*4*3*2*1 = 120
Q105. Libraries in python
Python has a rich set of libraries for various purposes.
Python standard library provides modules for file I/O, regular expressions, networking, and more.
Third-party libraries like NumPy, Pandas, Matplotlib, and Scikit-learn are widely used for data analysis and machine learning.
Python also has libraries for web development, game development, GUI programming, and more.
Libraries can be installed using pip, the package manager for Python.
Libraries can be imported using the impor...read more
More about working at Cognizant







Top HR Questions asked in Cognizant GenC
Interview Process at Cognizant GenC



Reviews
Interviews
Salaries
Users/Month

