c2cedge
Aptitude & Reasoning · D — Programming Aptitude

Company-Pattern Practice

Stress-test your fundamentals against real screening-round difficulty — wordier, multi-step, and built on the twists TCS, Infosys and Wipro favour.

Difficulty: Exam levelTime / question: ~90 secStyle: TCS / Infosys / Wipro

The chapter drills build your fundamentals; this section is where you stress-test them. Every question here is pitched at real screening-round difficulty — wordier, multi-step, and built on the twists these tests favour. Work each one fully before reading the solution, and time yourself: about 90 seconds per question is the bar. These are original questions written to match each company's pattern, not copies of their actual papers.

TCS NQT — Quantitative pattern

Number theory, remainders, alternate-work, mixtures and clocks — the TCS staples.

Worked example
How many trailing zeros are there in 30! (30 factorial)?
  1. Trailing zeros come from factors of 10, and each 10 = 2 × 5. Since 2s outnumber 5s in a factorial, the number of 5s decides the count.
  2. Count multiples of 5 up to 30: floor(30 / 5) = 6.
  3. Add the extra 5 from multiples of 25: floor(30 / 25) = 1.
  4. Total 5s = 6 + 1 = 7, so 30! ends in 7 zeros.
Worked example
Find the remainder when 7 raised to the power 100 is divided by 5.
  1. Reduce the base mod 5 first: 7 leaves remainder 2, so 7^100 behaves like 2^100 mod 5.
  2. Find the cycle of 2^n mod 5: 2, 4, 3, 1 — a period of 4.
  3. 100 ÷ 4 leaves remainder 0, which points to the last value in the cycle.
  4. The last value is 1, so the remainder is 1.
Worked example
Find the largest number that divides 1356, 1868 and 2764, leaving the same remainder in each case.
  1. A number leaving the same remainder across several numbers must exactly divide the differences between them.
  2. Differences: 1868 − 1356 = 512 and 2764 − 1868 = 896.
  3. Answer = HCF of the differences. 512 = 2^9 and 896 = 2^7 × 7, so HCF = 2^7 = 128.
  4. Confirm with 2764 − 1356 = 1408 = 2^7 × 11, also divisible by 128.
Worked example
Pipe A fills a tank in 6 hours and pipe B in 8 hours. They are opened alternately for one hour each, starting with A. When is the tank full?
  1. Take the tank as LCM(6, 8) = 24 units. A fills 24/6 = 4 units/hour, B fills 24/8 = 3 units/hour.
  2. One A-then-B cycle of 2 hours fills 4 + 3 = 7 units.
  3. After 3 full cycles (6 hours), 3 × 7 = 21 units are in, leaving 24 − 21 = 3 units.
  4. The 7th hour is A's turn at 4 units/hour; 3 units take 3/4 of an hour. Total = 6 h + 45 min.
Worked example
A vessel holds 40 litres of pure milk. 4 litres is drawn out and replaced with water; this is done a second time. How much milk now remains?
  1. Replacement rule: after each draw-and-replace, milk left = previous milk × (1 − fraction removed).
  2. Fraction removed each time = 4/40 = 1/10, so the multiplier is 9/10.
  3. Applied twice: milk = 40 × (9/10)² = 40 × 81/100.
  4. = 32.4 litres of milk (the other 7.6 litres is water).
Worked example
A boat covers 24 km downstream in 3 hours and returns in 4 hours. Find the speed of the boat in still water and the speed of the stream.
  1. Downstream speed = 24/3 = 8 km/h; upstream speed = 24/4 = 6 km/h.
  2. Downstream = boat + stream; upstream = boat − stream.
  3. Boat = (8 + 6)/2 = 7 km/h.
  4. Stream = (8 − 6)/2 = 1 km/h.
Worked example
The ratio of the present ages of A and B is 5 : 7. Six years from now the ratio will be 3 : 4. Find their present ages.
  1. Let present ages be 5x and 7x.
  2. Six years later: (5x + 6)/(7x + 6) = 3/4.
  3. Cross-multiply: 20x + 24 = 21x + 18 → x = 6.
  4. Ages = 5×6 = 30 and 7×6 = 42. Check: 36/48 = 3/4. ✓
