Top 100 Questions Asked in Cognizant Online Assessment

Everything you need to crack the Cognizant GenC, GenC Pro & GenC Next Online Assessment — with full answers and explanations.

📋 100 Real Questions 🎯 7 Sections Covered All Answers Included 🕐 2025–2026 Pattern

Cognizant OA Exam Pattern (2025–2026)

Cognizant runs three entry-level hiring tracks — GenC (4 LPA), GenC Pro (5.4 LPA), and GenC Next (6.75 LPA). Each has a slightly different assessment focus, but the core Online Assessment has the same structure. Here's the full breakdown so you're not surprised on exam day.

60

Communication Round

Reading, Grammar, Repeat-sentences via mic. Elimination round. Duration: 60 minutes.

80

Aptitude Round

40 Quants + 40 Logical Reasoning questions. No negative marking. Duration: 80 minutes.

3

Technical Round

3 coding or technical tasks based on your chosen skill cluster (Java/SQL/Python). Duration: 105–120 mins.

1:1

Interview Round

Technical + HR in one interview. GenC Next interviews last ~1 hour and go deep on DSA + DBMS.

💡 No negative marking — attempt every question. The platform is the Safe Assessment Browser (SAB). Tab switching is tracked. Practice on similar timed platforms before your actual exam.
📐

Section 1: Quantitative Aptitude

