Cognizant interview experience Real time questions & tips from candidates to crack your interview

Senior Software Engineer

Cognizant
upvote
share-icon
2 rounds | 12 Coding problems

Interview preparation journey

expand-icon
Application story
I applied through the Naukri portal, and then I received a call from their HR for an online assessment followed by an interview.
Preparation
Duration: 1 month
Topics: Java Theory, Design Patterns, Microservice Patterns
Tip
Tip

Tip 1: For service-based companies, you should focus on the theoretical part rather than DSA (Data Structures and Algorithms).
Tip 2: Prepare well with Stream API, and having knowledge of Microservices is beneficial.

Application process
Where: Naukri
Eligibility: Not as such, you should have completed your graduation full-time, (Salary Package: 6 LPA)
Resume Tip
Resume tip

Tip 1: Keep the skills section clearly at the top, and list the skills the organization is looking for first, such as Java 8, Microservices, and Spring Boot.
Tip 2: Clearly mention your total experience and contact details. Don't make the HR calculate your experience based on the time spent at your previous organizations.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration80 minutes
Interview date22 Jul 2024
Coding problem6

1. Cycle Detection in a Singly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
InformaticaUrban Company (UrbanClap)PhonePe

You are given a Singly Linked List of integers. Return true if it has a cycle, else return false.


A cycle occurs when a node's next points back to a previous node in the list.


Example:
In the given linked list, there is a cycle, hence we return true.

Sample Example 1

Try solving now

2. Anagram Pairs

Moderate
30m average time
60% success
0/80
Asked in companies
JP MorganNearbuyTata Consultancy Services (TCS)

You are given two strings 'str1' and 'str1'.


You have to tell whether these strings form an anagram pair or not.


The strings form an anagram pair if the letters of one string can be rearranged to form another string.

Pre-requisites:

Anagrams are defined as words or names that can be formed by rearranging the letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "rasp" are anagrams. 

Other examples include:

'triangle' and 'integral'
'listen' and 'silent'
Note:
Since it is a binary problem, there is no partial marking. Marks will only be awarded if you get all the test cases correct. 
Try solving now

3. Reverse Words In A String

Easy
10m average time
90% success
0/40
Asked in companies
FacebookAmerican ExpressJP Morgan

You are given a string 'str' of length 'N'.


Your task is to reverse the original string word by word.


There can be multiple spaces between two words and there can be leading or trailing spaces but in the output reversed string you need to put a single space between two words, and your reversed string should not contain leading or trailing spaces.


Example :
If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
Try solving now

4. Same Frequency After One Removal

Moderate
0/80
Asked in company
American Express

You are given a string ‘STR’ containing only lowercase English characters. Your task is to check whether it is possible to make the frequency of each distinct character the same by removing at most one character from ‘STR’.

For example:
You are given ‘STR’ = “aabc”. The answer will be “Yes” because if we remove one ‘a’ from ‘STR,’ the frequency of each distinct character will be the same. 
Try solving now

5. Form the Biggest Number

Moderate
25m average time
70% success
0/80
Asked in companies
IntuitAmazonArcesium

Given an array “A” of positive integers. Your task is to make the largest number possible formed by concatenating each of the array elements exactly once.

Example:
Let's say the given array is [ 9, 98, 7].

All the possible numbers formed by concatenating each of the array elements are 7989,7998,9879,9897,9987,9798. Among the six numbers, 9987 is the greatest number. Hence the answer is 9987.
Try solving now

6. First Repeated Character

Moderate
30m average time
70% success
0/80
Asked in companies
EcomExpressExpedia GroupDelhivery

You are given a string 'STR' of lowercase English alphabets. You need to find the repeated character present first in the string.

Example:
If the string is: “abccba”, then the first repeated character is ‘c’, but the repeated character that is present first in the string is ‘a’. You need to print ‘a’.
Note:
Keep in mind that you need to print the repeated character that is present first in the string and not the first repeating character.
Try solving now
02
Round
Medium
Face to Face
Duration30 minutes
Interview date3 Aug 2024
Coding problem6

1. Reverse the String

Easy
15m average time
85% success
0/40
Asked in companies
ThalesDeutsche BankPaytm (One97 Communications Limited)

You are given a string 'STR'. The string contains [a-z] [A-Z] [0-9] [special characters]. You have to find the reverse of the string.

For example:

 If the given string is: STR = "abcde". You have to print the string "edcba".
follow up:
Try to solve the problem in O(1) space complexity. 
Try solving now

2. Microservice Design patterns

They have asked questions about Microservice Design patterns, mainly:

  1. What is the SAGA pattern?
  2. What is the Circuit Breaker?
  3. Please explain API Gateways. (Learn)
  4. What is an Eureka Server?

3. Core Java Patterns

4. Questions related to Spring boot

  1. What is a Spring Actuator? (Learn)
  2. Distinguish between @RestController vs @Controller. (Learn)
  3. When we can use @Qualifier annotation. (Learn)

5. Map and flatMap

Distinguish b/w Map and flatMap in streams. (Learn)

6. Median in a stream

Hard
50m average time
50% success
0/120
Asked in companies
PhonePeDelhiveryCognizant

Given that integers are read from a data stream. Your task is to find the median of the elements read so far.

Median is the middle value in an ordered integer list. If the size of the list is even there is no middle value. So the median is the floor of the average of the two middle values.

For example :
[2,3,4] - median is 3.
[2,3] - median is floor((2+3)/2) = 2.


Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
Senior Software Engineer
3 rounds | 7 problems
Interviewed by Cognizant
2246 views
0 comments
0 upvotes
company logo
Senior Software Engineer
4 rounds | 5 problems
Interviewed by Cognizant
1485 views
0 comments
0 upvotes
company logo
Frontend Developer
3 rounds | 7 problems
Interviewed by Cognizant
2408 views
0 comments
0 upvotes
company logo
Programmer Analyst
3 rounds | 8 problems
Interviewed by Cognizant
952 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Senior Software Engineer
1 rounds | 6 problems
Interviewed by Arcesium
3720 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by Ernst & Young (EY)
4954 views
0 comments
0 upvotes
company logo
Senior Software Engineer
3 rounds | 3 problems
Interviewed by HCL Technologies
2992 views
3 comments
0 upvotes