Worked example
A sells an item to B at a 20% profit, and B sells it to C at a 25% profit. If C pays Rs 225, what was A's cost price?
  1. Each sale multiplies the price: C's price = A's cost × 1.20 × 1.25.
  2. 1.20 × 1.25 = 1.50, so C's price = 1.5 × (A's cost).
  3. 1.5 × (A's cost) = 225.
  4. A's cost = 225 / 1.5 = 150.
Worked example
What is the angle between the hands of a clock at 4:20?
  1. Use angle = |30H − 5.5M| with H = 4, M = 20.
  2. 30 × 4 = 120 and 5.5 × 20 = 110.
  3. Angle = |120 − 110| = 10 degrees (the hour hand has moved well past the 4).
Worked example
A number when divided by 5 leaves remainder 3, and when divided by 7 leaves remainder 4. What is the smallest such positive number?
  1. List numbers leaving remainder 3 on division by 5: 3, 8, 13, 18, 23, …
  2. Keep those leaving remainder 4 on division by 7: 18 = 7×2 + 4. ✓
  3. Check 18: 18 = 5×3 + 3 and 18 = 7×2 + 4 — both hold.
  4. No smaller number satisfies both.

Infosys — Reasoning & Data Sufficiency pattern

Coded relations, data sufficiency, multi-statement syllogisms and deduction — Infosys' heartland.

Worked example
Data Sufficiency — What is the value of x? (I) x is a prime number between 10 and 20. (II) The sum of the digits of x is 8.
  1. The goal is a single value of x, so test whether each statement pins one number.
  2. Statement I alone: primes between 10 and 20 are 11, 13, 17, 19 — four candidates, not sufficient.
  3. Statement II alone: digit sum 8 fits 17, 26, 35, 44, … — many numbers, not sufficient.
  4. Together: among {11, 13, 17, 19} only 17 has digit sum 8 — unique.
Worked example
If 'A + B' means A is the father of B, 'A × B' means A is the brother of B, and 'A − B' means A is the wife of B, then how is P related to S in 'P + Q × R − S'?
  1. Decode left to right. P + Q: P is the father of Q.
  2. Q × R: Q is the brother of R, so P is also the father of R.
  3. R − S: R is the wife of S — so S is her husband.
  4. P is the father of R, and R is married to S, so P is S's father-in-law.
Worked example
Statements: All pens are pencils. Some pencils are erasers. All erasers are sharpeners. Conclusions: (I) Some sharpeners are pencils. (II) Some pens are erasers.
  1. Diagram: pens inside pencils; an overlap of pencils with erasers; all erasers inside sharpeners.
  2. Conclusion I: the pencils that are erasers are also sharpeners, so those sharpeners are pencils — it follows.
  3. Conclusion II: pens lie inside pencils, but the 'some pencils that are erasers' need not include any pen — it does not follow.
Worked example
Data Sufficiency — Is the positive integer N divisible by 6? (I) N is divisible by 3. (II) N is even.
  1. A number is divisible by 6 exactly when divisible by both 2 and 3.
  2. Statement I alone (divisible by 3): nothing about 2 — not sufficient.
  3. Statement II alone (even): nothing about 3 — not sufficient.
  4. Together: divisible by 3 and 2, therefore by 6.
Worked example
Pointing to a photograph, a man says, 'I have no brother or sister, but that man's father is my father's son.' Whose photograph is it?
  1. Focus on 'my father's son'.
  2. The man has no brother, so 'my father's son' can only be the speaker himself.
  3. So 'that man's father' is the speaker — meaning the man in the photo is the speaker's son.
Worked example
A man walks 10 m south, turns left and walks 10 m, turns left again and walks 10 m, then turns right and walks 10 m. Which direction does he face, and how far is he from the start?
  1. He starts walking 10 m south (now facing south).
  2. Turn left (south → east), walk 10 m east. Turn left again (east → north), walk 10 m north.
  3. The 10 m south and 10 m north cancel, leaving zero net north-south.
  4. Turn right (north → east), walk 10 m east. Total east = 10 + 10 = 20 m. He faces east, 20 m from start.
Worked example
Find the next term in the series: 3, 5, 11, 29, __
  1. No obvious ratio, so look at the differences: 5−3 = 2, 11−5 = 6, 29−11 = 18.
  2. Those differences — 2, 6, 18 — are each multiplied by 3.
  3. Next difference = 18 × 3 = 54.
  4. Next term = 29 + 54 = 83. (Equivalently, each term = 3 × previous − 4.)
Worked example
An advertisement reads: 'Visit our store today — all items at 50% off.' Which is/are implicit? (I) Customers are attracted by discounts. (II) The store wants to increase its sales.
  1. An implicit assumption is something the statement takes for granted; test each by negation.
  2. Assumption I: if customers weren't attracted by discounts, advertising '50% off' would be pointless — implicit.
  3. Assumption II: a discount drive aims to boost sales — implicit too.

Wipro / Cognizant — Mixed aptitude pattern

AMCAT-style mix of arithmetic, counting and probability at moderate-to-hard level.

Worked example
The population of a town rises 10% in the first year and falls 10% in the next. If it is now 29,700, what was it two years ago?
  1. A 10% rise then a 10% fall multiplies the original by 1.10 × 0.90 = 0.99 — a net 1% drop, not zero.
  2. So 0.99 × (original) = 29,700.
  3. Original = 29,700 / 0.99 = 30,000.
Worked example
8 men can complete a piece of work in 12 days. After working for 4 days, 4 men leave. How many more days will the remaining men take?
  1. Total work = 8 × 12 = 96 man-days.
  2. In 4 days, 8 men complete 8 × 4 = 32 man-days, leaving 96 − 32 = 64 man-days.
  3. After 4 men leave, 4 men remain.
  4. Remaining time = 64 / 4 = 16 days.
Worked example
A bag contains 5 red and 4 green balls. Two balls are drawn at random. What is the probability that both are red?
  1. Probability = favourable selections / total selections, using combinations (order doesn't matter).
  2. Total ways to choose 2 from 9 = C(9, 2) = 36.
  3. Ways to choose 2 red from 5 = C(5, 2) = 10.
  4. P(both red) = 10/36 = 5/18.
Worked example
In how many ways can the letters of the word TABLE be arranged so that the two vowels always come together?
  1. TABLE has vowels A, E and consonants T, B, L. 'Vowels together' means glue them into one block.
  2. That block plus the 3 consonants make 4 units, arranging in 4! = 24 ways.
  3. Within the block, the 2 vowels swap in 2! = 2 ways.
  4. Total = 24 × 2 = 48 arrangements.
Worked example
A shopkeeper marks his goods 25% above cost and then allows a discount of 12%. Find his profit or loss percent.
  1. Anchor cost at 100, so marked price = 125.
  2. Discount applies to the marked price: SP = 125 × (1 − 0.12) = 125 × 0.88 = 110.
  3. Profit on cost: (110 − 100)/100 × 100 = 10%.
Worked example
A sum of money at compound interest amounts to Rs 1210 in 2 years and Rs 1331 in 3 years. Find the annual rate and the original sum.
  1. Between year 2 and year 3 the amount grows by one year's interest, so divide the consecutive amounts.
  2. 1331 / 1210 = 1.10 = (1 + R/100), giving R = 10%.
  3. Amount after 2 years = P × (1.10)² = 1210, so P × 1.21 = 1210.
  4. P = 1210 / 1.21 = 1000.
⚠ Watch out
  • These questions are wordier on purpose — read the final line first to know exactly what is asked.
  • Watch the both-ways traps: +x% then −x% is a net loss/drop of (x/10)² or x²/100, never zero.
  • In data sufficiency, judge each statement alone before combining — don't smuggle one into the other.
Takeaways
  • Pattern, then arithmetic. Almost every item here is a named shortcut wearing a longer disguise.
  • Trace and verify. Confirm the final condition (a check line) before committing the answer.
  • Time the bar. ~90 seconds per question — if you cross it, mark, skip and return.
  • Reps build speed. You fall to the level of your practice, so do these fully before reading the solution.
Practice this — take a timed mock →
1,300+ questions, scored, with a weak-area report.
Know who's ready. Not who finished.
HomeLibraryPrivacyTerms