Q1 – Q20
1
There are 40 students in a class — 14 taking Maths and 29 taking Computer. What is the probability that a randomly chosen student is taking only the Computer class?
A) 40%
B) 55%
C) 65%
D) 70%
✅ Answer: C) 65%
Students taking both = 14 + 29 − 40 = 3. Only Computer = 29 − 3 = 26. Probability = 26/40 = 65%.
2
Three cubes of edges 6 cm, 8 cm and 10 cm are melted without loss of metal into a single cube. What is the edge of the new cube?
A) 10 cm
B) 12 cm
C) 14 cm
D) 16 cm
✅ Answer: B) 12 cm
Volume = 6³ + 8³ + 10³ = 216 + 512 + 1000 = 1728. Edge = ∛1728 = 12 cm.
3
If all 6s get inverted and become 9s between 1 and 100 (inclusive), by how much will the sum of all numbers change?
A) 300
B) 330
C) 333
D) None of these
✅ Answer: B) 330
6 at unit place (6, 16, 26… 96) → 10 numbers → increase by 3 each = +30. 6 at tens place (60–69) → 10 numbers → increase by 30 each = +300. Total = 330.
4
Rajesh spent money on 5 pens, 3 notebooks & 9 pencils. Prabhu bought 6 pens, 6 notebooks & 18 pencils and paid 50% more than Rajesh. What % of Rajesh's money was spent on pens?
A) 62.5%
B) 12.5%
C) 75%
D) Cannot be determined
✅ Answer: A) 62.5%
Let Rajesh spend x. Solving the equations: 1 pen = 0.125x. So 5 pens = 0.625x = 62.5%.
5
A person walks at 10 km/h to reach a destination. He walks back the same route at 14 km/h arriving 20 km less. What was the actual distance?
A) 50 km
B) 40 km
C) 60 km
D) 45 km
✅ Answer: A) 50 km
Let x = distance. x/10 = (x+20)/14 → 14x = 10x + 200 → 4x = 200 → x = 50 km.
6
A bus covers 54 km/h without stoppages and 45 km/h with stoppages. For how many minutes per hour does the bus stop?
A) 10
B) 12
C) 20
D) 9
✅ Answer: A) 10 minutes
Distance lost per hour = 54 − 45 = 9 km. Time to cover 9 km at 54 km/h = (9/54) × 60 = 10 minutes.
7
The distance between cities P and Q is 300 km. Train from P starts at 10 AM at 80 km/h; train from Q starts at 11 AM at 40 km/h. At what time do they meet?
A) 12:50 PM
B) 1:00 PM
C) 12:20 PM
D) 12:40 PM
✅ Answer: A) 12:50 PM
By 11 AM, Train P covers 80 km. Remaining = 220 km. Closing speed = 120 km/h. Time = 220/120 = 1 hr 50 min. 11:00 + 1:50 = 12:50 PM.
8
A shopkeeper bought 30 kg rice at ₹40/kg. Sold 40% at ₹50/kg. At what price per kg should he sell the rest to make a 25% overall profit?
A) ₹50
B) ₹40
C) ₹30
D) ₹54
✅ Answer: A) ₹50
Total CP = 30×40 = ₹1200. Required SP = 1200 × 1.25 = ₹1500. SP of first 12 kg = ₹600. Remaining SP needed = ₹900 for 18 kg = ₹50/kg.
9
The greatest number that divides 964, 1238, and 1400 leaving remainders 41, 31, and 51 respectively is?
A) 71
B) 58
C) 64
D) 79
✅ Answer: A) 71
Subtract remainders: 964−41=923, 1238−31=1207, 1400−51=1349. HCF of 923, 1207, 1349 = 71.
10
Average temperature Mon–Wed was 37°C and Tue–Thu was 34°C. Thursday's temp was 4/5 of Monday's. What was Thursday's temperature?
A) 36°C
B) 36.5°C
C) 34°C
D) 35.5°C
✅ Answer: A) 36°C
Mon+Tue+Wed = 111, Tue+Wed+Thu = 102. So Mon−Thu = 9. With Thu = (4/5)Mon → solving: Mon = 45, Thu = 36°C.
11
Prakash sold a machine to Swapna at 30% profit. Swapna sold to Ajay at 20% loss. Prakash's cost was ₹5000. Find Ajay's cost price.
A) ₹4800
B) ₹5000
C) ₹5200
D) ₹4000
✅ Answer: C) ₹5200
Swapna's CP = 5000 × 1.30 = ₹6500. Ajay's CP = 6500 × 0.80 = ₹5200.
12
Average price of 10 books is ₹12. Average price of 8 of those books is ₹11.75. Of the remaining 2 books, one is 60% more than the other. Find the price of each.
A) ₹12 & ₹24
B) ₹24 & ₹18
C) ₹28 & ₹12
D) ₹10 & ₹16
✅ Answer: D) ₹10 & ₹16
Sum of 2 books = 120 − 94 = ₹26. Let cheaper = x, pricier = 1.6x. x + 1.6x = 26 → x = ₹10, other = ₹16.
13
Two trucks face each other 500 cm apart. Each moves forward 100 cm at 50 cm/s, then backward 50 cm at 25 cm/s. How long until they collide?
A) 12 sec
B) 16 sec
C) 13 sec
D) 14 sec
✅ Answer: D) 14 seconds
Each cycle (2s forward + 2s back) each truck nets +50 cm. At 14 sec, each truck has moved 250 cm → total 500 cm → collision.
14
A secret can be told by 2 persons in 5 minutes. Each tells it to 2 more, and so on. How long will it take to reach 768 persons?
A) 500 min
B) 50 min
C) 47.5 min
D) 49 min
✅ Answer: C) 47.5 minutes
Series: 1, 2, 4, 8, …, 512. Up to 512 people = 45 min. Then 256 people tell 256 more → +2.5 min. Total = 47.5 min.
15
378 coins consist of ₹1, 50p and 25p coins whose values are in ratio 13:11:7. How many 50p coins are there?
A) 132
B) 154
C) 176
D) 132
✅ Answer: B) 154
Value ratio 13:11:7 → coin count ratio = 13:22:28 (divide by denomination). Total = 63 parts = 378 → 1 part = 6. 50p coins = 22×6 = 132. (Verify with your actual exam version as ratios vary.)
16
In a group, 6 speak Tamil, 15 speak Hindi, 6 speak Gujarati. 2 speak two languages, 1 speaks all three. How many people are in the group?
A) 21
B) 22
C) 24
D) 23
✅ Answer: D) 23
Only Tamil = 3, Only Hindi = 12, Only Gujarati = 5. Total = 20 + 2 (bilingual) + 1 (trilingual) = 23.
17
A and B can complete a work in 12 days together. B and C in 15 days, A and C in 20 days. How many days will A alone take?
A) 30 days
B) 20 days
C) 24 days
D) 40 days
✅ Answer: A) 30 days
2(A+B+C) = 1/12+1/15+1/20 = 1/5. So A+B+C = 1/10. A alone = 1/10 − 1/15 = 1/30 → 30 days.
18
A train 150 m long passes a telegraph pole in 15 seconds. How long will it take to pass a platform 300 m long?
A) 30 sec
B) 45 sec
C) 40 sec
D) 60 sec
✅ Answer: B) 45 seconds
Speed = 150/15 = 10 m/s. Distance to cross platform = 150+300 = 450 m. Time = 450/10 = 45 seconds.
19
Simple interest on a sum at 5% per annum for 3 years is ₹1200. What is the compound interest on the same sum at the same rate for 2 years?
A) ₹800
B) ₹820
C) ₹840
D) ₹860
✅ Answer: B) ₹820
SI = PRT/100 → 1200 = P×5×3/100 → P = ₹8000. CI for 2 years = 8000×[(1.05)²−1] = 8000×0.1025 = ₹820.
20
In how many ways can 5 men and 3 women be arranged in a row so that no two women sit together?
A) 1440
B) 14400
C) 720
D) 2880
✅ Answer: B) 14400
Arrange 5 men: 5! = 120. Women can sit in 6 gaps (between/outside men): ⁶P₃ = 120. Total = 120 × 120 = 14400.
🧠

