• LOGIN
  • No products in the cart.

Top 25+ Cognizant Interview Questions and Answers 2023

Cognizant Technology Solution (CTS) is an American multinational technology company that specializes in providing digital, technology, consulting, and operations services to businesses around the world. The company was founded in 1994 as Dun & Bradstreet Satyam Software (DBSS) by Kumar Mahadeva and his associates. DBSS initially provided software development and maintenance services to Dun & Bradstreet Corporation.

In 1996, DBSS became an independent company and changed its name to Satyam Enterprise Solutions Ltd. The company continued to provide software development services to its clients, and it expanded its operations by opening new offices in India and the United States.

In 2003, Satyam Enterprise Solutions Ltd. changed its name to Satyam Computer Services Ltd. and became a publicly traded company. The company’s growth continued, and by 2008, it had more than 50,000 employees and operations in more than 50 countries.

In 2011, Cognizant acquired Satyam Computer Services Ltd. and renamed it to Cognizant Technology Solutions India Pvt. Ltd. Today, Cognizant is one of the largest IT services companies in the world, with more than 300,000 employees and operations in over 40 countries. The company is headquartered in Teaneck, New Jersey, and is listed on the NASDAQ stock exchange.

  • Interview Process
  • Interview Questions for Freshers and Experienced
  • FAQ’s
  • Tips
  • Conclusion

Interview process

Generally, Cognizant’s Company Interview process is segregated into two rounds to select candidates.

  • Written test
  • Interview

Written Test

In this written test have 4 different categories of questions. They are,

  • Aptitude Questions: In this category may include questions on topics such as maths fundamentals, areas and volumes, time and speed, percentages, profit and loss, simple interest and compound interest, ratios, geometry etc.
  • Reasoning Questions: In this category may include the questions on topics such as Arithmetic reasoning, Alphabet test, Blood relations, coding and decoding, cubes and dices, etc.
  • English Assessment Question: In this category may include the questions on English topics such as synonyms and antonyms, verbal ability, etc.
  • Coding Questions: In this category may include the questions on topics such as programming languages like C, C++, Python, Java, etc.

Interview Round

Cognizant company conducts 2 types of Interview Rounds. They are,

  • TR Round: In this round may include the questions on technical subjects or academic subject topics such as C, C++, Software Engineering, Database Management System, R programming, Python, Operating System, Java, Data structures, etc.
  • HR Round: In this round may include the questions on topics such as self-introduction, strengths, weaknesses, skills, hobbies, etc.

Top 25 Infosys Interview Questions and Answers 2023

Technical Interview Questions

What is a C token?

In the C programming language, tokens are the smallest individual units of a program that have meaning to the compiler. C tokens can be classified into several types, including:

  1. Keywords: These are reserved words that have a special meaning in the C language, such as “int”, “float”, “if”, “while”, and “return”.
  2. Identifiers: These are names given to variables, functions, and other user-defined entities in a program. Identifiers must follow certain naming rules and cannot be the same as a C keyword.
  3. Constants: These are fixed values that cannot be changed during program execution, such as integer constants like 10 or character constants like ‘a’.
  4. Operators: These are symbols that perform operations on one or more operands, such as arithmetic operators like + and – or logical operators like && and ||.
  5. Special symbols: These are symbols that are used for special purposes in C, such as punctuation marks like ; and , or brackets like { and }.

When a C program is compiled, the compiler breaks down the code into tokens and then analyzes them to determine their syntactic and semantic meaning.

What is recursion in C?

Recursion is a programming technique in which a function calls itself either directly or indirectly. In C, a recursive function is a function that calls itself to solve a problem by breaking it down into smaller subproblems.

When a function is called recursively, a new instance of the function is created on the stack, with its own set of parameters and local variables. Each recursive call adds a new frame to the stack, and when the function returns, its frame is removed from the stack.

A recursive function typically has two parts: the base case and the recursive case. The base case is the condition that terminates the recursion, and the recursive case is the condition that calls the function again with a modified argument to get closer to the base case.

What is the difference between malloc() and calloc()?

