Autocoder

Cognizant Interview Questions for Freshers

Last updated 2026-11-19

Cognizant's fresher process is commonly reported to move from an aptitude test to a bug-fixing coding round and then an interview. This page gives twelve practice questions with worked answers, tilted towards Java, SQL and the debugging mindset that GenC-style rounds reward.

For the process read how to crack the Cognizant interview; for the coding round see Cognizant coding round questions.

StagesAptitude, coding (often AMCAT Automata Fix), interview (commonly reported)
TiersGenC, GenC Pro, GenC Next
Careers sitecareers.cognizant.com/india/en

Cognizant rounds as commonly reported

Prep sources describe an online aptitude test covering quantitative, logical and verbal reasoning, then a coding round that is often a bug-fixing format on the AMCAT platform (Automata Fix), and finally an interview with technical and HR parts, with project review in some higher-tier cycles. Candidates are routed to GenC or higher tiers such as GenC Pro or GenC Next based on performance. Eligibility and structure differ by campus and cycle, so read the official GenC page rather than relying on forums.

What to focus on

Hiring status

For current news, read Cognizant hiring, which lists sourced updates. Only the facts below are quoted here, each with its source, and they were checked on 19 November 2026.

Cognizant Interview Questions for Freshers: questions with worked answers

  1. 1

    Why do you want to join Cognizant?

    easy

    Be concrete about what you want from the job: work on enterprise systems for clients across industries, structured onboarding for freshers, and a path to build skills in cloud, data or testing. If you know which programme you are applying for, such as GenC, mention you have read what the track involves. Avoid repeating salary or brand as the reason. Close with what you bring: for example Java and SQL practice and a project built end to end.

  2. 2

    Tell me about a time you worked under pressure.

    medium

    Use STAR. Example: two days before a college project demo, the database layer failed; you split the work with a teammate, wrote a minimal data-access class, and added a seed script so the demo ran on stable data. Result: demo delivered, and you added automated tests afterwards. Show calm prioritisation, communication and a lesson learnt. Do not pick an example where the pressure was caused by your own procrastination without saying what you changed.

  3. 3

    ArrayList versus LinkedList in Java.

    easy

    ArrayList is a resizable array: O(1) get by index, amortised O(1) append, O(n) insert or remove in the middle. LinkedList is a doubly linked list: O(1) insert or remove at the ends or at an iterator position, but O(n) get by index and higher memory per element. In practice ArrayList wins for most workloads thanks to cache locality; LinkedList is mainly useful as a queue or deque, and ArrayDeque is usually better even for that.

  4. 4

    HashMap versus Hashtable versus ConcurrentHashMap.

    medium

    HashMap is not thread-safe, permits one null key and null values, and is the default choice for single-threaded use. Hashtable is a legacy class where every method is synchronised, and it forbids null keys and values. ConcurrentHashMap supports concurrent reads and fine-grained updates without locking the whole map, forbids nulls, and offers atomic operations such as computeIfAbsent and merge. Collections.synchronizedMap wraps a map with a single lock, which scales worse.

  5. 5

    Method overloading versus overriding: what are the rules?

    medium

    Overloading: same name, different parameter lists in the same class (or inherited), resolved at compile time; the return type alone cannot distinguish overloads. Overriding: a subclass redefines an inherited instance method with the same signature, resolved at run time by the object's actual class. The overriding method cannot reduce visibility, cannot throw broader checked exceptions, and may return a subtype (covariant return). Use @Override so the compiler catches signature mistakes. Static, private and final methods cannot be overridden.

  6. 6

    WHERE versus HAVING: what is the difference?

    easy

    WHERE filters individual rows before grouping and cannot use aggregate functions; HAVING filters groups after GROUP BY and can. Example: to list departments with more than five employees, group by department and use HAVING COUNT(*) > 5; to restrict to employees hired after 2020, use WHERE before grouping. Using WHERE where possible is more efficient since it reduces rows early.

    sql
    SELECT dept_id, COUNT(*) AS n
    FROM employee
    WHERE hire_date >= '2020-01-01'
    GROUP BY dept_id
    HAVING COUNT(*) > 5;
  7. 7

    Find customers who have placed at least one order, using EXISTS.

    medium

    EXISTS stops at the first matching row, so it is efficient and expresses intent clearly. It is equivalent to IN or an INNER JOIN with DISTINCT but avoids duplicates and handles NULLs more predictably than NOT IN, which returns no rows if the subquery yields a NULL. For the opposite question use NOT EXISTS, not NOT IN.

    sql
    SELECT c.id, c.name
    FROM customers c
    WHERE EXISTS (SELECT 1 FROM orders o WHERE o.customer_id = c.id);
  8. 8

    Where do you use a stack and where a queue?

    easy

    A stack is LIFO: function calls, undo history, bracket matching, depth-first search and expression evaluation. A queue is FIFO: task scheduling, print spooling, breadth-first search and buffering between producer and consumer. A deque supports both ends. In Java use ArrayDeque for either, rather than the legacy Stack class. A good follow-up is how to implement a queue using two stacks: push to one, and when popping move all elements to the other if it is empty.

  9. 9

    Explain bubble sort, its optimisation and when it is acceptable.

    easy

    Bubble sort repeatedly swaps adjacent out-of-order elements, so the largest value bubbles to the end each pass. Worst and average time is O(n squared); with a flag that stops when a pass makes no swaps, the best case on sorted input is O(n). It is stable and in place (O(1) space). It is acceptable for tiny or nearly sorted arrays, and as a teaching tool; for real use choose merge sort, quicksort or the language's built-in sort.

  10. 10

    What are the SOLID principles in one line each?

    medium

    Single responsibility: a class has one reason to change. Open/closed: open for extension, closed for modification, for example adding a new Shape subclass without editing the area calculator. Liskov substitution: subclasses must be usable wherever the base class is expected. Interface segregation: prefer several small interfaces to one large one. Dependency inversion: depend on abstractions, not concrete classes, so you can inject a mock in tests. Give one code example if asked, not just definitions.

  11. 11

    Can you override a static method in Java?

    hard

    No. A static method belongs to the class, so redeclaring it in a subclass hides the parent method rather than overriding it. The method called is decided at compile time from the reference type: Parent p = new Child(); p.show() calls Parent's static show even though the object is a Child. Instance methods behave the other way, resolved at run time. This is a favourite trick question, so mention both method hiding and compile-time binding.

  12. 12

    You are given a program that fails some tests. How do you find the bug?

    medium

    Describe a method: reproduce the failure with the smallest input; read the failing output against the expected one; form a hypothesis; check it with print statements or a debugger; fix one thing at a time; rerun all tests. Common culprits are off-by-one loop bounds, uninitialised variables, integer division and overflow, and a missing return or break. Cognizant's coding round is reported to use bug-fixing questions, so this method is also practice for Cognizant coding round questions.

Frequently asked questions

What is Automata Fix?

Prep sources describe it as an AMCAT format where you correct bugs in given code. It is reported for Cognizant's coding round; check your own instructions.

What is the difference between GenC and GenC Pro?

They are performance-linked tiers in prep material; the official GenC page has the current definitions.

What is asked in the Cognizant HR round?

Commonly relocation, teamwork, strengths and why Cognizant. Prepare short, honest answers.

Where is current Cognizant hiring news?

See Cognizant hiring and the official careers page.

Sources

Related guides

More in Company Interview Questions

See all in this section