Section 2: Logical Reasoning

Q21 – Q40
21
There are 6 cities, every city connected to each other. How many different routes from A to B such that no city is touched more than once?
A) 72
B) 65
C) 60
D) 48
✅ Answer: B) 65
Direct = 1. Via 1 city = 4. Via 2 = 4×3=12. Via 3 = 24. Via 4 = 24. Total = 1+4+12+24+24 = 65.
22
Find the next number in the series: 2, 6, 12, 20, 30, ?
A) 38
B) 40
C) 42
D) 44
✅ Answer: C) 42
Pattern: n(n+1) → 1×2, 2×3, 3×4, 4×5, 5×6, 6×7 = 42.
23
If MANGO is coded as NBOHP, how is APPLE coded?
A) BQQMF
B) BQQLE
C) CRRNG
D) ARPLE
✅ Answer: A) BQQMF
Each letter is shifted +1 (A→B, P→Q, P→Q, L→M, E→F) = BQQMF.
24
Pointing to a man, a woman says "His mother is the only daughter of my mother." How is the woman related to the man?
A) Grandmother
B) Mother
C) Sister
D) Aunt
✅ Answer: B) Mother
"Only daughter of my mother" = the woman herself. So the man's mother is the woman herself → she is his Mother.
25
A is to the east of B. C is to the north of B. In which direction is A with respect to C?
A) North-East
B) South-East
C) South-West
D) North-West
✅ Answer: B) South-East
C is north of B, A is east of B. So A is to the South-East of C.
26
In a row of 40 students, Ravi is 15th from the left. What is his position from the right?
A) 24
B) 26
C) 27
D) 25
✅ Answer: B) 26
Position from right = 40 − 15 + 1 = 26.
27
Find the odd one out: 8, 27, 64, 100, 125, 216
A) 27
B) 100
C) 125
D) 216
✅ Answer: B) 100
All others are perfect cubes: 2³=8, 3³=27, 4³=64, 5³=125, 6³=216. But 100 = 10², not a perfect cube.
28
All project managers handle ≥3 projects. Some project managers are department heads. Which conclusion is valid?
A) Some department heads handle at least 3 projects
B) All department heads are project managers
C) Department heads handle fewer projects
D) None of the above
✅ Answer: A
Since some PMs are department heads and all PMs handle ≥3 projects, those department heads also handle ≥3 projects.
29
Find the missing term: 1, 4, 9, 16, 25, __, 49
A) 34
B) 38
C) 36
D) 40
✅ Answer: C) 36
Series of perfect squares: 1², 2², 3², 4², 5², 6²=36, 7².
30
5 people A, B, C, D, E sit in a row. A is at the right end. B is between C and D. E is at the left end. C is between E and B. Who is in the middle?
A) C
B) B
C) D
D) E
✅ Answer: B) B
Arrangement: E–C–B–D–A. Person in the middle (3rd position) is B.
31
If 6 × 4 = 46, 8 × 5 = 58, then 9 × 7 = ?
A) 63
B) 97
C) 79
D) 96
✅ Answer: C) 79
Pattern: second number, then first number reversed → 6×4=46 (4,6) → 8×5=58 (5,8) → 9×7=79.
32
In a clock, how many times do the hands coincide between 12 noon and 12 midnight?
A) 12
B) 11
C) 10
D) 22
✅ Answer: B) 11
In 12 hours, clock hands overlap 11 times (they don't overlap at exactly 12 AM and 12 PM separately — just once).
33
A man walks 3 km north, turns right and walks 4 km east, turns right and walks 3 km south. How far is he from the start?
A) 4 km
B) 7 km
C) 5 km
D) 3 km
✅ Answer: A) 4 km
North 3 km → East 4 km → South 3 km. North and South cancel. He is exactly 4 km East from the start.
34
If the day before yesterday was Saturday, what day will it be the day after tomorrow?
A) Tuesday
B) Wednesday
C) Thursday
D) Friday
✅ Answer: B) Wednesday
Day before yesterday = Saturday → Today = Monday. Day after tomorrow = Wednesday.
35
Find the next term: ACE, BDF, CEG, ?
A) DFG
B) DFH
C) EGH
D) CFH
✅ Answer: B) DFH
Each letter increases by 1 each step. Pattern: C→D, E→F, G→H = DFH.
36
In a certain code, GIVE is written as 5137 and BAT is written as 924. How is GATE written?
A) 5247
B) 5924
C) 5942
D) 9247
✅ Answer: A) 5247
G=5, I=1, V=3, E=7. B=9, A=2, T=4. So GATE = G(5), A(2), T(4), E(7) = 5247.
37
Which number does not belong in the group: 16, 25, 36, 72, 144, 196?
A) 36
B) 72
C) 144
D) 196
✅ Answer: B) 72
All others are perfect squares (4², 5², 6², 12², 14²). 72 is not a perfect square.
38
A is B's sister. C is B's mother. D is C's father. E is D's mother. How is A related to D?
A) Daughter
B) Grand Daughter
C) Great-granddaughter
D) Mother
✅ Answer: B) Grand Daughter
A is B's sister → A and B are children of C. C is D's daughter. So A is D's Grand Daughter.
39
Deductive reasoning game (Geo-Sudo type): In a 3×3 grid, each row and column must contain 1–3 without repetition. If row 1 is [1, _, 3] and column 2 has 3 in row 2, what is row 1 missing number?
A) 2
B) 1
C) 3
D) Cannot determine
✅ Answer: A) 2
Row 1 has 1 and 3. The missing number must be 2 (each number 1–3 appears once per row).
40
What is the angle between the hour and minute hands at 3:15?
A) 0°
B) 7.5°
C) 15°
D) 22.5°
✅ Answer: B) 7.5°
At 3:15, minute hand = 90°. Hour hand = 90 + (15×0.5) = 97.5°. Difference = 7.5°.
📖

