Add office photos
Engaged Employer

Cognizant

3.7
based on 52.1k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

200+ SRR Projects Interview Questions and Answers

Updated 29 Mar 2025
Popular Designations

Q101. How to perform type casting in Java

Ans.

Type casting in Java is the process of converting one data type into another.

  • Use the syntax (newType) variableName to perform type casting.

  • Type casting can be done implicitly or explicitly.

  • Explicit type casting is done by the programmer and may result in data loss if the new type cannot hold the original value.

Add your answer

Q102. What is ML and random forest classifier

Ans.

ML stands for Machine Learning, a subset of AI that uses algorithms to learn from data and make predictions. Random Forest is an ensemble learning method that creates multiple decision trees and combines their predictions.

  • ML is a subset of AI that uses algorithms to learn from data and make predictions

  • Random Forest is an ensemble learning method that creates multiple decision trees and combines their predictions

  • Random Forest is used for classification and regression tasks

  • Rand...read more

Add your answer

Q103. What about python language?

Ans.

Python is a high-level programming language known for its simplicity and readability.

  • Python is widely used for web development, data analysis, artificial intelligence, and scientific computing.

  • It has a large standard library and supports multiple programming paradigms.

  • Python code is easy to read and maintain, making it a popular choice for beginners and experienced programmers alike.

Add your answer

Q104. difference between spring versus spring boot

Ans.

Spring is a framework for building Java applications, while Spring Boot is an extension that simplifies the setup and development process.

  • Spring is a comprehensive framework that provides various modules for building Java applications.

  • Spring Boot is an extension of the Spring framework that simplifies the setup and development process by providing defaults and auto-configuration.

  • Spring Boot includes embedded servers, which makes it easier to deploy applications.

  • Spring Boot re...read more

Add your answer
Discover SRR Projects interview dos and don'ts from real experiences

Q105. write to code to check string is anagram or not

Ans.

Code to check if two strings are anagrams

  • Create a function that takes in two strings as input

  • Convert both strings to lowercase and remove any spaces

  • Sort both strings and compare if they are equal to determine if they are anagrams

  • Example: 'listen' and 'silent' are anagrams

Add your answer

Q106. WhatsApp function and limitations

Ans.

WhatsApp is a messaging app that allows users to send text, voice, and video messages, make voice and video calls, and share media.

  • WhatsApp is available on both iOS and Android platforms.

  • Users can create groups and broadcast lists for messaging.

  • WhatsApp has end-to-end encryption for secure messaging.

  • The app has a file size limit of 100 MB for media sharing.

  • WhatsApp has a limit of 256 members in a group.

Add your answer
Are these interview questions helpful?

Q107. Swapping of two numbers using temp variable

Ans.

Swapping two numbers using a temporary variable in programming.

  • Declare three variables: a, b, temp.

  • Assign values to a and b.

  • Store the value of a in temp.

  • Assign the value of b to a.

  • Assign the value of temp to b.

  • Now a and b have been swapped.

Add your answer

Q108. What is DBMS and Group By?

Ans.

DBMS is a software system that manages databases. Group By is a clause used in SQL to group rows based on a column.

  • DBMS stands for Database Management System

  • It is used to manage and organize data in a database

  • Group By is a clause used in SQL to group rows based on a column

  • It is used with aggregate functions like SUM, COUNT, AVG, etc.

  • For example, SELECT department, COUNT(*) FROM employees GROUP BY department;

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q109. How to train models in ML?

Ans.

Training models in ML involves selecting appropriate algorithms, preparing data, and tuning hyperparameters.

  • Select an appropriate algorithm based on the problem and data

  • Prepare the data by cleaning, preprocessing, and splitting into training and testing sets

  • Train the model on the training set using the chosen algorithm

  • Evaluate the model's performance on the testing set

  • Tune hyperparameters to improve model performance

  • Repeat the process with different algorithms and parameters ...read more

Add your answer

Q110. 3) Why you use AA over Uipath?

Ans.

AA has better OCR capabilities and is more user-friendly than UiPath.

  • AA has a more intuitive interface, making it easier for non-technical users to create automation workflows.

  • AA has better OCR capabilities, allowing it to read and interpret text from images more accurately than UiPath.

  • AA has a larger library of pre-built automation components, making it easier to create complex workflows quickly.

  • UiPath is better suited for developers who prefer more control over the automati...read more

Add your answer

Q111. Write a prog to reverse a string.

Ans.

Program to reverse a string using array of characters.

  • Create an array of characters to store the input string.

  • Use a loop to iterate through the input string and store each character in the array.

  • Reverse the array of characters to get the reversed string.

Add your answer

Q112. What is Planned independent requirement?

Ans.

Planned independent requirement is a demand for a product that is independent of other demands.

  • It is a forecast of future demand for a product

  • It is not influenced by any other demand

  • It is used to plan production and procurement

  • Examples include new product launches and seasonal demand

