
Cognizant


20+ Cognizant Software Engineer Interview Questions and Answers for Freshers
Q1. two puzzles: 1. how can you cut a cake in 8 pieces in minimum number of cuts(answered) ,2.make 4 equilateral triangles using 6 matchsticks(answered)
1. Cut cake in 8 pieces in minimum cuts. 2. Make 4 equilateral triangles using 6 matchsticks.
1. Cut cake in half horizontally and vertically. Cut each quarter diagonally.
2. Use 3 matchsticks to form a triangle. Use the other 3 to connect the centers of each triangle.
Both puzzles require creative thinking and problem-solving skills.
Q2. Write a query to find the employee name who earns maximum salary
The query finds the employee name who earns the maximum salary.
Use the SELECT statement to retrieve the employee name and salary from the database table.
Use the ORDER BY clause to sort the results in descending order based on salary.
Use the LIMIT clause to limit the result to only one row.
Return the employee name from the query result.
Q3. TC questions: Types of datatypes? Predefined functions? Difference between list and tree? Who is more preferred? Difference between class and object? Difference between inheritance and polymorphism? Aptitude qu...
read moreInterview questions for Software Engineer position
Datatypes: int, float, string, boolean, etc.
Predefined functions: print(), len(), range(), etc.
List is linear while tree is hierarchical. Trees are preferred for faster search and insertion.
Class is a blueprint while object is an instance of a class.
Inheritance is a way to create a new class from an existing class while polymorphism is the ability of an object to take on many forms.
Aptitude question on time may involve calcula...read more
Q4. what are different phases of waterfall model?
Waterfall model has five phases: requirements, design, implementation, testing, and maintenance.
Requirements phase: gathering and documenting requirements
Design phase: creating a detailed design based on requirements
Implementation phase: coding and integrating components
Testing phase: verifying that the system meets requirements
Maintenance phase: making changes and updates to the system
Example: building a website using waterfall model
Example: developing a software application...read more
Q5. difference between 8085 and 8086 microprocessor
8086 is an advanced version of 8085 with more features and capabilities.
8086 has a 16-bit data bus while 8085 has an 8-bit data bus.
8086 has more registers than 8085.
8086 has a higher clock speed than 8085.
8086 supports virtual memory while 8085 does not.
8086 has a more advanced instruction set than 8085.
Example: 8086 can perform multiplication and division operations while 8085 cannot.
Q6. What is variable, structure some basic code in that
A variable is a container that holds a value. A structure is a collection of variables of different data types.
Variables are declared with a data type and a name, and can be assigned a value.
Structures are declared using the 'struct' keyword and can contain variables of different data types.
Example code: int age = 25; struct person { char name[20]; int age; float height; };
Variables and structures are fundamental concepts in programming and are used extensively in software de...read more
Q7. Sort the array and write a code for searching array element
Sort and search an array in software engineering interview
Use built-in sorting functions or implement your own sorting algorithm
For searching, use linear search or binary search depending on the size of the array
Consider the time complexity of the sorting and searching algorithms
Ensure the code is efficient and handles edge cases properly
Q8. what is the difference between java 7 and java 8
Java 8 introduced new features like lambda expressions, streams, and default methods compared to Java 7.
Java 8 introduced lambda expressions for functional programming.
Java 8 added streams API for processing collections in a functional style.
Java 8 introduced default methods in interfaces to allow adding new methods to interfaces without breaking existing implementations.
Java 8 included the new Date and Time API (java.time) to address the shortcomings of the old java.util.Dat...read more
Q9. skeleton of html , what is variables?
Variables in HTML are used to store and manipulate data within a web page.
Variables in HTML are typically used in conjunction with JavaScript to store and manipulate data.
They are declared using the 'var' keyword.
Variables can store various types of data such as strings, numbers, and booleans.
Example: var name = 'John';
Q10. What is design patterns in java
Design patterns are reusable solutions to common software problems in Java.
Design patterns provide a standard way to solve common problems in software development.
They help in creating flexible, reusable, and maintainable code.
Examples of design patterns include Singleton, Factory, Observer, and Decorator.
Design patterns can be categorized into three types: creational, structural, and behavioral.
Q11. draw pin diagram of 8085 microprocessor
Pin diagram of 8085 microprocessor
8085 has 40 pins in total
Pins are grouped into 5 categories: power supply, address bus, data bus, control and status signals
Pin 1 is the reset pin, Pin 40 is the Vcc pin
Examples of control signals: RD, WR, ALE, INT, HOLD
Examples of status signals: S0, S1, IO/M, HLDA
Q12. what is opamp?
Opamp stands for operational amplifier. It is an electronic device used to amplify and process signals.
Opamps have high gain and can amplify signals to a very high degree.
They are commonly used in audio amplifiers, filters, and signal processing circuits.
Opamps have two input terminals and one output terminal.
They can be configured in different ways to perform various functions such as amplification, filtering, and oscillation.
Examples of opamps include LM741, LM358, and TL08...read more
Q13. What is stack?
A stack is a data structure that follows the Last In First Out (LIFO) principle.
Elements are added to the top of the stack and removed from the top.
Common operations include push (add element) and pop (remove element).
Stacks are used in programming for function calls, expression evaluation, and memory management.
Q14. Explain the term inheritance?
Inheritance is a mechanism in object-oriented programming where a new class is created by inheriting properties of an existing class.
Inheritance allows code reusability and saves time and effort in writing new code.
The existing class is called the parent or base class, and the new class is called the child or derived class.
The child class inherits all the properties and methods of the parent class and can also add its own unique properties and methods.
For example, a class 'An...read more
Q15. What is an array?
An array is a collection of elements of the same data type, stored in contiguous memory locations.
Arrays can be one-dimensional or multi-dimensional
Elements in an array can be accessed using their index
Arrays can be initialized with values at declaration
Examples: int[] numbers = {1, 2, 3}; char[] letters = {'a', 'b', 'c'};
Arrays have a fixed size once declared
Q16. Explain data type in c?
Data type in C refers to the type of data that a variable can hold.
C has basic data types like int, float, char, double, etc.
Derived data types like arrays, pointers, structures, and unions can also be created.
Each data type has a specific range of values that it can hold.
Data types can be modified using type qualifiers like const, volatile, etc.
Q17. code to remove duplicate entries in a string
Code to remove duplicate entries in a string
Create an empty array to store unique strings
Iterate through each string in the input array
Check if the string is already in the unique array, if not add it
Q18. What is synchronisation in java.
Synchronization in Java is the process of controlling access to shared resources by multiple threads.
Synchronization is achieved using the synchronized keyword in Java.
It ensures that only one thread can access the shared resource at a time.
Synchronization can be applied to methods or blocks of code.
It is used to prevent race conditions and ensure thread safety.
Example: synchronized void myMethod() { //code }
Example: synchronized(this) { //code }
Q19. types of testing
Types of testing include unit, integration, system, acceptance, regression, performance, and security testing.
Unit testing: testing individual units or components of the software
Integration testing: testing how different units or components work together
System testing: testing the entire system as a whole
Acceptance testing: testing to ensure the software meets the requirements and is ready for release
Regression testing: testing to ensure changes or updates to the software do ...read more
Q20. Write string reverse program
Program to reverse a given string.
Iterate through the string from end to start and append each character to a new string.
Use built-in functions like reverse() or slice() in some programming languages.
Convert the string to an array, reverse the array, and then join the array back into a string.
Q21. What is gibs free energy?
Gibbs free energy is a thermodynamic potential that measures the maximum amount of work that can be obtained from a system.
It is denoted by the symbol G.
It takes into account both the enthalpy and entropy of a system.
A negative value of G indicates that a reaction is spontaneous.
It is used to predict the feasibility of a chemical reaction.
It is also used in the study of phase transitions and the stability of materials.
Q22. Write a program using recursion
A program using recursion
Recursion is a technique where a function calls itself to solve a problem
It involves a base case and a recursive case
Examples include factorial, Fibonacci sequence, and binary search
Q23. What is the class?
A class is a blueprint for creating objects that have similar attributes and methods.
A class is a user-defined data type that encapsulates data and functions.
It is a template for creating objects.
It provides a way to organize and structure code.
Objects are instances of a class.
Classes can inherit properties and methods from other classes.
Examples include String, Integer, and List in Java.
Q24. 2. Explain the OOPs concepts
OOPs concepts are the fundamental principles of Object-Oriented Programming.
Abstraction: Hiding implementation details and showing only necessary information.
Encapsulation: Binding data and functions together to protect data from outside interference.
Inheritance: Acquiring properties and behavior of a parent class by a child class.
Polymorphism: Ability of an object to take many forms or have multiple behaviors.
More about working at Cognizant







Top HR Questions asked in Cognizant Software Engineer for Freshers
Interview Process at Cognizant Software Engineer for Freshers

Top Software Engineer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

