0% found this document useful (0 votes)
1 views

Cognizant_Full_Interview_Preparation

Uploaded by

Vaibhavi Kukkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Cognizant_Full_Interview_Preparation

Uploaded by

Vaibhavi Kukkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Cognizant Campus Placement Full Interview Preparation

Technical Interview Questions


Q: What is the difference between Java and C++?

A: Java is platform-independent and runs on the JVM, while C++ is platform-dependent and

compiles to machine code. Java has automatic garbage collection; C++ requires manual memory

management.

Q: Write a program to reverse a string in Python.

A: def reverse_string(s):

return s[::-1]

print(reverse_string('Cognizant'))

Q: Explain OOP concepts.

A: Encapsulation: Wrapping data and code together.

Inheritance: Acquiring properties from a base class.

Polymorphism: Performing one action in different ways.

Abstraction: Hiding complex implementation.

Q: What is the difference between a stack and a queue?

A: Stack uses LIFO (Last In First Out), while Queue uses FIFO (First In First Out).

Q: What is the time complexity of binary search?

A: O(log n)

Q: What is normalization in DBMS?

A: Normalization is the process of organizing data to reduce redundancy and improve data integrity.

Q: Write an SQL query to fetch the second highest salary.

A: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM

employees);

Q: What is a deadlock?

A: Deadlock occurs when processes are blocked because each is holding a resource and waiting for
another.

Q: Difference between TCP and UDP?

A: TCP is connection-oriented and reliable. UDP is connectionless and faster.

Q: Explain joins in SQL.

A: Inner Join, Left Join, Right Join, Full Join - used to combine rows from two or more tables based

on related columns.

Q: What is multithreading?

A: Multithreading allows concurrent execution of two or more parts of a program to maximize CPU

utilization.

Q: Explain agile methodology.

A: Agile is an iterative software development approach where requirements and solutions evolve

through collaboration.

Q: What is inheritance in OOP?

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

Q: What is a constructor?

A: A constructor is a special method used to initialize objects.

Q: Difference between == and equals() in Java?

A: == checks reference equality; equals() checks value equality.

Q: What is recursion? Give an example.

A: Recursion is when a function calls itself.

Example:

def factorial(n):

if n == 0:

return 1

return n * factorial(n-1)

Q: Difference between an interface and an abstract class in Java?

A: Interfaces contain only abstract methods (Java 7), while abstract classes can have both concrete
and abstract methods.

Q: What is exception handling?

A: Exception handling manages runtime errors using try, catch, and finally blocks.

Q: Explain the concept of pointers in C.

A: A pointer stores the memory address of another variable.

Q: What are the four pillars of OOP?

A: Encapsulation, Inheritance, Polymorphism, Abstraction.

Q: How does a hash table work?

A: It stores data in key-value pairs using a hash function to compute an index.

Q: What is the difference between array and linked list?

A: Arrays are static in size and allow random access; linked lists are dynamic and allow efficient

insertions/deletions.

Q: Explain bubble sort.

A: Repeatedly swaps adjacent elements if they are in the wrong order. Time complexity: O(n²).

Q: What is a primary key and foreign key?

A: Primary key uniquely identifies records; foreign key establishes a link between tables.

Q: What is ACID property in DBMS?

A: Atomicity, Consistency, Isolation, Durability - ensures reliable transactions.

Q: What is virtual memory?

A: A memory management technique using hard drive space as RAM when physical RAM is full.

Q: What is the OSI model?

A: A 7-layer network model: Physical, Data Link, Network, Transport, Session, Presentation,

Application.

Q: Difference between GET and POST in HTTP?

A: GET appends data in the URL, used for retrieval. POST sends data in the request body, used for

updating.
HR Interview Questions
Q: Tell me about yourself.

A: I'm a final-year B.E. Computer student from S.N.D. College. I have a strong foundation in Java,

Python, and web development. I recently worked on an attendance tracker project.

Q: Why do you want to work at Cognizant?

A: Cognizant is known for innovation and growth. It's a great platform for freshers to start their

career.

Q: Are you willing to relocate?

A: Yes, I'm flexible and open to relocation.

Q: What are your strengths and weaknesses?

A: Strengths: Adaptability, quick learner. Weakness: Public speaking, which I am improving.

Q: Where do you see yourself in 5 years?

A: I see myself as a proficient developer contributing to key projects and possibly leading a team.

Q: Describe a challenging situation and how you handled it.

A: I faced difficulties in my project due to team conflicts. I mediated discussions and ensured tasks

were assigned fairly.

Q: How do you handle pressure?

A: I break down tasks into manageable pieces and focus on one at a time.

Q: What motivates you?

A: The opportunity to learn new things and make a positive impact.

Q: Do you have any questions for us?

A: Yes, I would like to know more about the learning opportunities at Cognizant.

Q: What makes you a good fit for this role?

A: My technical skills, eagerness to learn, and adaptability make me a strong candidate.

Q: Tell me about a time you worked in a team.

A: Describe a project, your role, the collaboration process, and the outcome using the STAR

method.
Q: How do you handle failure?

A: I analyze what went wrong, learn from it, and try again with improved strategies.

Q: What are your hobbies?

A: Reading tech blogs, playing chess, and exploring new programming languages.

Q: Describe your ideal work environment.

A: A collaborative, innovative, and growth-oriented space.

Q: What is your expected salary?

A: As a fresher, I am open to the company's standard package and more interested in learning and

growth.

You might also like