i
Cognizant
Filter interviews by
Identify and count spaces in a given string using programming techniques.
Use a loop to iterate through each character in the string.
Check if the character is a space using a condition like 'char == ' '.
Count the spaces using a counter variable.
Example: For the string 'Hello World', the count of spaces is 1.
Strings can be compared using built-in functions like strcmp in C or equals() in Java.
Use strcmp function in C to compare two strings
In Java, use equals() method to compare two strings
Consider case sensitivity when comparing strings
Use built-in functions to handle special characters and whitespace
String buffer is synchronized and thread-safe, while string builder is not synchronized and faster.
String buffer is synchronized, making it thread-safe for use in multi-threaded environments.
String builder is not synchronized, resulting in faster performance but not thread-safe.
String builder is preferred for single-threaded operations, while string buffer is preferred for multi-threaded operations.
Program to check if a given string is a palindrome or not.
Remove all non-alphanumeric characters from the string
Convert the string to lowercase
Reverse the string and compare with the original string
If both are equal, then the string is a palindrome
What people are saying about Cognizant
I know several programming languages including Java, Python, and C++.
Proficient in Java, Python, and C++
Familiar with HTML, CSS, and JavaScript
Experience with SQL and database management
Knowledge of object-oriented programming principles
Comfortable with version control systems like Git
SQL query to find 3rd maximum salary.
Use the ORDER BY clause to sort the salaries in descending order.
Use the LIMIT clause to limit the result to the third row.
Use a subquery to exclude the top two salaries and select the third highest salary.
I am proficient in Java, Python, SQL, and have experience with HTML/CSS and JavaScript.
Java
Python
SQL
HTML/CSS
JavaScript
Arrays are a collection of similar data types while classes are a blueprint for creating objects.
Arrays store data in a contiguous memory location while classes store data in separate memory locations.
Arrays can be accessed using an index while classes can be accessed using object references.
Arrays are used for storing and manipulating data while classes are used for creating objects with properties and methods.
OOPs is a programming concept that relates real-life objects to classes and objects in code.
Classes represent real-life objects and their properties and behaviors
Objects are instances of classes and can interact with each other
Inheritance allows for the creation of new classes based on existing ones
Polymorphism allows for the same method to be used for different objects
Encapsulation hides the complexity of the cod...
The frog will require 98 jumps to get out of the well.
The frog jumps 2m high but falls down 1m, so it covers a net distance of 1m with each jump.
To calculate the number of jumps, we need to subtract the initial jump of 2m from the total depth of the well (100m).
The remaining distance to cover is 100m - 2m = 98m.
Since the frog covers 1m with each jump, it will require 98 jumps to cover the remaining distance and re...
60min of test which include all concepts of mathematical,and codind questiond
String buffer is synchronized and thread-safe, while string builder is not synchronized and faster.
String buffer is synchronized, making it thread-safe for use in multi-threaded environments.
String builder is not synchronized, resulting in faster performance but not thread-safe.
String builder is preferred for single-threaded operations, while string buffer is preferred for multi-threaded operations.
Strings can be compared using built-in functions like strcmp in C or equals() in Java.
Use strcmp function in C to compare two strings
In Java, use equals() method to compare two strings
Consider case sensitivity when comparing strings
Use built-in functions to handle special characters and whitespace
I appeared for an interview in Nov 2024, where I was asked the following questions.
I appeared for an interview in Sep 2024, where I was asked the following questions.
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, starting from 0 and 1.
Definition: The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones.
Example: The sequence begins as 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
Recursive Approach: A common method to compute Fibonacci numbers is through recursion, but it can be inefficie...
Identify and count spaces in a given string using programming techniques.
Use a loop to iterate through each character in the string.
Check if the character is a space using a condition like 'char == ' '.
Count the spaces using a counter variable.
Example: For the string 'Hello World', the count of spaces is 1.
I applied via Campus Placement and was interviewed in May 2022. There were 4 interview rounds.
Basic Apptitude questions from HCM,LCM,Numbers,grammar questions
I applied via Campus Placement and was interviewed in Feb 2022. There were 2 interview rounds.
Questions on probability , verbal aptitude
I applied via Campus Placement and was interviewed in Sep 2021. There were 3 interview rounds.
It was conducted on Superset platform. There were quants, verbal and reasoning questions.
Majority of aptitude questions in ratio, proportion and percentage. How do you approach these topics?
Understand the basic concepts of ratio, proportion and percentage
Practice solving problems using different methods
Use real-life examples to understand the application of these concepts
Round duration - 30 minutes
Round difficulty - null
Answering 3 aptitude questions given by the interviewer
Read each question carefully before attempting to solve
Use logic and reasoning to arrive at the correct answer
Check your work and double-check your calculations
Don't spend too much time on any one question
If you're unsure, make an educated guess
They asked about the internship, and for document verification.
I applied via Campus Placement and was interviewed before Sep 2021. There were 4 interview rounds.
There were Maths,reasoning and English Section.Each section had timer.
I am proficient in Java, Python, SQL, and have experience with HTML/CSS and JavaScript.
Java
Python
SQL
HTML/CSS
JavaScript
based on 4 interview experiences
Difficulty level
Duration
based on 18 reviews
Rating in categories
Associate
73.1k
salaries
| ₹5.3 L/yr - ₹12.5 L/yr |
Programmer Analyst
56.1k
salaries
| ₹3.5 L/yr - ₹7.3 L/yr |
Senior Associate
55.2k
salaries
| ₹10.1 L/yr - ₹23.3 L/yr |
Senior Processing Executive
29.8k
salaries
| ₹2.3 L/yr - ₹6.5 L/yr |
Technical Lead
19k
salaries
| ₹6 L/yr - ₹21.5 L/yr |
TCS
Infosys
Wipro
Accenture