Both malloc() and
calloc() are used in C to allocate memory dynamically, but they have some
differences in the way they allocate and initialize memory.

malloc() is used in C to allocate a block of memory of a specified size, in bytes. It returns a pointer to the first byte of the allocated memory block. The memory allocated by malloc() is not initialized, and its content is undefined.

Here’s an example of using malloc() to allocate an integer array of size 5:

            int*array=(int*) malloc(5*sizeof(int));

calloc() is used to reallocate a block of memory for an array of elements of a specified size. It takes two arguments: the number of elements to allocate, and the size of each element, in bytes. It returns a pointer to the first byte of the allocated memory block. The memory allocated by calloc() is initialized to zero.

 Here’s an example of using calloc() to allocate an integer array of size 5:

            Int*array=(int*) calloc(5, sizeof(int));

Why do we use a for loop?

A for loop is a control flow statement in computer programming that allows a program to execute a block of code repeatedly for a fixed number of times or until a specific condition is met.

Syntax:  for (initialization; condition; increment/decrement)

                {

                        // code to be executed repeatedly

                }

Here’s what happens during the execution of a for loop:

  1. The initialization statement is executed once, before the loop starts. It usually initializes a loop counter or a variable used in the condition.
  2. The condition is checked at the beginning of each iteration. If the condition is true, the code inside the loop is executed. If the condition is false, the loop is terminated and the program continues with the next statement after the loop.
  3. The code inside the loop is executed repeatedly until the condition becomes false. This is where the main work of the loop is done.
  4. The increment or decrement statement is executed at the end of each iteration, before the condition is checked again. It usually updates the loop counter or a variable used in the condition.

A for loop is used when you want to execute a block of code repeatedly for a fixed number of times or until a specific condition is met. It is often used to iterate over arrays or lists, to perform operations on each element of the collection. It is also useful for performing calculations or operations a fixed number of times.

For example, here’s a for loop that prints the first 10 even numbers:

      For (int i=0; i<10; i++)

      {

                        printf (“%d\n”, 2*i);

             }

In this example, the loop starts with the initialization of the variable ‘i’ to 0. The loop     continues to execute as long as i is less than 10 (the condition). The code inside the loop multiplies ‘i’ by 2 and prints the result. At the end of each iteration, ‘i’ is incremented by 1.

Overall, a for loop is a useful control structure that allows programs to execute code repeatedly for a fixed number of times or until a specific condition is met.

What is the right shift operator?

The right shift operator in C is denoted by ’>>’ and it is a binary operator that shifts the bits of a number to the right by a specified number of positions. The right shift operator takes two operands: the first operand is the number to be shifted, and the second operand is the number of positions to shift the bits.

Here’s an example of using the right shift operator in C:

    int a = 12; //binary representation: 00001100

    int b = a >> 2; 

In this example, the number a is first represented in binary as ‘00001100’. The right shift operator ‘>>’ is used to shift the bits of ‘a’ to the right by 2 positions, resulting in the binary value ‘00000011’ which is equal to the decimal value 3. The result is then stored in the variable ‘b’.

What is interpreted language?

An interpreted language is a type of programming language where the code is executed directly without prior compilation. In an interpreted language, the code is read line by line, and each line is executed immediately after it is read, without the need for a separate compilation step.

In an interpreted language, the source code is typically executed by an interpreter, which is a program that reads the code and executes it directly, without converting it to machine code beforehand. The interpreter translates each line of the code into machine code, or an intermediate representation, and then executes it immediately. This makes interpreted languages typically slower than compiled languages because they do not have the benefit of machine code optimization.

For example, Python, Java Script, Ruby and PHP are the interpreted languages.