Add your answer

Q113. What is Cloud Computing

Ans.

Cloud computing is the delivery of computing services over the internet.

  • Cloud computing allows users to access data and applications from anywhere with an internet connection.

  • It offers scalability, flexibility, and cost-effectiveness compared to traditional on-premises computing.

  • Examples include Amazon Web Services, Microsoft Azure, and Google Cloud Platform.

Add your answer

Q114. Write a program on inheritance

Ans.

A program demonstrating inheritance in programming

  • Inheritance allows a class to inherit properties and methods from another class

  • The derived class can add its own properties and methods

  • Inheritance promotes code reusability and modularity

  • Example: Creating a base class 'Animal' with properties like 'name' and 'age', and a derived class 'Dog' inheriting from 'Animal' with an additional property 'breed'

View 2 more answers

Q115. Q. Difference between blocked and withdrawn

Ans.

Blocked means prevented from proceeding further, while withdrawn means removed from consideration or participation.

  • Blocked refers to a temporary halt in progress, while withdrawn is a permanent removal.

  • Blocked can be due to external factors, while withdrawn is a voluntary action.

  • Examples of blocked include a blocked website or a blocked road, while examples of withdrawn include a withdrawn job application or a withdrawn investment.

  • Blocked can be resolved, while withdrawn cann...read more

Add your answer

Q116. What is Reuse? How to define it

Ans.

Reuse is the practice of using existing code or components to create new software.

  • Reuse saves time and effort by avoiding the need to write new code from scratch.

  • It can improve software quality by using tested and proven components.

  • Examples of reuse include libraries, frameworks, and modules.

  • Reuse can also refer to the practice of repurposing hardware or other resources.

  • Effective reuse requires careful planning and documentation.

Add your answer

Q117. What is object oriented programming

Ans.

Object oriented programming is a programming paradigm that uses objects to represent and manipulate data.

  • Objects encapsulate data and behavior

  • Classes define the blueprint for objects

  • Inheritance allows for the creation of subclasses with shared characteristics

  • Polymorphism allows for objects to take on multiple forms

  • Examples include Java, Python, and C++

Add your answer

Q118. What are the four pillar of OOPS

Ans.

Encapsulation, Inheritance, Polymorphism, Abstraction

  • Encapsulation: Bundling data and methods that operate on the data into a single unit

  • Inheritance: Ability of a class to inherit properties and behavior from another class

  • Polymorphism: Ability to present the same interface for different data types

  • Abstraction: Hiding the complex implementation details and showing only the necessary features

Add your answer

Q119. What is Emotional Intelligence

Ans.

Emotional Intelligence is the ability to recognize, understand and manage our own emotions and the emotions of others.

  • It involves self-awareness and self-regulation

  • It also involves empathy and social skills

  • Emotional intelligence can be developed and improved through practice

  • Example: A manager who is able to understand and manage their own emotions, as well as empathize with their employees, is likely to have a more positive and productive work environment

Add your answer

Q120. Difference between array and link list.

Ans.

Arrays are fixed in size and store data in contiguous memory locations, while linked lists are dynamic and store data in nodes with pointers to the next node.

  • Arrays have constant time access to elements, while linked lists require traversal to access elements.

  • Insertion and deletion are faster in linked lists as they only require updating pointers, while arrays may require shifting elements.

  • Arrays are better for random access and have better cache locality, while linked lists ...read more

Add your answer

Q121. 2. Oops concepts and basic examples

Ans.

Oops concepts are fundamental to object-oriented programming. They include inheritance, polymorphism, encapsulation, and abstraction.

  • Inheritance: allows a class to inherit properties and methods from another class

  • Polymorphism: the ability of objects to take on multiple forms

  • Encapsulation: the practice of hiding data and methods within a class

  • Abstraction: the process of hiding complex implementation details and exposing only necessary information

  • Example: A car class can inheri...read more

Add your answer

Q122. 4 pillars of object oriented programming

Ans.

The 4 pillars of OOP are Abstraction, Encapsulation, Inheritance, and Polymorphism.

  • Abstraction: Hiding implementation details and showing only necessary information.

  • Encapsulation: Binding data and functions together to protect data from outside interference.

  • Inheritance: Creating new classes from existing ones, inheriting properties and methods.

  • Polymorphism: Using a single interface to represent multiple types of objects.

Add your answer

Q123. what are the 4 pillars of oops

Ans.

The 4 pillars of OOP are Inheritance, Encapsulation, Abstraction, and Polymorphism.

  • Inheritance allows a class to inherit properties and behavior from another class.

  • Encapsulation restricts access to certain components within a class, protecting the data.

  • Abstraction hides the complex implementation details and only shows the necessary features.

  • Polymorphism allows objects to be treated as instances of their parent class, enabling flexibility.

Add your answer

Q124. How to add column in sql

Ans.

