Josh Software
Cognizant Interview Questions and Answers
Q1. What are different software development models?
Software development models are frameworks used to structure, plan, and control the process of developing software.
Waterfall model
Agile model
Spiral model
Iterative and incremental model
V-shaped model
Prototype model
Q2. difference between authentication and authorization
Authentication verifies the identity of a user, while authorization determines what actions a user is allowed to perform.
Authentication confirms the user's identity through credentials like username and password
Authorization controls access to resources based on the authenticated user's permissions
Example: Logging into a system (authentication) vs. accessing specific files or features within the system (authorization)
Q3. What are async functions?
Async functions in JavaScript allow for asynchronous programming using the async/await syntax.
Async functions are defined using the 'async' keyword before the function declaration.
They allow for the use of the 'await' keyword within the function to pause execution until a promise is settled.
Async functions always return a promise.
Example: async function fetchData() { await fetch('https://api.example.com/data'); }
Q4. What are node modules>?
Node modules are reusable code packages that can be easily imported and used in Node.js applications.
Node modules are JavaScript libraries that can be easily installed using npm (Node Package Manager).
They help in organizing code, improving code reusability, and managing dependencies.
Examples of popular node modules include Express.js for web applications, Lodash for utility functions, and Mongoose for MongoDB interactions.
Q5. what is runtime polymorphism
Runtime polymorphism is the ability of a function to behave differently based on the object it is called with.
Runtime polymorphism is achieved through method overriding in object-oriented programming.
It allows a subclass to provide a specific implementation of a method that is already provided by its superclass.
The actual method that gets called is determined at runtime based on the type of object.
Example: Animal class has a method 'makeSound', Dog and Cat classes override th...read more
Q6. What are promises?
Promises are objects representing the eventual completion or failure of an asynchronous operation.
Promises are used to handle asynchronous operations in JavaScript.
They can be in one of three states: pending, fulfilled, or rejected.
Promises can be chained together using .then() to handle success and failure.
Example: new Promise((resolve, reject) => { ... }).then(result => { ... }).catch(error => { ... });
Q7. difference between c and cpp
C is a procedural programming language while C++ is a multi-paradigm programming language with object-oriented features.
C is a procedural programming language, while C++ supports both procedural and object-oriented programming.
C does not support classes and objects, while C++ does.
C does not have features like inheritance, polymorphism, and encapsulation, which are supported in C++.
C++ has additional features like templates, exceptions handling, and namespaces which are not p...read more
Q8. what is polymorphism
Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
It enables a single interface to represent multiple data types.
Examples include method overloading and method overriding in object-oriented programming.
Q9. explain merge sort with code
Merge sort is a divide and conquer algorithm that recursively splits an array into halves, sorts them, and then merges them back together.
Divide the array into two halves
Recursively sort each half
Merge the sorted halves back together
Interview Process at Cognizant
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month