What are the different types of data structures in python?

 Python provides several built-in data structures that can be used to store and organize data in different ways. Some of the most commonly used data structures in Python include:

  1. Lists: A list is a collection of elements that can be of any type, such as integers, strings, or even other lists. Lists are mutable, which means they can be modified after they are created.
  2. Tuples: A tuple is a collection of elements that is similar to a list, but it is immutable, which means it cannot be modified after it is created. Tuples are often used to store related pieces of information that should not be changed, such as a person’s name and age.
  3. Sets: A set is an unordered collection of unique elements. Sets are useful for eliminating duplicates and performing set operations such as union, intersection, and difference.
  4. Dictionaries: A dictionary is a collection of key-value pairs. Each key in the dictionary maps to a value, which can be of any type. Dictionaries are useful for storing and retrieving data based on a key, rather than an index.
  5. Arrays: An array is a collection of elements of the same data type, such as integers or floats. Arrays are useful for performing mathematical operations on large datasets.
  6. Stacks: A stack is a collection of elements that supports two main operations: push and pop. Elements are added to the top of the stack using the push operation, and removed from the top of the stack using the pop operation. Stacks are often used in algorithms that require last-in, first-out (LIFO) behaviour.
  7. Queues: A queue is a collection of elements that supports two main operations: enqueue and dequeue. Elements are added to the end of the queue using the enqueue operation, and removed from the front of the queue using the dequeue operation. Queues are often used in algorithms that require first-in, first-out (FIFO) behaviour.

These are some of the most commonly used data structures in Python, but there are many others available, such as linked lists, trees, and heaps. The choice of data structure depends on the specific requirements of the problem being solved.

What is the concatenation operator in the list?

In Python, you can concentrate two or more lists using the concatenation operator, which is the plus sign (+). When you use the + operator on two or more lists, it returns a new list that contains all the elements from both lists.

For example:

            List1 = [1,2]

            List2 = [3,4,5]

            Result = List1 + List2

            print(result)

Output: [1,2,3,4,5].

What are the string functions in python?

In Python, strings are treated as objects, and they have many built-in methods that can be used to manipulate and transform them.

  • len(): Returns the length of the string.
  • upper(): Converts all the characters in the string to uppercase.
  • lower(): Converts all the characters in the string to lowercase.
  • capitalize(): Converts the first character of the string to uppercase and the rest to lowercase.
  • title(): Converts the first character of each word in the string to uppercase.
  • strip(): Removes any whitespace characters from the beginning and end of the string.
  • replace(): Replaces all occurrences of a specified substring in the string with another substring.
  • split(): Splits the string into a list of substrings, using a specified separator.
  • join(): Joins a list of strings into a single string, using a specified separator.
  • count(): Returns the number of occurrences of a specified substring in the string.
  • isdigit(): Returns True if all the characters in the string are digits.

These are just a few examples of the many functions available for working with strings in Python. By combining these functions and using them in different ways, you can perform a wide range of operations on strings, such as searching for patterns, formatting text, and cleaning up input.

How is Java different from C++ ?

Java and C++ are both popular programming languages, but they have some significant differences in their design and use. Here are some of the key differences between Java and C++:

  1. Syntax: C++ uses syntax similar to the C programming language, whereas Java has a syntax that is closer to C#. The syntax of Java is generally considered to be easier to read and understand, especially for beginners.
  2. Memory management: C++ requires the programmer to explicitly manage memory, while Java uses a garbage collector to automatically free up memory when it is no longer needed. This makes Java programs more reliable and less prone to memory-related errors.
  3. Platform independence: Java is designed to be platform-independent, meaning that Java code can run on any platform that has a Java Virtual Machine (JVM) installed. C++, on the other hand, is compiled to machine code and must be recompiled for each platform on which it will run.
  4. Object-oriented programming: Both Java and C++ support object-oriented programming, but Java enforces certain rules that make it more “purely” object-oriented than C++. For example, in Java, all code must be encapsulated within a class, whereas in C++ code can exist outside of classes.
  5. Standard library: Both Java and C++ have extensive standard libraries, but they differ in their scope and functionality. Java’s standard library is larger and more comprehensive, with built-in support for things like networking and multithreading.
  6. Performance: C++ is generally considered to be faster than Java, particularly for programs that require high-performance computing or real-time processing. However, Java has improved significantly in recent years and can still deliver high performance for many applications.