To add a column in SQL, you can use the ALTER TABLE statement.

  • Use the ALTER TABLE statement followed by the ADD COLUMN keyword.

  • Specify the name of the table you want to add the column to.

  • Specify the name of the new column and its data type.

  • You can also specify additional constraints like NOT NULL or DEFAULT values.

  • Example: ALTER TABLE table_name ADD COLUMN column_name data_type;

Add your answer

Q125. Difference between java and c++

Ans.

Java is platform-independent, while C++ is not. Java uses automatic memory management, while C++ requires manual memory management.

  • Java is platform-independent, meaning that Java programs can run on any operating system that has a Java Virtual Machine (JVM). C++ programs, on the other hand, are compiled into machine code specific to the target platform.

  • Java uses automatic memory management through garbage collection, which automatically frees up memory that is no longer neede...read more

Add your answer

Q126. Explain normalisation and types

Ans.

Normalization is the process of organizing data in a database to eliminate redundancy and improve data integrity.

  • Normalization is used to minimize data duplication and ensure consistency.

  • There are different normal forms (1NF, 2NF, 3NF, etc.) that define specific rules for organizing data.

  • Normalization helps in reducing data anomalies and improving database performance.

  • Normalization involves breaking down a large table into smaller, more manageable tables.

  • Each normal form has ...read more

Add your answer

Q127. What do you know about java

Ans.

Java is a popular programming language known for its platform independence and object-oriented approach.

  • Java is an object-oriented programming language

  • It is known for its platform independence, meaning code can run on any device with a Java Virtual Machine

  • Java is used for developing a wide range of applications, from mobile apps to enterprise systems

Add your answer

Q128. What is Bridge Router

Ans.

A bridge router is a device that connects two different networks and forwards data between them.

  • Bridge routers operate at the data link layer of the OSI model.

  • They can connect networks with different protocols or technologies.

  • Bridge routers can help in extending network coverage and improving network performance.

  • Example: Connecting a wired Ethernet network to a wireless Wi-Fi network.

View 1 answer

Q129. an array definition, real time programming usage

Ans.

An array is a collection of similar data types. Real-time programming uses arrays to store and manipulate data in real-time.

  • Arrays can be defined using square brackets [] and can hold any data type.

  • Real-time programming uses arrays to store and manipulate data in real-time, such as sensor data.

  • Arrays can be accessed using index numbers, starting from 0.

  • Arrays can be multidimensional, allowing for more complex data structures.

  • Arrays can be passed as arguments to functions, all...read more

Add your answer

Q130. When and how to use functions?

Ans.

Functions are used to break down complex tasks into smaller, reusable parts.

  • Functions should be used when a task needs to be performed multiple times in a program.

  • Functions make code more organized and easier to read.

  • Functions can take parameters and return values to make them more versatile.

  • Functions can be used to break down complex tasks into smaller, more manageable parts.

  • Functions can be used to improve code reusability and reduce redundancy.

Add your answer

Q131. How to use static in class?

Ans.

Static keyword is used to create class-level variables and methods that can be accessed without creating an instance of the class.

  • Static variables and methods are declared using the keyword 'static'

  • Static variables are shared among all instances of the class

  • Static methods can be called without creating an instance of the class

  • Static methods cannot access non-static variables or methods

  • Example: public static int count = 0; // static variable

  • Example: public static void printCou...read more

Add your answer

Q132. What is Data Warehouse?

Ans.

A data warehouse is a large, centralized repository of integrated data from various sources, used for reporting and analysis.

  • Data warehouse stores structured, historical data for decision-making purposes.

  • It consolidates data from multiple sources, such as databases, spreadsheets, and external systems.

  • Data is transformed, cleaned, and organized to support reporting and analysis.

  • It provides a single source of truth for business intelligence and reporting.

  • Examples include sales ...read more

View 1 answer

Q133. Difference between C and C++

Ans.

C is a procedural programming language, while C++ is an extension of C with added features like object-oriented programming.

  • C is a procedural language, while C++ supports both procedural and object-oriented programming.

  • C++ has additional features like classes, inheritance, and polymorphism.

  • C++ supports function overloading and exception handling, which are not available in C.

  • C++ has a standard template library (STL) that provides useful data structures and algorithms.

  • C++ allo...read more

Add your answer

Q134. Difference between switch and a router.

Ans.

Switch operates at data link layer and forwards data based on MAC addresses, while router operates at network layer and forwards data based on IP addresses.

  • Switch operates at layer 2 of OSI model, while router operates at layer 3.

  • Switch forwards data within the same network, while router forwards data between different networks.

  • Switch uses MAC addresses to make forwarding decisions, while router uses IP addresses.

  • Switch is typically used in LANs, while router is used to conne...read more

Add your answer

Q135. Write a program to reverse a string

Ans.