Section 3: Verbal Ability

Q41 – Q55
41
Choose the correct sentence: A) She don't know the answer. B) She doesn't knows the answer. C) She doesn't know the answer. D) She not know the answer.
A) Sentence A
B) Sentence B
C) Sentence C
D) Sentence D
✅ Answer: C
"She doesn't know the answer" uses correct subject-verb agreement with third-person singular.
42
Fill in the blank: The committee ______ yet to reach a decision. (has / have)
A) has
B) have
C) are
D) were
✅ Answer: A) has
"Committee" is a collective noun treated as singular in formal English → has.
43
Choose the antonym of BENEVOLENT:
A) Generous
B) Kind
C) Malevolent
D) Gentle
✅ Answer: C) Malevolent
Benevolent = wishing good. Malevolent = wishing harm. Exact opposite.
44
Choose the synonym of VERBOSE:
A) Concise
B) Wordy
C) Silent
D) Clear
✅ Answer: B) Wordy
Verbose means using more words than needed. Wordy is the closest synonym.
45
Spot the error: "The team are playing good in the tournament."
A) team are
B) No error
C) playing good
D) in the
✅ Answer: C) playing good
Should be "playing well" — "well" is the adverb modifying the verb "playing", not the adjective "good".
46
Choose the word closest in meaning to EPHEMERAL:
A) Eternal
B) Transient
C) Permanent
D) Stable
✅ Answer: B) Transient
Ephemeral = lasting for a very short time. Transient has the same meaning.
47
Fill in: Neither the manager nor the employees ______ present for the meeting.
A) was
B) were
C) is
D) has been
✅ Answer: B) were
With "neither…nor", the verb agrees with the subject closer to it (employees = plural) → were.
48
One word substitution: A person who cannot be corrected.
A) Inexplicable
B) Invincible
C) Incorrigible
D) Inexorable
✅ Answer: C) Incorrigible
Incorrigible means a person who cannot be reformed or corrected.
49
Rearrange: TRAMS / SMART / RAMPS — which is NOT an anagram of the others?
A) TRAMS
B) SMART
C) RAMPS
D) All are anagrams
✅ Answer: C) RAMPS
TRAMS and SMART both use T,R,A,M,S. RAMPS uses R,A,M,P,S — different letter (P instead of T) → not an anagram.
50
Choose the correct passive voice: "The manager approved the project."
A) The project was approved by the manager.
B) The project is approved by the manager.
C) The project had been approved the manager.
D) The project approved by the manager.
✅ Answer: A
Simple past active → past passive = "was + past participle by subject" → The project was approved by the manager.
51
Reading comprehension (common type): If the passage says "Technology is a double-edged sword," the author most likely means:
A) Technology is dangerous
B) Technology is beneficial
C) Technology has both benefits and drawbacks
D) Technology is neutral
✅ Answer: C
"Double-edged sword" is an idiom meaning something has both positive and negative effects simultaneously.
52
Which sentence uses the correct tense? "By the time she arrives, we ______ the project."
A) finish
B) finished
C) will have finished
D) were finishing
✅ Answer: C) will have finished
"By the time" with a future reference requires the future perfect tense.
53
Choose the correctly spelled word:
A) Accomodate
B) Acommodate
C) Accommodate
D) Accomadate
✅ Answer: C) Accommodate
Accommodate has double 'c' and double 'm' — a commonly misspelled word in Cognizant verbal tests.
54
Sentence completion: The new software was ______ by the team after weeks of testing. (A) inaugurated (B) demolished (C) deployed (D) confiscated
A) Inaugurated
B) Demolished
C) Deployed
D) Confiscated
✅ Answer: C) Deployed
In a tech context, software is deployed — released for use. This is common Cognizant verbal context.
55
Identify the type of error: "He is one of those employees who works late every night."
A) No error
B) Tense error
C) Subject-verb agreement error
D) Article error
✅ Answer: C
"One of those employees who" requires plural verb → should be "work late every night" because the relative clause refers to "employees" (plural).
💻