Overall, both Java and C++ have their strengths and weaknesses, and choosing between them depends on the specific needs of your project. Java is often used for enterprise applications and web development, while C++ is used for system-level programming and performance-intensive applications.

What are the features of Python?

Python is a popular high-level programming language with a simple and elegant syntax that is widely used for web development, scientific computing, data analysis, artificial intelligence, and more. 

  1. Easy to Learn: Python has a simple and readable syntax that makes it easy to learn for beginners. The code is easy to write, read, and maintain.
  2. Interpreted: Python is an interpreted language, which means the code is executed line by line.
  3. Object-Oriented: Python supports object-oriented programming (OOP) concepts such as inheritance, polymorphism, and encapsulation. 
  4. Dynamically Typed: Python is dynamically typed, which means you don’t need to declare the variable type before using it. 
  5. Cross-Platform: Python code can be run on different platforms such as Windows, Linux, and Mac OS. It is also supported by a wide range of platforms and systems.
  6. Large Standard Library: Python comes with a large standard library that includes modules for various tasks such as web development, data analysis, and more. This makes it easy to accomplish complex tasks without having to write new code from scratch.
  7. Third-Party Libraries: Python has a large and active community that creates and maintains third-party libraries for various tasks such as web scraping, data visualization, and machine learning. 
  8. High-Level Language: Python is a high-level language, which means it abstracts away low-level details such as memory management and pointer manipulation. This makes it easy to write code quickly and focus on the problem at hand.
  9. Scalable: Python is a scalable language that can be used for small as well as large projects. It is widely used for developing web applications, scientific computing, data analysis, and more.

Tell us something about JVM?

JVM (Java Virtual Machine) is a key component of the Java programming language that provides a runtime environment in which Java code can be executed. The JVM is responsible for interpreting compiled Java bytecode and running it on the underlying hardware, making Java a platform-independent language.

Here are some key features and aspects of the JVM in Java:

  • Platform independent
  • Memory management
  • Just-In-Time (JIT)
  • Security
  • Class loading
  • Profiling and Debugging
  • Compatibility

What are the different types of constructors?

In object-oriented programming, a constructor is a special method that is called when an object is created. The main purpose of a constructor is to initialize the instance variables of an object. In Java, there are three types of constructors:

  1. Default Constructor: A default constructor is a constructor that is provided by the compiler if no constructor is defined in a class. It has no parameters and does not perform any initialization of instance variables.

Example:

public class MyClass {
  // default constructor
  public MyClass() {
  }
}

2.Parameterized Constructor: A parameterized constructor is a constructor that takes one or more parameters to initialize the instance variables of an object. It is used to provide different values to instance variables of different objects.

    Example:

public class MyClass {
  // default constructor
  public MyClass() {
  }
}

  • Copy Constructor: A copy constructor is a constructor that creates a new object with the same values as an existing object. It takes an object of the same class as a parameter and initializes the instance variables of the new object with the values of the existing object.

Example:

public class MyClass {
  int x;
  // copy constructor
  public MyClass(MyClass obj) {
    x = obj.x;
  }
}

Why do we use Inheritance in Java?

In Java, inheritance is a fundamental concept in object-oriented programming that allows you to create new classes based on existing classes. Inheritance provides a way to reuse code and establish a hierarchical relationship between classes.

Here are some common reasons why inheritance is used in Java:

  1. Code Reusability: Inheritance allows you to reuse code from an existing class by creating a new class that extends the existing class. This makes the code more maintainable and reduces redundancy.
  2. Code Extensibility: With inheritance, you can extend the functionality of an existing class by adding new methods or fields to the derived class. This allows you to build more complex systems with less code.
  3. Polymorphism: Inheritance is a key factor in achieving polymorphism in Java. Polymorphism allows you to write code that works with objects of different classes in a uniform way.
  4. Abstraction: Inheritance allows you to create abstract classes that can be used as a base for other classes. Abstract classes can define common methods and fields that can be inherited by other classes.
  5. Simplified coding: Inheritance can help reduce the amount of code needed to create a new class. By using inheritance, you can inherit methods and fields from existing classes instead of rewriting them from scratch.