Program to reverse a string using array of characters

  • Create an array of characters to store the input string

  • Iterate through the input string and store each character in the array

  • Iterate through the array in reverse order to construct the reversed string

Add your answer

Q136. OOPs concepts with real life examples.

Ans.

OOPs concepts are fundamental principles in object-oriented programming that help in organizing and managing code efficiently.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: A car object with properties like color and methods like start() and stop().

  • Inheritance: Creating new classes based on existing classes, inheriting their attributes and methods. Example: Animal class with Dog and Cat subclasses.

  • Polymorphism: Objects of differ...read more

Add your answer

Q137. What is springboot,Microservices

Ans.

Spring Boot is a framework for building Java-based applications with minimal configuration. Microservices is an architectural style where applications are composed of small, independent services.

  • Spring Boot is used to simplify the development of Java applications by providing pre-configured settings and dependencies.

  • Microservices architecture breaks down applications into smaller, loosely coupled services that can be developed, deployed, and scaled independently.

  • Spring Boot c...read more

Add your answer

Q138. What are OOPS concepts?

Ans.

OOPS concepts refer to Object-Oriented Programming concepts which include inheritance, encapsulation, polymorphism, and abstraction.

  • Inheritance: Allows a class to inherit properties and behavior from another class.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit.

  • Polymorphism: Ability to present the same interface for different data types.

  • Abstraction: Hiding the complex implementation details and showing only the necessary features.

Add your answer

Q139. Make it simple and quantifiable

Ans.

To improve website performance, reduce page load time by 20% within 3 months.

  • Analyze current website performance metrics

  • Identify areas of improvement such as image optimization, code minification, and caching

  • Implement changes and monitor performance regularly

  • Use tools like Google PageSpeed Insights and GTmetrix to track progress

Add your answer

Q140. Increment decrement expression to solve

Ans.

Using increment/decrement expression to solve a problem

  • Increment operator (++) increases the value of a variable by 1

  • Decrement operator (--) decreases the value of a variable by 1

  • Can be used in loops, conditionals, and other programming constructs

  • Example: i++ increases the value of i by 1

Add your answer

Q141. Asp.net MVC with filter and wep api?

Ans.

Asp.net MVC with filter and web api is a combination of technologies used for building web applications.

  • Asp.net MVC is a framework for building web applications using Model-View-Controller architecture.

  • Filters are used to add additional functionality to MVC actions.

  • Web API is a framework for building HTTP services that can be consumed by a variety of clients.

  • Asp.net MVC with filter and web api can be used to build RESTful web services.

  • Example: Building a web application that ...read more

Add your answer

Q142. Write a code to print odd number 0-100

Ans.

Print odd numbers from 0 to 100 using a loop

  • Use a for loop to iterate from 0 to 100

  • Check if the current number is odd using the modulo operator (%)

  • Print the odd numbers

Add your answer

Q143. code logic for a specific function

Ans.

Code logic for a specific function

  • Identify the input parameters required for the function

  • Define the steps needed to achieve the desired output

  • Consider edge cases and error handling

  • Test the function with different inputs to ensure correctness

Add your answer

Q144. Explain class object interface inheritance

Ans.

Class object interface inheritance is a concept in object-oriented programming where a class inherits the properties and methods of another class.

  • Allows a class to inherit properties and methods from another class

  • Helps in reusing code and promoting code reusability

  • Creates a parent-child relationship between classes

  • Example: Class B inherits from Class A, so Class B can access all public and protected members of Class A

Add your answer

Q145. What is Functional Interface

Ans.

A functional interface is an interface with only one abstract method, used in Java to enable lambda expressions.

  • Functional interfaces can have multiple default methods but only one abstract method.

  • They are used in Java to enable the use of lambda expressions.

  • Examples of functional interfaces in Java include Runnable, Callable, and ActionListener.

Add your answer

Q146. What is normalisation.

Ans.

Normalisation is the process of organizing data in a database to reduce redundancy and improve data integrity.

  • Organizes data into tables to minimize redundancy

  • Ensures data dependencies make sense

  • Reduces data anomalies

  • Example: Splitting customer information into separate tables for name, address, and contact details

Add your answer

Q147. What is microservices?

Ans.

Microservices are a software development technique where applications are composed of small, independent services that communicate with each other.

  • Microservices break down applications into smaller, loosely coupled services

  • Each service is responsible for a specific function and can be developed, deployed, and scaled independently

  • Communication between services is typically done through APIs

  • Microservices architecture promotes flexibility, scalability, and resilience

  • Examples of ...read more

Add your answer

Q148. define linked list, stack, queue,array,joins

Ans.

Linked list is a data structure where each element points to the next element. Stack and queue are data structures that store and retrieve data in a specific order. Array is a collection of elements of the same data type. Joins are used to combine data from multiple tables in a database.

  • Linked list: Each element points to the next element. Example: Singly linked list, Doubly linked list

  • Stack: Last in, first out. Example: Undo/Redo functionality in a text editor

  • Queue: First in...read more

