Interview experience
CGI Interview Questions and Answers (2026)
Overview
Section titled “Overview”CGI runs a classic IT-services funnel - aptitude-heavy OA, resume-anchored technical rounds, HR close - but larger drives split the technical stage into two rounds of increasing depth rather than one.
CGI interview process at a glance
Section titled “CGI interview process at a glance”| Round | Duration | What they test |
|---|---|---|
| Online assessment (AMCAT-style) | - | Quant aptitude, verbal, technical MCQs (Java/SQL/OOPs), 1-2 coding problems, sectional cutoffs |
| Group discussion (some drives) | - | Communication, teamwork, articulation |
| Technical interview 1 | 30-45 min | OOPs, collections, tree/graph traversal, resume project |
| Technical interview 2 (larger drives) | 30-45 min | Pattern printing, Tries, Linux internals, deeper CS fundamentals |
| HR interview | ~30 min | Career history, motivation, team fit |
Online assessment
Section titled “Online assessment”A proctored, often AMCAT-style test run in modules - quant aptitude, verbal ability/English, and a coding section with sectional cutoffs on some drives, alongside technical MCQs on Java, SQL, and OOPs.
Common questions
- Quantitative aptitude and logical reasoning MCQs
- Coding: frequency sorting, merge sort implementation
- Basic MySQL query writing
- Java/OOPs concept MCQs
Group discussion (some drives)
Section titled “Group discussion (some drives)”When included, a short discussion round on a general or current-affairs topic to gauge communication clarity and how you hold your position in a group setting, before the technical interviews.
Common questions
- General current-affairs or technology-trend prompts
- Structured “for and against” business/tech topics
Technical interview(s)
Section titled “Technical interview(s)”The first technical round centers on OOPs and Java collections fundamentals plus your resume project; when a drive runs a second round, it goes noticeably deeper into data structures and systems topics.
Common questions
- Explain the Object class in Java and why every class inherits from it
- Implement a stack or queue and walk through tree traversal (inorder/preorder/postorder)
- Explain Dijkstra’s algorithm and where you’d use it
- Basic multithreading concepts in Java
- Write a MySQL query joining two tables
- Pattern printing and Trie-based problems (second round, larger drives)
- Basic Linux internals questions (second round, larger drives)
Full technical narratives are on the CGI interview experience page.
HR interview
Section titled “HR interview”A closing conversation on job role and location fit, family background, and motivation for CGI - on at least one report, folded into the same panel as the final technical discussion rather than run as a separate step.
Common questions
- Tell me about yourself and your family background
- Why CGI, and what do you know about the company?
- What job role and location are you open to?
- Walk me through a project on your resume - technologies used and your specific contribution
- What kind of team environment do you work best in?
Sample answer frameworks for each of these are on the CGI HR interview questions page.
Why some drives run two technical rounds
Section titled “Why some drives run two technical rounds”Not every CGI drive is the same depth - smaller drives often close the technical stage in a single round on OOPs and your resume project, while larger campus drives (reportedly funnelling 85 shortlisted candidates down to 16 offers) add a second, harder technical round on pattern printing, Tries, and Linux internals. If your drive is large, budget prep time for genuinely deeper DS/systems topics beyond basic OOPs - the bar rises noticeably between round one and round two.
Common technical interview questions and answers
Section titled “Common technical interview questions and answers”Q: Explain the Object class in Java and why every class inherits from it
Object is the implicit root of the Java class hierarchy - any class that does not explicitly extend another silently extends Object, which guarantees a common set of methods on every reference type. Those methods are equals, hashCode, toString, getClass, clone, finalize, and the threading trio wait, notify and notifyAll. This universality is what makes collections work: a HashMap can store any object because it can always call hashCode and equals on it. The contract interviewers test is that equal objects must return the same hashCode - if you override equals without overriding hashCode, two logically equal keys land in different buckets and your HashMap lookup silently fails.
Q: Compare ArrayList, LinkedList, HashMap and HashSet in Java collections
ArrayList is backed by a resizable array: get by index is O(1), but inserting or removing in the middle is O(n) because elements shift, and growth copies into a larger array. LinkedList is a doubly linked list: add or remove at either end is O(1), but get by index is O(n), so it only wins when you mutate the ends heavily. HashMap stores key-value pairs in buckets by hash, giving O(1) average get and put, degrading to O(log n) in modern Java once a bucket converts from a list to a tree. HashSet is simply a HashMap where all values point at a dummy object, so it gives O(1) contains but no ordering - use LinkedHashSet to preserve insertion order or TreeSet for sorted order at O(log n).
Q: Implement a queue using two stacks
Keep an input stack and an output stack. Enqueue always pushes onto the input stack in O(1). Dequeue checks the output stack: if it is empty, pop every element from input and push it onto output, which reverses the order so the oldest element is now on top, then pop from output. Each element is moved at most twice across its lifetime, so dequeue is O(1) amortised even though a single dequeue can cost O(n). The mistake interviewers look for is transferring on every dequeue rather than only when the output stack is empty, which makes every operation O(n).
Q: Explain the three binary tree traversals and where each is used
Inorder visits left subtree, node, then right subtree, and on a binary search tree it emits the keys in sorted order, which is how you verify a BST. Preorder visits node, left, then right, and is used to serialise or clone a tree because the root arrives before its children. Postorder visits left, right, then node, and is used for deletion and for evaluating expression trees, since children must be handled before the parent. All three are O(n) time with O(h) stack space, where h is the height - O(log n) balanced, O(n) in the worst case. Level-order is the fourth traversal and needs a queue rather than recursion.
Q: Explain Dijkstra’s algorithm and where you would use it
Dijkstra finds the shortest path from one source to every other vertex in a graph with non-negative edge weights. It maintains a distance array initialised to infinity except the source at zero, and repeatedly extracts the unvisited vertex with the smallest tentative distance from a min-heap, relaxing each of its outgoing edges by checking whether going through the current vertex beats the stored distance. With a binary heap it runs in O((V + E) log V). It fails on negative edge weights because once a vertex is finalised it is never revisited, so a later negative edge could have improved it - that is when you switch to Bellman-Ford at O(V*E). Practical uses are network routing, map navigation, and any least-cost pathfinding.
Q: Explain multithreading in Java - thread lifecycle and synchronization
A Java thread moves through NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING and TERMINATED states, and you create one by implementing Runnable rather than extending Thread, since Java allows only single inheritance. Calling start() spawns a new thread of execution, while calling run() directly just executes on the current thread - a classic trap question. The synchronized keyword makes a method or block mutually exclusive on an object monitor, and volatile guarantees visibility of a variable across threads without providing atomicity, so a volatile counter increment is still unsafe. In production code prefer the java.util.concurrent utilities - ExecutorService for pooling, AtomicInteger for lock-free counters, and ConcurrentHashMap - over hand-rolled synchronized blocks.
Q: What is a Trie and when is it better than a HashMap?
A Trie, or prefix tree, stores strings by character along tree edges, so all words sharing a prefix share a path, and each node carries a flag marking the end of a word. Search, insert and delete are O(L) where L is the word length, independent of how many words are stored - a HashMap is also roughly O(L) because it must hash the whole string, so raw lookup is not the reason to choose a Trie. The real advantage is prefix operations: listing every word starting with a given prefix is a single walk plus a subtree traversal, which a HashMap cannot do without scanning every key. That makes Tries the right structure for autocomplete, spell-checkers, and IP routing tables, at the cost of higher memory - compress with a radix tree if that matters.
Q: Write a MySQL query joining two tables and explain the join types
For employees and departments: SELECT e.name, d.dept_name FROM employees e INNER JOIN departments d ON e.dept_id = d.dept_id; INNER JOIN returns only matching rows in both tables. LEFT JOIN returns every row from the left table with NULLs where the right has no match, which is how you find orphan records by adding WHERE d.dept_id IS NULL. RIGHT JOIN is the mirror image, and MySQL has no FULL OUTER JOIN, so you emulate it with a UNION of the left and right joins. The performance point interviewers probe is that the join column should be indexed on both sides, otherwise MySQL falls back to a nested-loop scan of the inner table for every outer row.
Frequently asked questions about CGI interviews
Section titled “Frequently asked questions about CGI interviews”What is the CGI interview process for freshers?
CGI’s fresher hiring for Software Developer roles usually runs three to four stages: a proctored online test (often AMCAT-style, in modules covering quant aptitude, verbal ability, and coding, sometimes with sectional cutoffs) covering technical MCQs on Java/OOPs/SQL; one or two technical interviews (about 30-60 minutes each); and a closing HR interview. Some drives add a group discussion before the technical rounds.
What questions are asked in CGI interviews?
Technical interviewers stay close to your resume - expect detailed questions on the projects and technologies you list, plus OOPs fundamentals (Object class, collections, stacks/queues, tree traversal), basic SQL/MySQL queries, and live coding or debugging on a shared screen. A second technical round, when there is one, can go deeper into data structures (Trie, pattern printing) or core topics like Linux internals. The HR round is behavioural and culture-focused: career history, why CGI, and what kind of team environment you prefer.
How many rounds are there in the CGI interview?
CGI typically runs 3-4 rounds: an online assessment, one or two technical interviews, and a final HR interview. When the OA has sectional cutoffs, you need to clear every section, not just the overall score, to advance.
Does CGI have two technical interview rounds?
It can, especially on larger campus drives. One reported drive ran a first technical round on OOPs and collections fundamentals (Object class, stacks/queues, tree traversal, Dijkstra’s algorithm, multithreading) followed by a second round going deeper into pattern printing, Tries, and Linux internals - only a fraction of the 85 shortlisted candidates converted to offers.
How should I prepare for CGI interviews?
Revise Java, SQL, and OOPs fundamentals (especially collections and tree/graph traversal) along with quant aptitude, practise structured group-discussion participation if your drive includes one, and be ready to explain your academic projects in depth - the technology choices, your specific role, and the challenges you solved.