Overall, inheritance is a powerful tool in Java that allows developers to create efficient, reusable, and maintainable code.

What is data abstraction?

Data abstraction is a fundamental concept in object-oriented programming that refers to the process of hiding implementation details and exposing only essential features of an object to the outside world.

In other words, data abstraction allows you to create a simplified view of an object that focuses on its essential properties and behaviours, while hiding unnecessary details that are not relevant to the object’s use. This makes it easier to work with complex systems and reduces the complexity of code. 

What is database and advantages of database?

A database is a collection of data that is organized in a way that allows it to be easily accessed, managed, and updated. Databases are commonly used in computer systems to store and retrieve large amounts of data quickly and efficiently.

Here are some advantages of using a database:

  1. Improved Data Management: Databases provide a centralized location for storing data, which makes it easier to manage and organize information. This can help reduce data redundancy, improve data accuracy, and ensure data integrity.
  2. Faster Data Access: Databases use indexing and other techniques to retrieve data quickly, making it possible to access large amounts of data in a matter of seconds. This is particularly important for businesses and organizations that need to process large amounts of data quickly.
  3. Enhanced Security: Databases provide built-in security features, such as user authentication and access controls, to help protect sensitive data from unauthorized access. This is particularly important for businesses that handle confidential or proprietary information.
  4. Improved Data Sharing: Databases allow multiple users to access and update data simultaneously, making it easier to collaborate and share information across different departments or locations.
  5. Better Decision Making: Databases provide powerful tools for data analysis and reporting, making it easier to identify trends, patterns, and insights that can inform decision making.

Overall, databases provide an efficient and effective way to manage and access data, which can help businesses and organizations operate more effectively and make better decisions.

Explain the difference between DELETE and TRUNCATE commands in DBMS?

Both the DELETE and TRUNCATE commands are used in a DBMS (Database Management System) to remove data from a table, but they work differently and have different effects.

DELETE Command: The DELETE command is used to remove one or more rows from a table. When you use the DELETE command, the table’s data is deleted row by row. The deleted rows can be retrieved by using the ROLLBACK command, as long as the transaction has not been committed yet. If you use the WHERE clause with the DELETE command, you can specify which rows to delete based on certain conditions. For example, you can delete all the records that have a specific value in a column.

TRUNCATE Command: The TRUNCATE command is used to remove all the rows from a table, and it works faster than the DELETE command because it removes all the data at once. When you use the TRUNCATE command, you cannot retrieve the deleted rows because the operation cannot be rolled back. The TRUNCATE command resets the identity of the table, and the table is treated as a new table. TRUNCATE operation does not need any space for the deleted records.

Explain the different types of keys in DBMS?

In a DBMS (Database Management System), keys are used to establish relationships between tables and to ensure the integrity and consistency of data. There are some keys of DBMS:

1.Primary Key: A primary key is a unique identifier that is used to identify each row in a table. The primary key must be unique and not null, and it can consist of one or more columns. The primary key is used as a reference to establish relationships between tables and to enforce data integrity rules.

2.Foreign Key: A foreign key is a column or set of columns that refer to the primary key of another table. A foreign key establishes a link between two tables, and it is used to enforce referential integrity constraints. The foreign key ensures that the data in the referencing table is consistent with the data in the referenced table.

3.Candidate Key: A candidate key is a set of one or more columns that can uniquely identify a row in a table. A table can have multiple candidate keys, but only one can be chosen as the primary key. The candidate key is used to establish relationships between tables and to ensure data integrity.

4.Unique Key: A unique key is a column or set of columns that can contain unique values, but it can contain null values. The unique key is used to enforce data integrity rules, and it ensures that each row in a table has a unique value for the specified columns.

5.Alternate Key: An alternate key is a candidate key that is not chosen as the primary key. An alternate key can also be used to establish relationships between tables and to enforce data integrity rules.

In summary, keys in DBMS are used to establish relationships between tables and to ensure data integrity and consistency. The primary key, foreign key, candidate key, unique key, and alternate key are the main types of keys used in DBMS.