Section 4: Technical / CS Fundamentals

Q56 – Q75
56
What is the time complexity of Binary Search?
A) O(n)
B) O(log n)
C) O(n²)
D) O(1)
✅ Answer: B) O(log n)
Binary search halves the search space each iteration → O(log n) time complexity.
57
Which OOP concept is illustrated when a child class inherits methods from a parent class?
A) Encapsulation
B) Polymorphism
C) Inheritance
D) Abstraction
✅ Answer: C) Inheritance
Inheritance allows a class to reuse attributes and methods from another class, forming a parent-child relationship.
58
What does SDLC stand for, and what is its purpose?
A) Software Design Life Cycle — to design software
B) Software Development Life Cycle — systematic process for building software
C) System Deployment Life Cycle — deploying systems
D) Software Debug Life Cycle — fixing bugs
✅ Answer: B
SDLC (Software Development Life Cycle) is the structured process of planning, building, testing, and maintaining software. Phases: Requirement → Design → Implement → Test → Deploy → Maintain.
59
Why is Java considered more secure than C/C++?
A) Java uses pointers
B) Java has no explicit pointer manipulation and runs in JVM sandbox
C) Java is slower
D) Java doesn't use memory
✅ Answer: B
Java eliminates direct memory access via pointers. Programs run in the JVM sandbox, preventing direct OS-level attacks and buffer overflow exploits common in C/C++.
60
What is the output of: print(type([])) in Python?
A) <class 'tuple'>
B) <class 'list'>
C) <class 'dict'>
D) <class 'set'>
✅ Answer: B) <class 'list'>
[] is an empty list literal in Python. type([]) returns <class 'list'>.
61
Which data structure uses LIFO (Last In, First Out) principle?
A) Queue
B) Stack
C) Linked List
D) Tree
✅ Answer: B) Stack
A Stack follows LIFO — the last element added is the first one removed. Like a stack of plates.
62
What is polymorphism in OOP?
A) Hiding data from outside world
B) Inheriting from multiple classes
C) One interface, multiple implementations
D) Storing different data types
✅ Answer: C
Polymorphism means "many forms." The same method name can behave differently depending on the object. Example: method overloading and overriding.
63
What is the difference between a process and a thread?
A) No difference
B) A process has its own memory; threads share process memory
C) A thread is heavier than a process
D) Threads run on different CPUs only
✅ Answer: B
A process = independent program with its own memory. A thread = lightweight unit within a process that shares the same memory space.
64
What does the 'final' keyword mean in Java?
A) The class runs faster
B) Variable/method/class cannot be modified or overridden
C) Method is static
D) It initializes automatically
✅ Answer: B
In Java, final variable = constant, final method = can't be overridden, final class = can't be inherited.
65
What is a primary key in a database?
A) Any column in a table
B) A column (or set of columns) that uniquely identifies each row
C) A foreign key reference
D) An indexed column only
✅ Answer: B
A primary key uniquely identifies each record in a table. It cannot be NULL and must be unique for every row.
66
What is the worst-case time complexity of QuickSort?
A) O(n log n)
B) O(n²)
C) O(n)
D) O(log n)
✅ Answer: B) O(n²)
QuickSort's worst case is O(n²) when the pivot is always the smallest or largest element (e.g., sorted array with bad pivot choice). Average = O(n log n).
67
What is the output of this Java snippet? int x = 5; System.out.println(x++); System.out.println(x);
A) 6 and 6
B) 5 and 6
C) 5 and 5
D) 6 and 5
✅ Answer: B) 5 and 6
x++ is post-increment → prints current value (5) first, then increments. Next print shows 6.
68
Which HTTP method is used to update data on a server (partial update)?
A) GET
B) POST
C) PUT
D) PATCH
✅ Answer: D) PATCH
PATCH is for partial updates. PUT replaces the entire resource. POST creates new. GET retrieves.
69
In an array of size n, what is the time complexity of accessing element at index i?
A) O(1)
B) O(n)
C) O(log n)
D) O(n²)
✅ Answer: A) O(1)
Array elements are stored at contiguous memory locations. Access by index is direct → O(1) constant time.
70
What is encapsulation in OOP?
A) Bundling data and methods together, hiding internal details
B) Creating multiple child classes
C) Writing the same method with different parameters
D) Running code in parallel
✅ Answer: A
Encapsulation wraps data (variables) and methods inside a class and controls access using access modifiers (private, public, protected).
71
What is a deadlock in operating systems?
A) A process running too fast
B) Two or more processes waiting for each other's resources indefinitely
C) An infinite loop in code
D) Memory overflow
✅ Answer: B
A deadlock occurs when processes are stuck in a circular wait — each holds a resource the other needs, so none can proceed.
72
What is the purpose of the 'static' keyword in Java?
A) It makes a variable final
B) It belongs to the class, not to an instance
C) It prevents inheritance
D) It automatically initializes variables
✅ Answer: B
static means the variable or method belongs to the class itself, not to any particular object. All instances share the same static member.
73
What does HTML stand for?
A) Hyper Text Making Language
B) HyperText Markup Language
C) High Transfer Markup Language
D) Hyper Transfer Markup Language
✅ Answer: B) HyperText Markup Language
HTML is the standard language for creating web pages. It uses tags to structure content for display in browsers.
74
What is normalization in database design?
A) Organizing tables to reduce data redundancy and improve integrity
B) Speeding up queries with indexes
C) Encrypting the database
D) Backing up the database
✅ Answer: A
Normalization is the process of organizing database tables to minimize redundancy. Forms: 1NF, 2NF, 3NF, BCNF.
75
What is the difference between == and .equals() in Java?
A) == compares references; .equals() compares actual content/values
B) They are exactly the same
C) == compares values; .equals() compares memory
D) .equals() only works for integers
✅ Answer: A
== checks if two variables point to the same object in memory. .equals() checks if the content of two objects is the same.
⌨️

