Add office photos
Cognizant logo
Engaged Employer

Cognizant

Verified
3.7
based on 50.6k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Junior Software Engineer
Fresher
Experienced
Clear (2)

Cognizant Junior Software Engineer Interview Questions and Answers for Freshers

Updated 19 Jun 2024

Q1. If there are 10 ball 2 red, 5 blue ,3 orange and one ball is picked randomly what is probability that the ball picked is red?

Ans.

What is the probability of picking a red ball out of 10 balls with 2 red, 5 blue, and 3 orange?

  • There are 2 red balls out of 10 total balls

  • The probability of picking a red ball is 2/10 or 1/5

  • The probability can also be expressed as 20%

View 1 answer
right arrow

Q2. Difference between abstract class & functional interface

Ans.

Abstract class can have both abstract and non-abstract methods, while functional interface can have only one abstract method.

  • Abstract class can have constructors, fields, and methods, while functional interface can only have one abstract method.

  • Abstract class can have abstract and non-abstract methods, while functional interface can only have one abstract method.

  • Abstract class can provide default implementations for methods, while functional interface cannot.

  • Example: Abstract...read more

Add your answer
right arrow

Q3. How to reverse an array of numbers?

Ans.

To reverse an array of numbers, iterate through the array and swap elements from start to end.

  • Iterate through the array using two pointers, one starting from the beginning and the other from the end.

  • Swap elements at the two pointers and move the pointers towards the center until they meet.

  • Example: Input array [1, 2, 3, 4, 5], after reversing becomes [5, 4, 3, 2, 1].

Add your answer
right arrow

Q4. Define internal working of Hashmap

Ans.

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

  • Hashmap uses an array to store key-value pairs.

  • Keys are hashed to determine the index where the value will be stored.

  • Collision handling techniques like chaining or open addressing are used to deal with multiple keys hashing to the same index.

  • Retrieving a value involves hashing the key to find the index and then accessing the value stored at that index.

  • Example: Has...read more

Add your answer
right arrow
Discover Cognizant interview dos and don'ts from real experiences

Q5. Define multi threading & synchronisation

Ans.

Multithreading is the ability of a CPU to execute multiple threads concurrently, while synchronization is the coordination of multiple threads to ensure data consistency.

  • Multithreading allows multiple threads to run concurrently on a single CPU core.

  • Synchronization is used to coordinate access to shared resources among multiple threads.

  • Examples of synchronization mechanisms include locks, semaphores, and monitors.

  • Multithreading can improve performance by utilizing idle CPU ti...read more

Add your answer
right arrow

Q6. What are data types?

Ans.

Data types are classifications of data items that determine the possible values and operations that can be performed on them.

  • Data types define the type of data that a variable can hold, such as integers, strings, or booleans.

  • Examples of data types include int (integer), float (floating point number), char (character), and bool (boolean).

  • Data types also determine the size of the variable in memory and the range of values it can store.

Add your answer
right arrow

Q7. Define the Oops pillars.

Ans.

Oops pillars are the four main principles of object-oriented programming: Inheritance, Encapsulation, Abstraction, and Polymorphism.

  • 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.

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

  • Polymorphism: Ability of an object to take on many forms.

Add your answer
right arrow

More about working at Cognizant

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

Interview Process at Cognizant Junior Software Engineer for Freshers

based on 7 interviews
1 Interview rounds
Aptitude Test Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Junior Software Engineer Interview Questions from Similar Companies

View all
Recently Viewed
INTERVIEWS
Concentrix Corporation
No Interviews
INTERVIEWS
Ixora Global Services
No Interviews
INTERVIEWS
LTIMindtree
10 top interview questions
INTERVIEWS
Accenture
20 top interview questions
INTERVIEWS
Sodexo
10 top interview questions
INTERVIEWS
TCS
10 top interview questions
INTERVIEWS
Salesforce
No Interviews
INTERVIEWS
Tech Mahindra
No Interviews
INTERVIEWS
Vardhman Fabrics
No Interviews
INTERVIEWS
Tech Mahindra
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
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