Add your answer

Q149. How to define alternate index?

Ans.

Alternate index is a secondary index used to access records in a different order than the primary index.

  • Alternate index is defined in the file's data division using the SD (sort definition) entry.

  • It is used to access records in a different order than the primary index.

  • Alternate index can be used to speed up searches and improve performance.

  • It can be defined on one or more fields in the record.

  • Example: An alternate index can be defined on a customer's last name to quickly retr...read more

Add your answer

Q150. What are key constraints ?

Ans.

Key constraints are rules that enforce uniqueness and relationships in a database.

  • Key constraints ensure that each record in a table is uniquely identified.

  • Primary key constraint enforces uniqueness and ensures each record has a unique identifier.

  • Foreign key constraint establishes a relationship between two tables based on a key field.

  • Unique key constraint ensures that all values in a column are unique.

Add your answer

Q151. Explain SQL join statements

Ans.

SQL join statements are used to combine rows from two or more tables based on a related column between them.

  • Join statements are used to retrieve data from multiple tables in a single query.

  • Common types of join statements include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

  • Join conditions are specified using the ON keyword followed by the columns to join on.

  • Join statements can be used to fetch related data from different tables based on a common column.

  • Example: SELECT * F...read more

Add your answer

Q152. Wt is SE16N? APP, HOUSE BANKS

Ans.

SE16N is a transaction code used in SAP to display table contents and perform data analysis.

  • SE16N is used to view and analyze table contents in SAP.

  • It allows users to filter, sort, and export data.

  • APP and HOUSE BANKS are examples of tables that can be accessed using SE16N.

Add your answer

Q153. What is abstract class

Ans.

Abstract class is a class that cannot be instantiated and may contain abstract methods.

  • Cannot be instantiated directly

  • May contain abstract methods that must be implemented by subclasses

  • Can have both abstract and non-abstract methods

  • Used for creating a template for other classes to inherit from

Add your answer

Q154. What exception handling

Ans.

Exception handling is a programming concept that deals with errors and unexpected events in a program.

  • Exception handling allows programmers to gracefully handle errors and prevent program crashes.

  • It involves using try, catch, and finally blocks to handle exceptions.

  • Examples of exceptions include divide by zero, file not found, and out of memory errors.

Add your answer

Q155. OOP oriented in the case of C++

Ans.

C++ supports Object-Oriented Programming (OOP) through classes and objects.

  • C++ allows for the creation of classes, which are user-defined data types that can have member functions and variables.

  • Objects are instances of classes, allowing for data encapsulation and abstraction.

  • Inheritance, polymorphism, and encapsulation are key principles of OOP supported by C++.

Add your answer

Q156. Sql query to find the employer with highest salary

Add your answer

Q157. what is aws lambda and sdk

Ans.

AWS Lambda is a serverless computing service that allows you to run code without provisioning or managing servers. SDK stands for Software Development Kit, which provides tools and libraries for interacting with AWS services.

  • AWS Lambda is a serverless computing service provided by Amazon Web Services.

  • It allows you to run code in response to events without the need to provision or manage servers.

  • SDK (Software Development Kit) provides tools and libraries for developers to inte...read more

Add your answer

Q158. what is oops

Ans.

OOPs stands for Object-Oriented Programming. It is a programming paradigm that uses objects to design applications.

  • OOPs is based on the concept of classes and objects

  • It focuses on encapsulation, inheritance, and polymorphism

  • It allows for modular and reusable code

  • Examples of OOPs languages include Java, C++, and Python

Add your answer

Q159. Function in python,list,tuple,mutable immutable

Ans.

Python has functions to manipulate lists and tuples, which can be mutable or immutable.

  • Python has built-in functions like append(), pop(), and sort() to manipulate lists.

  • Tuples are similar to lists but are immutable, meaning they cannot be changed once created.

  • Mutable objects can be changed after creation, while immutable objects cannot.

  • Examples of mutable objects in Python include lists and dictionaries.

  • Examples of immutable objects in Python include tuples and strings.

Add your answer

Q160. Write a xpath syntax using xpath by text

Ans.

XPath syntax using xpath by text

  • Use the 'text()' function in XPath to select elements based on their text content

  • Syntax: //tagname[text()='desired text']

  • Example: //h1[text()='Hello World']

Add your answer

Q161. Share your proficiency in C programming

Ans.

Proficient in C programming with experience in developing efficient algorithms and data structures.

  • Strong understanding of C syntax, pointers, memory management, and file handling.

  • Experience in developing complex algorithms and data structures using C.

  • Proficient in debugging and optimizing C code for performance.

  • Familiarity with libraries like stdio.h, stdlib.h, and string.h in C programming.

  • Example: Developed a sorting algorithm in C that efficiently sorted large datasets.

Add your answer

Q162. Swapping no without using variables

Ans.