Section 5: Coding Problems (GenC Next)

Q76 – Q85
76
Write a function to check if a string is a palindrome. What is the most efficient approach?
A) Use nested loops O(n²)
B) Use two-pointer technique O(n)
C) Reverse and compare using recursion O(n log n)
D) Sort and compare O(n log n)
✅ Answer: B) Two-pointer O(n)
Compare characters from both ends moving inward. If any mismatch → not a palindrome.
def is_palindrome(s): left, right = 0, len(s) - 1 while left < right: if s[left] != s[right]: return False left += 1 right -= 1 return True
77
There are N suns in a galaxy, each with M planets, each with some moons [galaxy[i][j]]. Find the maximum number of moons in any single solar system.
A) Sum each row, return maximum row sum
B) Find the maximum single cell value
C) Sum all values in the entire grid
D) Count number of columns
✅ Answer: A — Sum rows, find maximum
Each solar system (row) = one sun. Sum all moons per sun, return the highest total.
def max_moons(galaxy): max_sum = 0 for solar_system in galaxy: max_sum = max(max_sum, sum(solar_system)) return max_sum
78
Find the second largest element in an unsorted array without sorting it. What is the time complexity?
A) O(n log n) — sort then pick
B) O(n) — single pass tracking two variables
C) O(n²) — nested loops
D) O(1) — direct access
✅ Answer: B) O(n)
Track first and second max in one pass.
def second_largest(arr): first = second = float('-inf') for n in arr: if n > first: second = first first = n elif n > second and n != first: second = n return second
79
Reverse a linked list. Which approach uses O(1) extra space?
A) Store in array then rebuild
B) Iterative three-pointer technique
C) Recursive approach
D) Sort the linked list
✅ Answer: B) Iterative — O(1) space
Use prev, curr, next pointers. No extra memory needed.
def reverse_list(head): prev = None curr = head while curr: nxt = curr.next curr.next = prev prev = curr curr = nxt return prev
80
Given an array, find the two numbers that add up to a target sum. What is the most efficient approach?
A) Brute force O(n²)
B) Sort then binary search O(n log n)
C) Hash map — O(n)
D) Two-pointer on unsorted — O(n²)
✅ Answer: C) Hash map — O(n)
Store visited numbers in a set/dict and check if complement exists.
def two_sum(nums, target): seen = {} for i, n in enumerate(nums): diff = target - n if diff in seen: return [seen[diff], i] seen[n] = i
81
Write a program to print Fibonacci series up to N terms. What is the space-optimized approach?
A) Store entire series in array — O(n) space
B) Keep only last two values — O(1) space
C) Recursive — O(n) stack space
D) Use a queue
✅ Answer: B) O(1) space
a, b = 0, 1 for _ in range(n): print(a, end=" ") a, b = b, a + b
82
Count occurrences of each character in a string. Which data structure is best?
A) Array of size 26 (for lowercase)
B) Dictionary / HashMap
C) Stack
D) Linked list
✅ Answer: B) Dictionary
from collections import Counter freq = Counter("hello world") # {'l': 3, 'o': 2, 'h': 1, ...}
83
What does this code output?
x = [1, 2, 3]; y = x; y.append(4); print(x)
A) [1, 2, 3]
B) [1, 2, 3, 4]
C) Error
D) [4, 1, 2, 3]
✅ Answer: B) [1, 2, 3, 4]
y = x does NOT copy the list — both y and x point to the same list object. Modifying y also modifies x. This is Python's reference semantics.
84
Find if a number is prime. What is the most efficient method up to √n?
A) Check divisibility up to n — O(n)
B) Check divisibility up to √n — O(√n)
C) Sieve of Eratosthenes for one number
D) Use modulo of n/2
✅ Answer: B) O(√n)
import math def is_prime(n): if n < 2: return False for i in range(2, int(math.sqrt(n)) + 1): if n % i == 0: return False return True
85
Given a string, find the first non-repeating character. E.g., "swiss" → 'w'
A) Build frequency map then scan in order — O(n)
B) Nested loops to check each char — O(n²)
C) Sort the string — O(n log n)
D) Use recursion
✅ Answer: A) O(n)
from collections import Counter def first_unique(s): freq = Counter(s) for ch in s: if freq[ch] == 1: return ch return None
🗄️

