The Ignite coding section is optional: one problem, 30 minutes, any of C, C++, Java, Python or Perl. It is deliberately simple — the kind of program a BCA student writes in the first semester — and attempting it well is the strongest signal you can send to the interview panel. Below: three programming MCQs of the kind asked in the technical round, and two real online-test coding problems with solutions in four languages.
Programming fundamentals MCQs
A binary search tree is built by inserting the keys in this order: 4, 2, 1, 3, 6, 5, 7 (4 becomes the root). What is the left child of 6?
For a character array holding a string in C, which statement about sizeof() and strlen() is correct?
Which of these operators cannot be overloaded in C++?
Coding problems asked in TCS online tests
Read a single word (lowercase letters, no spaces). Print every character that appears more than once, along with how many times it appears, one per line, in the order in which each character first appears in the word. If there are no duplicates, print -1.
Input: programming
Output: r 2 g 2 m 2
r, g and m each appear twice; p, o, a, i, n appear once.
Input: python
Output: -1
- 1 ≤ length ≤ 10⁵
- Input contains only lowercase letters a–z.
Read two positive integers A and B and print their least common multiple (LCM) — the smallest positive integer that is divisible by both.
Input: 12 18
Output: 36
Input: 7 5
Output: 35
Co-prime numbers: the LCM is simply the product.
- 1 ≤ A, B ≤ 10⁹ — the product can exceed 32 bits, so use 64-bit arithmetic.
Programs to have ready
Reverse a string without built-ins · check palindrome · count vowels · find duplicate characters · factorial (loop and recursion) · Fibonacci series · prime check · Armstrong number · LCM and GCD · swap two numbers without a third variable · frequency of array elements · largest and second-largest in an array · simple pattern printing (pyramid, Pascal's triangle). Every one of these has appeared in TCS coding sections or interviews.
Read input from standard input and print exactly what is asked — no extra prompts like "Enter a number:", which fail the automated check.


