Cognizant technical interview questions and answers for freshers
Cognizant technical interview questions for freshers usually cover one programming language in depth, object-oriented programming, DBMS and SQL, a little operating systems and networking, and a close look at your final-year project. Most campus and off-campus candidates reach this round through a GenC drive after an online assessment, and the interviewer often picks questions straight from your résumé. Know every line you wrote, write small programs without an IDE, and explain your project's design choices in plain words.
By Evin JohnPublished 8 min read
Where the technical round sits in Cognizant hiring
Cognizant runs its entry-level hiring in India under the GenC name. Over recent years candidates and campus placement cells have described several GenC tracks, such as GenC, GenC Next, GenC Pro and GenC Elevate, with the higher tracks asking for stronger coding in the online test and a deeper technical conversation afterwards. The exact names, eligibility rules and test sections are announced per drive and have changed more than once, so treat the drive notice and your placement office as the source of truth.
What stays fairly stable is the shape. An online assessment filters the pool, typically with aptitude, reasoning and English, plus coding problems for the coding-heavy tracks. Shortlisted candidates then face a technical interview and an HR discussion. For some drives these are separate calls; others report a single panel that covers both. This page is about the technical half. For the questions on relocation, shifts and the service agreement, read the Cognizant HR interview guide.
| Stage | Usually covers | How to prepare |
|---|---|---|
| Online assessment | Quantitative aptitude, logical reasoning, verbal English; coding for coding-focused tracks | Timed mixed sets; two easy and one medium coding problem per sitting |
| Technical interview | Your language, OOP, DBMS and SQL, basics of OS and networks, your project | Résumé walk-through out loud; ten short programs on paper |
| HR discussion | Background, location, shifts, documents, career goals | Covered on the separate HR page |
What the interviewer is trying to find out
A fresher in a services company joins a training batch and is then placed on a client project in whatever stack the project needs. So the interviewer is not testing whether you already know the client's framework. They want to see that your fundamentals are honest, that you can reason through code you have not seen before, and that you actually built the project on your résumé. A candidate who says "I am not sure, but I would reason it like this" usually does better than one who recites a definition and stalls on the first follow-up.
- Honest depth in one language. Pick Java, Python or C++ and be ready for questions on memory, collections and exceptions in that language.
- Clean basic coding. Loops, conditions, string handling and arrays without syntax panic.
- Database sense. Keys, joins, normalization and a query you can write live.
- Ownership of your project. Your part, the architecture, the data model and what broke.
- Coachability. How you react when the interviewer corrects you or pushes on a weak spot.
34 Cognizant technical interview questions
These are common question types for a Cognizant fresher technical round, written in our own words. They are not a leaked or official list. Your interviewer will mix them according to your résumé and the track you applied for.
Programming language and OOP
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Explain the four pillars of OOP with an example from your own project. | Applied OOP | Encapsulation, inheritance, polymorphism and abstraction tied to real classes you wrote |
| What is the difference between method overloading and overriding? | Compile-time vs run-time polymorphism | Same name and different parameters versus a subclass replacing behavior, with a short code sketch |
| Why is String immutable in Java, and what would you use instead for heavy concatenation? | Language internals | String pool, thread safety and security; StringBuilder for loops |
| What happens when an exception is not caught? | Exception flow | It travels up the call stack until handled or the program ends, with checked versus unchecked in Java |
| Abstract class or interface: when would you choose each? | Design judgment | Shared state and partial implementation versus a pure contract that many unrelated classes can sign |
| What is the difference between a list and a tuple in Python? | Python basics | Mutability, use as dictionary keys and when each is the natural choice |
| How does garbage collection decide what to free? | Memory model | Objects no longer reachable from roots; why you still close files and connections yourself |
| What is a constructor, and can it be private? | Class design | Yes; singletons and factory methods, with a reason you would do it |
Coding on paper or a shared screen
- Reverse the words in a sentence without using a built-in reverse. Split on spaces, walk from the end, and mention what happens with extra spaces.
- Check whether a string is a palindrome, ignoring case and punctuation. Two pointers moving inward, skipping characters that are not letters or digits.
- Find the second largest number in an array in one pass. Track the largest and second largest; state what you return if all values are equal.
- Count how often each character appears in a string. A hash map or a fixed array of counts; say the time and space cost.
- Print the Fibonacci series up to n, then do it recursively. Show both and explain why naive recursion repeats work.
- Swap two numbers without a third variable. Arithmetic or XOR, and why a temporary variable is clearer in real code.
- Remove duplicates from a sorted array in place. A slow and fast pointer, returning the new length.
- Check whether a number is prime efficiently. Test divisors only up to the square root.
def second_largest(nums):
first = second = None
for n in nums:
if first is None or n > first:
first, second = n, first
elif n != first and (second is None or n > second):
second = n
return second # None when there is no distinct second value
print(second_largest([4, 9, 2, 9, 7])) # 7
print(second_largest([5, 5])) # NoneSay the edge cases before the interviewer asks: an empty array, all values equal, negative numbers. That habit signals more than the code itself, because client projects fail on exactly those inputs.
DBMS and SQL
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What is the difference between a primary key, a unique key and a foreign key? | Keys and integrity | Null rules, how many per table, and how a foreign key protects relationships |
| Explain 1NF, 2NF and 3NF using a student and course table. | Normalization | Repeating groups, partial dependency and transitive dependency removed step by step |
| Write a query for the employees who earn more than their department's average. | Subqueries or joins | A correlated subquery or a join to an aggregated derived table |
| Inner join versus left join: what rows come back? | Join semantics | Unmatched rows kept with nulls on a left join, and a quick example |
| DELETE, TRUNCATE and DROP: what is the difference? | DDL vs DML | Row-level and rollback-able versus clearing a table versus removing it |
| What is an index, and when can it slow things down? | Performance basics | Faster reads, slower writes, and low-selectivity columns |
Operating systems, networks and the web
- Process versus thread. Separate memory versus shared memory inside a process, and why threads are cheaper to create.
- What is a deadlock, and how can it be avoided? Name the four conditions and break one, such as by ordering locks.
- Explain paging in one minute. Fixed-size pages mapped to frames, and why it avoids external fragmentation.
- What happens when you type a URL into a browser? DNS lookup, TCP connection, TLS for HTTPS, the HTTP request and the rendered response.
- TCP or UDP for a video call, and why? UDP tolerates loss for low delay; TCP retransmits for reliability.
- GET versus POST. Idempotent reads in the URL versus a request body that changes state.
Your project and résumé
- Walk me through your final-year project in two minutes. Problem, users, your role, stack and one result.
- Draw the architecture on paper. Front end, back end, database and any outside API, with arrows for data flow.
- Why did you choose this database or framework? A reason tied to the problem, not "our teacher suggested it".
- What was the hardest bug, and how did you find it? The symptom, the tools you used and the actual cause.
- If you had another month, what would you change? Shows you can critique your own work.
- You listed a certification or internship. What did you build there? Expect a follow-up on any skill line.
A fictional project answer that holds up to follow-ups
Fictional example
- Interviewer
- Tell me about your project and what you personally built.
- Candidate
- We built a hostel complaint tracker for our college. Students raise a complaint, the warden assigns it, and the status updates by email. There were three of us, and I owned the back end: a Spring Boot REST API with a MySQL database.
- Interviewer
- Why MySQL and not something like MongoDB?
- Candidate
- Our data was very relational: students belong to rooms, rooms to blocks, and complaints link to both and to a staff member. We needed joins for the warden's report, so a relational database fit. I normalized it to third normal form and added an index on complaint status, because every dashboard query filtered on it.
- Candidate
- The hardest bug was duplicate complaints when students double-clicked submit. I fixed it on the server with a unique constraint on student, category and a short time window, instead of only disabling the button, because the button fix alone would not stop a retry from a slow network.
Notice the shape. The candidate names their own part, ties each technical choice to the problem, and closes with a bug they actually solved. Interviewers in large services firms often probe the project for five to ten minutes, so a story with real decisions in it carries the round.
Mistakes that sink Cognizant technical rounds
- Listing five languages. Every one is fair game. Keep the résumé to what you can defend.
- A copied project. One question about the database schema usually exposes it.
- Silent coding. Think aloud. The interviewer grades your reasoning as much as the output.
- Guessing a definition with confidence. If you do not know, say so and reason from what you do know.
- Ignoring SQL. Many freshers prepare only coding and freeze on a simple join.
A ten-day preparation plan
- Days 1 to 2: résumé auditRead every line aloud and write two likely questions under each. Remove any skill you cannot explain for two minutes.
- Days 3 to 5: core codingSolve two problems a day on strings, arrays and recursion by hand first, then type them. Say time and space complexity for each.
- Day 6: DBMS and SQLRevise keys and normal forms, then write ten queries on an employee and department schema, including one with GROUP BY and HAVING.
- Day 7: OS and networksOne page of notes each on processes, memory, deadlock, the OSI and TCP/IP layers, and what a browser does with a URL.
- Day 8: project deep diveDraw your architecture from memory, list three design choices with reasons, and prepare the bug story.
- Days 9 to 10: mock roundsTwo timed mock technical interviews with a friend or senior, then fix the weakest topic each time.
For the mock rounds, Natively can sit on your laptop as an AI interview assistant during practice. It transcribes the mock as you talk, can read a coding question from a screenshot and suggest an approach, and keeps the session transcript so you can spot where you went quiet or vague. If you add your résumé on Pro or the free trial, its practice suggestions draw on the projects you actually listed, which is exactly what a Cognizant interviewer will question you on.
Questions people ask
What questions are asked in the Cognizant technical interview?
Mostly fundamentals tied to your résumé: your main programming language, OOP concepts, DBMS and SQL queries, basic operating systems and networking, short coding problems on strings and arrays, and a detailed discussion of your final-year project.
Is the Cognizant technical interview hard for freshers?
For the standard GenC track it is usually fundamentals-level, though interviewers vary. Tracks aimed at stronger coders, such as GenC Next or Pro in recent drives, are widely reported to go deeper on coding, so prepare for the track you applied to.
Which programming language should I use in the Cognizant interview?
The one you know best and listed first on your résumé. Interviewers generally care more about clean logic and honest fundamentals than about the language itself.
Are the technical and HR rounds separate at Cognizant?
It depends on the drive. Some candidates describe two separate conversations, others a single panel covering both. Your drive communication and placement office will say what to expect.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