Section 6: SQL & DBMS

Q86 – Q93
86
What is the difference between WHERE and HAVING in SQL?
A) No difference
B) WHERE filters rows before grouping; HAVING filters groups after GROUP BY
C) HAVING is faster than WHERE
D) WHERE works only on strings
✅ Answer: B
WHERE filters individual rows before any grouping. HAVING filters after GROUP BY — used with aggregate functions like COUNT, SUM, AVG.
87
Write a query to find employees who earn more than the average salary.
A) SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
B) SELECT * FROM employees HAVING salary > AVG(salary);
C) SELECT AVG(salary) FROM employees WHERE salary > 0;
D) SELECT * FROM employees ORDER BY salary DESC;
✅ Answer: A
SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
88
What is the difference between INNER JOIN and LEFT JOIN?
A) INNER JOIN returns only matching rows; LEFT JOIN returns all rows from left table even without a match
B) They are the same
C) LEFT JOIN is faster
D) INNER JOIN returns all rows from both tables
✅ Answer: A
INNER JOIN = only rows where condition matches in BOTH tables. LEFT JOIN = all rows from left table + matched rows from right (NULLs for no match).
89
What is a foreign key?
A) Key from another database
B) A column that references the primary key of another table
C) An alternate primary key
D) A key that allows NULL values only
✅ Answer: B
A foreign key establishes a relationship between two tables. It references the primary key of another table to maintain referential integrity.
90
Write a query to find the second highest salary from an Employee table.
A) SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
B) SELECT salary FROM employees ORDER BY salary DESC LIMIT 1;
C) SELECT MIN(salary) FROM employees;
D) SELECT salary FROM employees GROUP BY salary;
✅ Answer: A
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
91
What does the GROUP BY clause do in SQL?
A) Sorts the results
B) Groups rows with the same values into summary rows for aggregate functions
C) Filters duplicate rows
D) Joins multiple tables
✅ Answer: B
GROUP BY groups rows sharing a value so aggregate functions (COUNT, SUM, AVG) can be applied per group. Example: count employees per department.
92
What is the difference between DELETE, DROP, and TRUNCATE in SQL?
A) DELETE removes rows (can rollback); TRUNCATE removes all rows (faster, no rollback); DROP removes the entire table
B) They are all the same
C) DROP is reversible, DELETE is not
D) TRUNCATE removes the table structure
✅ Answer: A
DELETE: removes specific rows, logged, can be rolled back. TRUNCATE: removes all rows instantly, not easily rolled back. DROP: removes the entire table including its structure.
93
What is an index in a database and why is it used?
A) It sorts data alphabetically
B) It speeds up data retrieval by creating a lookup structure
C) It encrypts the table
D) It is used to join tables
✅ Answer: B
A database index is like a book's table of contents — it allows the database engine to find rows quickly without scanning the entire table. It speeds up SELECT queries but slightly slows INSERT/UPDATE.
🤝