What is binary data structure?

A binary tree is a hierarchical data structure that consists of nodes, each of which has at most two child nodes, referred to as the left child and the right child. The topmost node in the tree is called the root node, and each node in the tree can have zero, one, or two child nodes.

In a binary tree, each node can have a value associated with it, and the relationship between nodes is such that the value of the left child node is less than the value of the parent node, and the value of the right child node is greater than or equal to the value of the parent node. This property is known as the binary search tree property.

What are tree traversals?

Tree traversal refers to the process of visiting all the nodes in a tree data structure in a specific order. There are three main types of tree traversals:

  1. Inorder Traversal: In an inorder traversal, we visit the left subtree first, then the root node, and then the right subtree. In a binary search tree, an inorder traversal will produce the nodes in non-decreasing order.
  2. Preorder Traversal: In a preorder traversal, we visit the root node first, then the left subtree, and then the right subtree.
  3. Postorder Traversal: In a postorder traversal, we visit the left subtree first, then the right subtree, and then the root node.

In addition to these three main types of traversals, there are also several variations, such as level-order traversal and reverse order traversal.

Top 25 TCS Interview Questions and Answers 2023

Frequently Asked Questions

How long would you expect to work for us?

I do not work in the traditional sense, so I don’t have a specific time frame for working with you. I am designed to provide assistance and answer questions to the best of my ability for as long as I am needed. My performance is not affected by the duration of our interaction.

Are you comfortable working in a team?

Yes, I am not capable of experiencing emotions or forming preferences, so I do not have a personal comfort level or preference for working in a team. However, I am designed to be able to interact with multiple users simultaneously, and I can integrate with other software systems to provide a seamless experience. In that sense, I am well-suited to working as part of a team, and my capabilities can be leveraged to enhance the overall productivity and efficiency of the team.

What are the basic questions asked in a cognizant interview?

The specific questions asked in a cognizant interview can vary depending on the role, level of experience, and interviewer’s approach. So, it’s important to research the position you’re applying for and prepare accordingly. In addition to technical questions, Cognizant interviews may also include behavioural questions to assess your communication skills, team management, and other relevant competencies.

Is a cognizant interview hard?

The difficulty of a Cognizant interview can depend on various factors, such as the position being applied for, the level of experience required, and the interviewer’s approach. Generally, Cognizant interviews are designed to assess the candidate’s technical skills, problem-solving abilities, and communication skills. They may also involve questions related to the company’s values, culture, and work ethics. 

How do I get selected for Cognizant?

To increase your chances
of getting selected for a role in Cognizant, here are some tips: 

  • Research the company
  • Customize your resume and cover letter
  • Prepare for the interview
  • Showcase your skills and experience
  • Follow-up after the interview
  • Keep improving

Tips

Sure! Here are some tips to help you crack a Cognizant interview:

  • Speak clearly: To speak clearly means to communicate in a way that is easy to understand and comprehend. It involves enunciating words accurately, using proper pronunciation, and speaking at an appropriate pace and volume
  • Listen patiently: To listen patiently means to give someone your full attention while they speak, without interrupting or judging them. It involves being present in the moment and focusing on the speaker’s words and emotions, rather than thinking about your response or trying to change the subject.
  • Highlight your skills and achievements: When highlighting your skills and achievements, it’s important to focus on what makes you stand out from other candidates and demonstrate your value to the employer.
  • Use positive body language: Positive body language can help you to convey confidence, openness, and enthusiasm in a job interview or any other social situation.

Top 25 IBM Interview Questions and Answers 2023

Conclusion

In conclusion, Cognizant is a multinational technology company that offers a wide range of services, including digital, consulting, and operations. The company has a strong reputation for innovation and is known for its customer-centric approach. With a focus on developing its employees and creating a positive work culture, Cognizant offers excellent career opportunities for professionals in the technology industry. As a potential employer, Cognizant values diversity, teamwork, and creativity, making it an excellent choice for those seeking a challenging and rewarding career in the technology sector.

GoLogica Technologies Private Limited. All rights reserved 2024.