Swapping no without using variables

  • Use arithmetic operations to swap the values

  • Addition and subtraction can be used to swap values

  • XOR operation can also be used to swap values

Add your answer

Q163. Programming code for Fibonacci series

Ans.

Fibonacci series is a sequence of numbers where each number is the sum of the two preceding ones.

  • Start with two variables, a and b, initialized to 0 and 1 respectively

  • Loop through the desired number of iterations and calculate the next number in the sequence by adding a and b

  • Assign the value of b to a and the value of the new number to b

  • Repeat until desired number of iterations is reached

Add your answer

Q164. What is Machine Learning

Ans.

Machine learning is a subset of artificial intelligence that involves developing algorithms to allow computers to learn from and make predictions or decisions based on data.

  • Uses algorithms to analyze data, learn patterns, and make decisions without explicit programming

  • Common techniques include regression, classification, clustering, and deep learning

  • Examples include recommendation systems, image recognition, and natural language processing

Add your answer

Q165. Explain dependency injection in SB?

Ans.

Dependency injection in Spring Boot is a design pattern where the dependencies of a class are provided from the outside.

  • In Spring Boot, dependency injection is achieved through the use of @Autowired annotation.

  • It helps in achieving loose coupling between classes and promotes easier testing and maintenance.

  • Example: @Autowired private UserService userService; // Injecting UserService dependency into the class

Add your answer

Q166. What is hamming code

Ans.

Hamming code is a type of error-correcting code used in digital communication to detect and correct errors in data transmission.

  • Hamming code adds extra bits to data to create parity bits for error detection and correction.

  • It is commonly used in computer memory systems and communication networks.

  • Example: In a 7-bit Hamming code, 4 data bits are encoded with 3 parity bits to detect and correct errors.

View 1 answer

Q167. Write a program to reverse an array.

Ans.

This program reverses an array of strings by swapping elements from both ends towards the center.

  • Define a function that takes an array of strings as input.

  • Use a loop to swap elements from the start and end of the array.

  • Continue swapping until the middle of the array is reached.

  • Example: Input: ['apple', 'banana', 'cherry'], Output: ['cherry', 'banana', 'apple'].

Add your answer

Q168. Write a c program reversing your name

Ans.

A C program to reverse a given name.

  • Declare a character array to store the name.

  • Use scanf() to take input of the name.

  • Use strlen() function to find the length of the name.

  • Use a for loop to iterate through the name in reverse order.

  • Print the reversed name using printf().

Add your answer

Q169. What is collection in java

Ans.

Collections in Java are classes that represent groups of objects, providing operations to manipulate and access the elements.

  • Collections provide a way to store and manipulate groups of objects in Java.

  • Some common collection classes in Java include ArrayList, LinkedList, HashMap, and TreeSet.

  • Collections framework in Java includes interfaces like List, Set, Map, Queue, etc.

  • Collections offer methods to add, remove, and retrieve elements from the collection.

  • Collections in Java pr...read more

Add your answer

Q170. What is static keyword

Ans.

Static keyword is used in programming languages to declare variables, functions, or classes that are shared among all instances of a class.

  • Static variables retain their values between function calls

  • Static functions can be called without creating an instance of a class

  • Static classes cannot be instantiated and are used for grouping related methods and properties

Add your answer

Q171. What is selenium and java

Ans.

Selenium is a tool used for automating web browsers and Java is a programming language used for developing applications.

  • Selenium is used for testing web applications by automating browser actions

  • Java is an object-oriented programming language used for developing desktop and web applications

  • Selenium can be used with Java to write automated tests for web applications

  • Java can be used to write code for Selenium test scripts

Add your answer

Q172. Which framework you used

Ans.

I have experience working with multiple frameworks including Angular, React, and Vue.js.

  • I have used Angular for building complex web applications with a lot of data manipulation and real-time updates.

  • React is my go-to framework for building single-page applications with a lot of interactivity and dynamic content.

  • Vue.js is a great choice for smaller projects or when I need to quickly prototype a new feature.

  • I am also familiar with other frameworks like Ember.js and Backbone.js...read more

Add your answer

Q173. Difference between list and array

Ans.

Arrays are fixed in size and store elements of the same data type, while lists can dynamically resize and store elements of different data types.

  • Arrays have a fixed size, while lists can dynamically resize.

  • Arrays store elements of the same data type, while lists can store elements of different data types.

  • Arrays use contiguous memory allocation, while lists use linked data structures.

  • Arrays are accessed by index, while lists are accessed by iterators or pointers.

Add your answer

Q174. What is oops,collection

Ans.

OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects, while collections are data structures used to store and manipulate groups of objects.

  • OOPs focuses on creating objects that contain data and methods to manipulate that data

  • Collections are used to store groups of objects, such as lists, sets, and maps

  • Examples of collections in Java include ArrayList, HashSet, and HashMap

Add your answer

