Cognizant_Full_Interview_Preparation
Cognizant_Full_Interview_Preparation
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.
A: def reverse_string(s):
return s[::-1]
print(reverse_string('Cognizant'))
A: Stack uses LIFO (Last In First Out), while Queue uses FIFO (First In First Out).
A: O(log n)
A: Normalization is the process of organizing data to reduce redundancy and improve data integrity.
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.
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.
A: Agile is an iterative software development approach where requirements and solutions evolve
through collaboration.
A: Inheritance allows a class to inherit properties and methods from another class.
Q: What is a constructor?
Example:
def factorial(n):
if n == 0:
return 1
return n * factorial(n-1)
A: Interfaces contain only abstract methods (Java 7), while abstract classes can have both concrete
and abstract methods.
A: Exception handling manages runtime errors using try, catch, and finally blocks.
A: Arrays are static in size and allow random access; linked lists are dynamic and allow efficient
insertions/deletions.
A: Repeatedly swaps adjacent elements if they are in the wrong order. Time complexity: O(n²).
A: Primary key uniquely identifies records; foreign key establishes a link between tables.
A: A memory management technique using hard drive space as RAM when physical RAM is full.
A: A 7-layer network model: Physical, Data Link, Network, Transport, Session, Presentation,
Application.
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,
A: Cognizant is known for innovation and growth. It's a great platform for freshers to start their
career.
A: I see myself as a proficient developer contributing to key projects and possibly leading a team.
A: I faced difficulties in my project due to team conflicts. I mediated discussions and ensured tasks
A: I break down tasks into manageable pieces and focus on one at a time.
A: Yes, I would like to know more about the learning opportunities at Cognizant.
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.
A: Reading tech blogs, playing chess, and exploring new programming languages.
A: As a fresher, I am open to the company's standard package and more interested in learning and
growth.