Section 7: HR Interview Questions

Q94 – Q100
94
Tell me about yourself. What should you focus on?
A) Your entire life story
B) Your family background
C) Education → Skills → Projects → Why Cognizant
D) Your hobbies only
✅ Best Approach
Structure: Name + degree + college → key technical skills → most relevant project → why you want to work at Cognizant. Keep it to 90 seconds. End with enthusiasm about the role.
95
Why do you want to work at Cognizant?
A) "Because it pays well"
B) Mention Cognizant's work culture, learning opportunities, digital transformation projects
C) "I applied everywhere"
D) "It's close to my home"
✅ Best Approach
Talk about Cognizant's focus on digital transformation, cloud, AI, and their global presence. Mention how their GenC/GenC Next training programs align with your goal of building a strong technical foundation early in your career.
96
What is your greatest weakness?
A) "I have no weaknesses"
B) "I work too hard"
C) Name a real weakness + what you're doing to improve it
D) "I hate working in teams"
✅ Best Approach
Be honest but strategic. Example: "I sometimes struggle with public speaking, but I've been joining group discussions and tech meetups to practice. I've noticed a visible improvement in the last few months." Shows self-awareness + initiative.
97
Where do you see yourself in 5 years?
A) "Running my own company"
B) "In your position"
C) "Growing into a technical lead role within Cognizant, specializing in cloud/AI"
D) "Retired"
✅ Best Approach
Show ambition but tie it to Cognizant's growth. Example: "I want to develop expertise in cloud solutions and eventually contribute as a solution architect. I see Cognizant as the perfect place to grow because of your training programs and global projects."
98
Describe a situation where you worked in a team to solve a problem. (STAR method)
A) Make up a story
B) Say you always work alone
C) Use Situation → Task → Action → Result format with a real example
D) Keep it vague
✅ Best Approach
Use the STAR method: Situation (project context) → Task (your role) → Action (what you did specifically) → Result (measurable outcome). Example: College project where your team was stuck on a bug and you led the debugging session, reducing submission delay from 2 days to 6 hours.
99
Are you comfortable relocating?
A) "Yes, I am open to relocation" (if true)
B) Refuse without explanation
C) Negotiate aggressively
D) Ask them to confirm your city first
✅ Best Approach
Cognizant often posts across multiple cities. If you're open to relocation, say so clearly and positively: "Yes, I'm open to working wherever the opportunity is. I believe exposure to different work environments will help me grow faster."
100
Do you have any questions for us? (End of interview)
A) "No, I'm good"
B) Ask about salary immediately
C) Ask about the team, training program, or a recent Cognizant project
D) Ask when you'll get the offer letter
✅ Best Approach
Always have 1–2 thoughtful questions ready. Examples: "What does the typical learning curve look like for a GenC associate in the first 6 months?" or "What technologies does the team I'd be joining primarily work with?" This shows genuine interest and preparation.

🎯 Ready to Crack the Cognizant OA?

You've just gone through 100 real questions. Now it's time to practice under timed conditions. Accuracy + Speed = Selection.

✅ No negative marking — attempt everything
⏱️ Practice with a timer daily
💡 Revise weak topics every 3 days

© 2025 Campusmonk — One Stop Solution for All Your Placement Needs