Q175. Difference between DBMS and RDBMS

Ans.

DBMS is a software system to manage databases while RDBMS is a type of DBMS that stores data in tables with relations.

  • DBMS stands for Database Management System while RDBMS stands for Relational Database Management System.

  • DBMS can manage any type of database while RDBMS manages only relational databases.

  • DBMS does not enforce any specific data model while RDBMS enforces the relational data model.

  • Examples of DBMS include MongoDB, Cassandra, and Redis while examples of RDBMS inc...read more

Add your answer

Q176. difference between list and tuple

Ans.

List is mutable while tuple is immutable in Python.

  • Lists are enclosed in square brackets [], while tuples are enclosed in parentheses ().

  • Elements in a list can be changed, added, or removed, while elements in a tuple cannot be changed.

  • Lists are used for collections of homogeneous items, while tuples are used for heterogeneous items.

  • Lists are slower than tuples in terms of performance.

  • Example: my_list = [1, 2, 3] and my_tuple = (4, 5, 6)

Add your answer

Q177. internal implementation of hashmap

Ans.

HashMap is a data structure that stores key-value pairs and uses hashing to quickly retrieve values based on keys.

  • HashMap internally uses an array of linked lists to store key-value pairs.

  • When a key-value pair is added, the key is hashed to determine the index in the array where the pair will be stored.

  • If multiple keys hash to the same index, a collision occurs and the pairs are stored in a linked list at that index.

  • To retrieve a value, the key is hashed again to find the ind...read more

Add your answer

Q178. Different patterns in c programming

Ans.

Some common patterns in C programming include singleton, factory, observer, and strategy patterns.

  • Singleton pattern ensures a class has only one instance and provides a global point of access to it.

  • Factory pattern creates objects without specifying the exact class of object that will be created.

  • Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

  • Strategy pattern defi...read more

Add your answer

Q179. What is IAM and benefits

Ans.

IAM stands for Identity and Access Management. It is a framework of policies and technologies that ensure the right individuals have the right access to resources.

  • IAM helps organizations manage user identities, roles, and access permissions.

  • Benefits of IAM include improved security by enforcing least privilege access, increased compliance with regulations, centralized access control, and streamlined user management.

  • IAM solutions often include features like single sign-on (SSO...read more

Add your answer

Q180. What is Collections in Java

Ans.

Collections in Java are frameworks that provide an architecture to store and manipulate a group of objects.

  • Collections provide interfaces (List, Set, Map) and classes (ArrayList, LinkedList, HashSet, HashMap) to work with groups of objects

  • They offer methods to add, remove, and manipulate elements in the collection

  • Collections framework also includes algorithms for searching, sorting, and iterating over collections

Add your answer

Q181. OOPs concepts explanation with examples

Ans.

OOPs concepts are fundamental principles in object-oriented programming that help in organizing code efficiently.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit (class). Example: Class Car with properties like make, model, and methods like start(), stop().

  • Inheritance: Ability of a class to inherit properties and behavior from another class. Example: Class SUV inheriting from Class Car.

  • Polymorphism: Ability to present the same interface for...read more

Add your answer

Q182. 1. What is polymorphism

Ans.

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.

  • There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).

  • Example: Inheritance in OOP allows a child class to override a method from its parent class, exhibiting polymorphic behavior.

Add your answer

Q183. How much is Current ctc

Ans.

I am currently earning $70,000 per year.

  • My current annual salary is $70,000.

  • I am currently making $70,000 per year.

Add your answer

Q184. Class and object in c++

Ans.

Class and object are fundamental concepts in C++ programming language.

  • A class is a blueprint for creating objects that have similar attributes and methods.

  • An object is an instance of a class that has its own set of values for the attributes defined in the class.

  • Classes can have access modifiers like public, private, and protected to control the visibility of attributes and methods.

  • Objects can interact with each other by calling methods defined in their respective classes.

Add your answer

Q185. write code for palindrome number

Ans.

A palindrome number is a number that remains the same when its digits are reversed.

  • Convert the number to a string to easily reverse it

  • Check if the reversed string is equal to the original string to determine if it's a palindrome

Add your answer

Q186. write code for armstrong number

Ans.

Armstrong number is a number that is equal to the sum of its own digits raised to the power of the number of digits.

  • Iterate through each digit of the number

  • Calculate the power of each digit based on the total number of digits

  • Sum up the powered digits and check if it equals the original number

Add your answer

Q187. What is Polymorphism

Ans.

Polymorphism is the ability of a single function or method to operate on different types of data.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).

  • Example: Inheritance in object-oriented programming languages like Java allows for polymorphism.

Add your answer

Q188. Explain Exception Handling with throws

Ans.

Exception handling with throws is a way to handle errors in a program by explicitly throwing exceptions to be caught and handled elsewhere.

  • Throws keyword is used to explicitly throw an exception in a method.

  • The method must declare the exception using 'throws' keyword in its signature.

  • The exception is then propagated up the call stack until it is caught and handled by a try-catch block.

  • Example: public void doSomething() throws IOException { throw new IOException(); }

Add your answer

Q189. What is String? What is DBMS?

Ans.

String is a sequence of characters. DBMS is a software system that manages databases.

  • String is a data type used to represent text in programming languages.

  • DBMS stands for Database Management System.

  • String example: 'Hello, World!'

  • DBMS example: MySQL, Oracle, SQL Server

Add your answer

Q190. Encapsulation in java

Ans.

Encapsulation is the concept of bundling data and methods that operate on the data into a single unit, preventing direct access to the data from outside the unit.

  • Encapsulation in Java is achieved by declaring the class variables as private and providing public getter and setter methods to access and modify the data.

  • It helps in data hiding and protects the data from being accessed or modified directly by other classes.

  • Example: private int age; public int getAge() { return age;...read more

View 1 answer

Q191. Monkey Patch in python

Ans.

Monkey patching is a technique in Python where you dynamically modify or extend the behavior of a class or module at runtime.

  • Monkey patching is often used to fix bugs or add new functionality to existing code without modifying the original source code.

  • It involves directly modifying the code of a class or module at runtime, which can be risky and lead to unexpected behavior.

  • Monkey patching should be used sparingly and with caution, as it can make code harder to maintain and de...read more

View 1 answer

Q192. Pointers in c++

Ans.

Pointers in C++ are variables that store memory addresses of other variables.

  • Pointers are declared using the * symbol.

  • Pointers can be used to access and manipulate memory directly.

  • Pointers can be used to create dynamic memory allocation.

  • Example: int *ptr; // declaring a pointer to an integer variable

Add your answer

Q193. Reverse an array

Ans.

Reverse an array of strings

  • Create a new array to store the reversed strings

  • Iterate through the original array in reverse order and add each element to the new array

  • Return the new array with reversed strings

Add your answer

Q194. write code for string reversal

Ans.

Code for string reversal

  • Iterate through the string from end to start and append each character to a new string

  • Use built-in functions like reverse() in Python or StringBuilder.reverse() in Java

  • Convert the string to an array, reverse the array, and then convert back to a string

Add your answer

Q195. What is python?

Ans.

Python is a high-level programming language known for its simplicity and readability.

  • Python is interpreted, not compiled

  • It supports multiple programming paradigms like procedural, object-oriented, and functional programming

  • Python has a large standard library and a vibrant community for support

  • Example: print('Hello, World!') is a simple Python program that prints 'Hello, World!' to the console

Add your answer

Q196. What is Captcha?

Ans.

Captcha is a security measure used to determine whether a user is human or a bot by presenting a challenge that is easy for humans to solve but difficult for bots.

  • Captcha stands for Completely Automated Public Turing test to tell Computers and Humans Apart.

  • It typically involves distorted text that the user must enter correctly to proceed.

  • Captcha can also include image recognition tasks or simple puzzles.

  • Captcha helps prevent automated bots from accessing websites or submittin...read more

Add your answer

Q197. Inheritance in detail

Ans.

Inheritance is a mechanism in object-oriented programming where a new class is derived from an existing class.

  • Inheritance allows the new class to inherit the properties and methods of the existing class.

  • The existing class is called the superclass or parent class, while the new class is called the subclass or child class.

  • The subclass can add new properties and methods or override the existing ones.

  • Inheritance promotes code reuse and makes the code more modular and maintainable...read more

Add your answer

Q198. To represent a class object

Ans.

To represent a class object, we need to define a class with its properties and methods.

  • Define a class with the 'class' keyword in the programming language

  • Add properties and methods to the class

  • Instantiate the class to create an object

  • Access the object's properties and methods using dot notation

  • Example: class Person { name; age; sayHello() { console.log('Hello!'); } }

  • Example: const john = new Person(); john.name = 'John'; john.age = 30; john.sayHello();

Add your answer

Q199. what is indexing

Ans.

Indexing is a technique used to optimize the performance of databases by creating a data structure that allows for quick retrieval of data.

  • Indexing involves creating a data structure that maps the values of a particular column in a database table to their corresponding rows.

  • It speeds up data retrieval operations by allowing the database to quickly locate the rows that match a certain value without having to scan the entire table.

  • Examples of indexing include creating indexes o...read more

Add your answer

Q200. Sql query to find second max salary

Add your answer
1
2
3

More about working at Cognizant

Top Rated Mega Company - 2024
Top Rated IT/ITES Company - 2024
HQ - Teaneck. New Jersey., United States (USA)
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at SRR Projects

based on 456 interviews
5 Interview rounds
Aptitude Test Round
Technical Round
HR Round - 1
HR Round - 2
Personal Interview1 Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Programmer Analyst Interview Questions from Similar Companies

3.9
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter