Infosys Interview Questions · 2026

Infosys Interview Questions (2026): Online Test, Technical & HR Rounds

Updated June 2026

Infosys runs one of India's largest campus hiring cycles, bringing in tens of thousands of freshers each year across its System Engineer, Specialist Programmer, and Power Programmer tracks. The gap between those three starting points is not small: a Power Programmer earns roughly 3 to 6 times what a System Engineer earns in the first year. The test score and the technical interview are where that split happens, so knowing exactly what each section tests is worth more than generic "brush up on OOP" advice.

This page covers the full 2026 process: the online test's seven sections, what the Technical round actually drills, what HR is confirming (not evaluating), and a bank of real questions with answers. Each answer includes a line on how the question tends to land specifically in Infosys rooms, not just the textbook version.

3Stages
~120 min, 7 sectionsOnline test
2 problems, 45 minCoding section
SE / SP / DSE / PPTracks

The Infosys selection process in 2026

Infosys runs three distinct hiring routes. The most common for campus candidates is the InfyTQ pathway: register on InfyTQ, complete Infosys's own certification courses, and sit the placement exam. Candidates who score above the cutoff get shortlisted for the Technical and HR rounds. The second route is HackWithInfy, a public coding competition now in its eighth year, which gives top finishers direct PPO (pre-placement offer) consideration for the Specialist Programmer and Power Programmer roles. The third is standard campus placement at colleges where Infosys has a direct tie-up.

Across all three routes, the final selection funnel is roughly 3 rounds:

  • System Engineer (SE): Base track for most campus hires. Package Rs. 3.6-4.5 LPA. Application development and maintenance work at Infosys Development Centers.
  • Specialist Programmer (SP) / Digital Specialist Engineer (DSE): Requires a strong coding section score. Package Rs. 6.25-9.5 LPA. Modern technology stacks, cloud, and product work.
  • Power Programmer (PP): Top-tier competitive track, historically through HackWithInfy. Package up to Rs. 21 LPA for the strongest performers in the 2026 cycle.

Eligibility for the standard route: minimum 60% or 6.0 CGPA across 10th, 12th, and degree. No active backlogs. Accepts B.E/B.Tech, M.Tech, MCA, and M.Sc (CS/IT). Maximum 2-year education gap permitted. Candidates must be willing to relocate, as Infosys assigns projects across its 13 development centers in India.

Online assessment~120 min, 7 sections

Seven sections covering Mathematical Ability, Analytical Reasoning, Verbal Ability, Pseudocode, Puzzle Solving, English Grammar, and English Writing. Total 60 questions with a 120-minute window. Sectional cutoffs apply; clearing each section matters, not just the aggregate. No negative marking. The Pseudocode section is the one most candidates underestimate: 5 questions in 10 minutes, and the logic can trip you up if you've never practiced tracing through pseudocode on paper.

Technical interview30-60 min

One panel member, occasionally two. Opens almost universally with your final year project or internship. Then pivots to core CS fundamentals: OOP, DBMS and SQL, data structures, and often one or two live coding problems on paper or a shared editor. SP/DSE candidates get harder questions and may be asked to write functioning code rather than describe an approach.

HR interview15-30 min

Everyone clears this round. One HR interviewer. The goal is confirmation: communication skills, willingness to relocate, shift flexibility, and genuine interest in joining. Infosys HR rounds have eliminated candidates who said no to relocation, so treat this as a logistics check that requires honest preparation, not just good answers on the fly.

Online test: aptitude and pseudocode

The online assessment that Infosys runs in 2026 has a structure that differs from what many older prep guides describe. The current pattern has 7 sections. Mathematical Ability (10 questions, 35 minutes) is the lightest on questions but the heaviest on time per question. Analytical Reasoning (15 questions, 25 minutes) is the reverse: more questions, less time. Verbal Ability (20 questions, 20 minutes) is the fastest-paced section in the whole test.

Mathematical Ability (10 questions, 35 min)

The extra time is deliberate. These problems require multi-step calculation, not just formula recall. Topics that appear consistently: time and work, time-speed-distance, percentages and profit/loss, permutations and combinations, probability, and data interpretation from tables or charts. An on-screen calculator is available for some variants of the test, but the problems are designed so that a calculator helps less than mental estimation does.

Easy questions

23

A is at position 3 from the left. B is 5th from the right in a row of 8, so B is at position 8 - 5 + 1 = 4 from the left. Positions: A at 3, B at 4. People between them: positions 3+1 to 4-1 = none. They are adjacent.

Position-in-row problems are standard warm-up questions in the Analytical Reasoning section. The error most candidates make: forgetting to convert "from the right" into an absolute position before comparing.

Strip spaces, convert to lowercase, then compare the string with its reverse. A two-pointer approach works without extra memory.

python
def is_palindrome(s):
    cleaned = s.replace(" ", "").lower()
    left, right = 0, len(cleaned) - 1

    while left < right:
        if cleaned[left] != cleaned[right]:
            return False
        left += 1
        right -= 1

    return True

print(is_palindrome("A man a plan a canal Panama"))  # True
print(is_palindrome("race a car"))                   # False

Palindrome checking is one of the most commonly reported Infosys InfyTQ coding problems. The "ignore spaces and case" constraint is almost always present. Make sure your solution handles the empty string (returns True) and single-character input.

Encapsulation: bundling data and methods together, controlling what's accessible from outside. Example: a BankAccount class hides the balance field and exposes only deposit() and withdraw(). Abstraction: hiding implementation details and exposing only what's needed. Example: you call list.sort() without knowing what sorting algorithm it uses. Inheritance: a child class inherits properties and methods from a parent. Example: ElectricCar extends Car and adds a charge() method. Polymorphism: one interface, multiple behaviors. Example: the same draw() method on Circle and Rectangle produces different output at runtime.

Infosys panels in 2025-2026 candidate reports consistently ask for examples, not just definitions. The panel member will often follow up by asking you to sketch out one of these examples in Java or Python. Prepare the BankAccount or Shape example in the language you're most comfortable with.

Method overloading is having multiple methods with the same name but different parameter lists within the same class. Resolved at compile time. Example: add(int a, int b) and add(double a, double b) coexist in one class.

Method overriding is a subclass providing its own implementation of a method already defined in the parent class, with the same name and same parameter list. Resolved at runtime through dynamic dispatch.

The one-line version Infosys interviewers want: overloading is same-class, different parameters; overriding is different-class, same parameters. This question appeared in candidate reports from Infosys Technical rounds at VIT, SRM, and BITS campuses in 2025.

A constructor is a special method that initializes an object when it's created. It has the same name as the class and no return type, not even void.

A copy constructor creates a new object as a copy of an existing object. In C++, if you don't define one, the compiler generates a shallow copy by default. If your class manages dynamic memory (pointers), you need a deep copy constructor to avoid both objects pointing to the same heap memory.

c
// C++ copy constructor
class Point {
    int x, y;
public:
    Point(int a, int b) : x(a), y(b) {}

    // Copy constructor
    Point(const Point& p) : x(p.x), y(p.y) {
        // Deep copy: each object gets its own x, y
    }
};

Copy constructors come up for candidates who mention C++ on their resume. For Java-only candidates, the equivalent question is usually about cloning or about why Java passes objects by reference.

Stack: Last In, First Out. The last element pushed is the first popped. Real uses: function call stack during recursion, browser back button, undo operations in editors, balanced parentheses checking.

Queue: First In, First Out. The first element added is the first removed. Real uses: CPU scheduling ready queue, BFS traversal of graphs, print job queue, message queues between microservices.

The Infosys interviewer often follows this up with "implement a stack using only queues" or vice versa, especially for SP-track candidates. Know the approach: to implement a stack using two queues, push always goes to the smaller queue, and you move all elements from the larger queue to make each pop O(1) or make each push O(n).

A linked list is a chain of nodes, each containing data and a pointer to the next node. Unlike an array, nodes are not stored in contiguous memory.

  • Arrays support O(1) random access by index. Linked lists need O(n) traversal to reach element at position i.
  • Arrays have a fixed size at creation (in C/C++). Linked lists grow dynamically by allocating new nodes.
  • Insertion and deletion at the beginning of a linked list is O(1). At the beginning of an array, it requires shifting all elements: O(n).

After defining this, expect "write a function to reverse a singly linked list" on paper or in a shared editor.

A primary key uniquely identifies each row in its own table. It cannot be NULL and cannot repeat. A foreign key is a column, or set of columns, in one table that references the primary key of another table, enforcing a link between the two.

Example: an Orders table has a customer_id foreign key that points to the id primary key in the Customers table. This stops an order from being inserted with a customer_id that doesn't exist in Customers, which is what "referential integrity" means in practice.

Infosys interviewers pair this with a quick check on composite keys: a primary key made of more than one column, common in join tables representing many-to-many relationships. Know at least one real example of when you'd need one.

A process is an independent program in execution with its own memory space, file handles, and resources. Processes are isolated: one cannot directly read another's memory. A thread is a unit of execution within a process, sharing the process's memory and resources with other threads.

Practical differences: creating a thread is cheaper than creating a process. Context switching between threads is faster than between processes. But threads sharing memory means they need synchronization (mutexes, semaphores) to avoid race conditions. Processes are safer for fault isolation: a crash in one process does not bring down another.

HR at Infosys wants a 60-to-90-second version, not a 5-minute autobiography. Hit four points: degree and college (10 seconds), one project or experience that demonstrates your strongest technical skill (30 seconds), one non-technical quality you bring to a team (10 seconds), and why you are here specifically (10 seconds).

The most common failure mode here is candidates who spend 3 minutes reciting their resume in chronological order. The HR interviewer has your resume in front of them. What they want is your pitch, not your transcript.

These are the two questions that have eliminated candidates who otherwise performed well in the Technical round. Infosys operates 13 development centers across India and serves global clients, which means US, UK, and Australian time-zone overlap for many projects.

If you can genuinely commit to both, say so directly. If you have a real constraint, state it clearly and explain how you would manage it. Do not say "yes" during HR and then raise a constraint at onboarding. That creates problems for both sides and is visible in your employment record.

Avoid: "because Infosys is a reputed company." That is the answer 80% of candidates give and it signals no research. Tie your answer to something specific: Infosys's training program at the Mysuru campus (described as the world's largest corporate university at 337 acres), a specific business unit that connects to your degree (healthcare IT, banking with Finacle, SAP practice), or the InfyTQ learning platform you have already been using.

If you registered for InfyTQ and completed a certification, mention it. The HR interviewer responds to evidence of prior engagement with Infosys much better than brand statements.

Pick a direction and be specific. "I want to move into cloud architecture" is better than "I want to grow as a developer." Mention one specific Infosys path: Infosys has internal tracks for transitioning into consulting, cloud, and data engineering roles. Showing that you know those paths exist signals real research.

The answer that tends to fall flat: "I want to be a manager." HR interviewers at Infosys in 2025-2026 note they prefer candidates who articulate a technical growth path first, before management ambitions. You are joining as an SE or SP; management is a long-term horizon, not a 5-year sprint from day one.

For strengths: name one and give a specific example from your project or college work. "I'm a fast learner" without evidence reads as filler. "During my final year project I learned React in 2 weeks to build the frontend because our original team member dropped out" is evidence.

For weaknesses: do not say "I work too hard" or "I'm a perfectionist." Pick a genuine developmental gap that is not central to the SE role, and name the specific thing you are doing to address it. "I tend to avoid asking for help when I'm stuck; I've been actively practicing saying I need clarification within 30 minutes instead of hours" is the format that works.

Answer honestly. HR asks this to gauge your timeline and whether they need to accelerate. If you have competing offers, say so without naming the company; just note the timeline ("I have another offer with a 2-week deadline"). If you do not have other offers, that is fine too. This is logistics, not a power play.

What the HR interviewer is also checking: how you handle a direct question under slight pressure. Vague non-answers here signal poor communication, which is what they are actually evaluating.

This question isn't a ranking exercise against candidates you've never met. It's asking you to connect your specific skills to what the SE or SP role actually needs, in one tight answer.

Pick 2 concrete things: a technical skill demonstrated by a real project, not a claimed skill, and one behavioral trait relevant to Infosys's client-facing delivery model, such as being comfortable working within a structured process. "I'm hardworking and a quick learner" without evidence is the answer that gets forgotten 5 minutes later. A specific project detail is the one that gets remembered.

Never say no. Infosys HR interviewers in 2025-2026 candidate reports repeatedly flag a blank response here as a signal of low genuine interest, even when the rest of the interview went well.

Ask something you can't find on the careers page: which specific project or client account new SE hires typically get assigned to first at your development center, or how the transition from the Mysuru training period into an actual project usually works. One good question at the end does more for your candidacy than a second round of "tell me about yourself" ever could.

InfyTQ is Infosys's own learning and assessment platform. It hosts certification courses in Python, Java, data structures, and other CS fundamentals, followed by a certification exam. Clearing the InfyTQ certification above the cutoff qualifies you for the Infosys hiring pipeline directly. You do not need InfyTQ if Infosys is visiting your campus for a direct placement drive, as the campus drive has its own online test. For off-campus candidates and those at colleges without a direct Infosys tie-up, InfyTQ is the primary pathway.

Three rounds: Online Assessment, Technical Interview, and HR Interview. Some candidates at select campuses report a combined Technical+HR panel for the SE track, effectively compressing it to two rounds. The DSE and SP tracks consistently have the three-round format. HackWithInfy adds a second coding round on-site for the top 100 finalists before the interview.

System Engineer (SE) is the base fresher track at Rs. 3.6-4.5 LPA. Most campus hires land here. Work involves application development and maintenance on client projects. Specialist Programmer (SP) or Digital Specialist Engineer (DSE) ranges from Rs. 6.25-9.5 LPA and requires a strong coding section performance in the online test. Power Programmer (PP) goes up to Rs. 21 LPA and is primarily reached through HackWithInfy, which requires solving 3 medium-hard DSA problems in 3 hours. The salary difference between SE and PP in year one is substantial, around 5-6x, which makes the preparation investment worthwhile for strong coders.

Infosys requires freshers to sign a service agreement, typically 1-2 years from the date of joining. Candidates who leave before the bond period ends may be required to pay back training costs. The training period at the Mysuru campus is around 3-5 months and is a significant investment from Infosys's side, which is what the bond reflects. The specific penalty amount and bond duration are stated in your offer letter and can vary by batch and role track.

Python 3 is the most practical choice for most candidates. The problem types (string manipulation, array operations, basic algorithm implementation) map naturally to clean Python code, and the syntax is faster to write under time pressure than Java or C++. Java is fine if it is your primary language. The InfyTQ platform supports Python, Java, and C++. Unlike TCS iON, the input format on InfyTQ follows standard competitive programming conventions, so your practice on HackerRank or LeetCode transfers directly.

For campus placement drives, the turnaround is typically 1-3 weeks from online test to offer letter. Off-campus and InfyTQ pathway candidates report a longer timeline of 4-8 weeks, depending on batch size and interview scheduling. Some candidates in the 2025-2026 cycle reported waiting up to 10 weeks between the Technical interview and the final offer, particularly for the SP and DSE tracks where the selection rate is lower.

Medium questions

22

Work rate of filling pipe = 1/12 per hour. Work rate of emptying pipe = 1/18 per hour. Net rate = 1/12 - 1/18 = 3/36 - 2/36 = 1/36 per hour. Time to fill = 36 hours.

This type of combined-work problem appears in almost every Infosys Mathematical Ability section. The trap is forgetting to subtract the emptying pipe's rate. Practice setting up the net rate as fractions before plugging in numbers. Speed here matters: you have 35 minutes for 10 questions, which sounds relaxed, but these problems are longer than NQT problems at TCS.

Treat the two people who must sit together as a single unit. Now you have 5 units to arrange in a row: 5! = 120 ways. The two people within the unit can swap positions: 2! = 2 ways. Total arrangements = 120 x 2 = 240.

Permutations and combinations questions appear in the Infosys Mathematical Ability section in 2025-2026 candidate reports. The "treat as a unit" approach for adjacency constraints comes up regularly in this form.

Total distance covered while crossing the platform equals the train's length plus the platform's length: 150 + 250 = 400 meters. Speed = distance / time = 400 / 20 = 20 meters per second. Converting to km/hr: 20 x 18/5 = 72 km/hr.

Time-speed-distance problems in the Infosys Mathematical Ability section almost always hide the real distance inside a word problem rather than stating it directly. The train-crossing-a-platform setup is one of the most repeated formats across 2025-2026 candidate reports on PrepInsta. The mistake that costs most candidates the question: using only the train's length, or only the platform's length, instead of the sum of both.

Work from the bottom up. C is B's mother, so C is also A's mother, since A and B are siblings. D is C's father, which makes D the maternal grandfather of both A and B. A is therefore D's granddaughter.

Multi-generation blood relation chains like this one show up regularly in the Infosys Analytical Reasoning section. The fix is to draw a small family tree on scratch paper the moment more than 3 people get mentioned. Holding 5 relationships in your head under a 100-second-per-question clock is where most candidates lose time, not the logic itself.

Use a sliding window with a set to track characters in the current window. Move the right pointer forward, adding characters. If a duplicate appears, shrink from the left until the duplicate is gone.

python
def length_of_longest_substring(s):
    char_set = set()
    left = 0
    max_len = 0

    for right in range(len(s)):
        while s[right] in char_set:
            char_set.remove(s[left])
            left += 1
        char_set.add(s[right])
        max_len = max(max_len, right - left + 1)

    return max_len

print(length_of_longest_substring("abcabcbb"))  # Output: 3 ("abc")
print(length_of_longest_substring("pwwkew"))    # Output: 3 ("wke")

Sliding window problems appear in both InfyTQ coding rounds and HackWithInfy Round 1. Time complexity is O(n). If you start with the O(n^2) brute force, you'll pass some test cases but likely not all. The InfyTQ platform accepts Python 3 and the syntax is standard, unlike TCS iON which has a custom input format.

Use the sum formula for the first n natural numbers. The expected sum of 0 to n is n*(n+1)/2. Subtract the actual sum of the array from the expected sum, and the difference is the missing number.

python
def missing_number(arr):
    n = len(arr)
    expected_sum = n * (n + 1) // 2
    actual_sum = sum(arr)
    return expected_sum - actual_sum

print(missing_number([3, 0, 1]))               # Output: 2
print(missing_number([9,6,4,2,3,5,7,0,1]))     # Output: 8

This question is reported often in InfyTQ practice sets and HackWithInfy Round 1 write-ups, usually as a warm-up before a harder array or string problem. The sum-formula approach runs in O(n) time and O(1) space, which is what interviewers look for over a nested-loop brute force checking every number from 0 to n against the array.

In C++, a virtual function is a member function declared with the virtual keyword in a base class, which allows derived classes to override it. The key effect: when you call the function through a base class pointer or reference, the derived class's version runs, not the base class version. This is runtime polymorphism.

Without virtual, C++ resolves the function based on the pointer type at compile time, not the actual object type at runtime. With virtual, it follows the vtable lookup at runtime.

c
// C++ example
class Animal {
public:
    virtual void sound() {
        cout << "Some sound" << endl;
    }
};

class Dog : public Animal {
public:
    void sound() override {
        cout << "Woof" << endl;
    }
};

// Using base class pointer
Animal* a = new Dog();
a->sound();  // Outputs: Woof (not "Some sound")

Virtual functions come up particularly for candidates who list C++ as their primary language. Java candidates get asked about interfaces and abstract classes instead, but the underlying concept is the same.

In Java: an abstract class can have both concrete and abstract methods, can have constructors and instance variables, and a class can extend only one abstract class. An interface (pre-Java 8) could only hold abstract method signatures; any class can implement multiple interfaces. From Java 8 onward, interfaces support default and static methods.

The practical decision rule: use an abstract class when related classes share actual code you want to inherit. Use an interface to define a contract that unrelated classes can fulfill (like Comparable or Runnable). Infosys interviewers often ask "which would you use to define a shape hierarchy?" The answer is abstract class, because Circle and Rectangle share a getArea() concept but need their own implementations.

Exception handling separates error-handling code from normal program logic using try, catch, and finally blocks. Code that might fail goes in try; the recovery logic goes in catch; cleanup code that must run regardless of success or failure goes in finally.

Checked exceptions, like IOException, are checked at compile time; the compiler forces you to either catch them or declare them with throws. Unchecked exceptions, like NullPointerException or ArrayIndexOutOfBoundsException, extend RuntimeException and are not checked at compile time; they usually signal a programming bug rather than a recoverable condition.

java
try {
    int[] arr = new int[5];
    System.out.println(arr[10]); // throws ArrayIndexOutOfBoundsException
} catch (ArrayIndexOutOfBoundsException e) {
    System.out.println("Index out of bounds: " + e.getMessage());
} finally {
    System.out.println("Cleanup runs here regardless.");
}

Infosys Technical rounds ask this most often for Java-track candidates right after the OOP pillars question. The follow-up that trips people up: does finally run if there's a return statement inside try? Yes, it runs before the method actually returns, with one exception: System.exit() inside try skips it.

Iterate through the list, reversing each node's next pointer as you go. You need three pointers: prev, curr, and next.

java
class Node {
    int data;
    Node next;
    Node(int d) { data = d; }
}

public class LinkedList {
    static Node reverse(Node head) {
        Node prev = null;
        Node curr = head;

        while (curr != null) {
            Node nextTemp = curr.next; // save next
            curr.next = prev;          // reverse pointer
            prev = curr;               // move prev forward
            curr = nextTemp;           // move curr forward
        }
        return prev; // prev is now the new head
    }
}

This is one of the most frequently reported Infosys Technical round coding questions across candidate write-ups from 2024-2025 cycles. Write it cleanly on paper. The interviewer watches whether you get the order of pointer reassignment right (save next before reversing, not after).

Breadth-First Search explores a graph level by level, using a queue. It finds the shortest path in an unweighted graph because it expands all nodes at distance k before any node at distance k+1.

Depth-First Search goes as deep as possible along one branch before backtracking, using a stack (or the call stack during recursion). It's used for cycle detection, topological sort, and maze solving where you need to fully explore paths.

For freshers, the follow-up is usually: "Given a tree, which would you use to find whether two nodes are connected?" (BFS or DFS both work.) "Which would you use to find the shortest path?" (BFS for unweighted graphs.)

Binary search repeatedly halves the search space by comparing the target to the middle element. If the target is smaller than the middle element, search the left half; if larger, search the right half. Time complexity is O(log n), because each comparison eliminates half of the remaining elements.

python
def binary_search(arr, target):
    low, high = 0, len(arr) - 1

    while low <= high:
        mid = (low + high) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            low = mid + 1
        else:
            high = mid - 1

    return -1

print(binary_search([1, 3, 5, 7, 9, 11], 7))  # Output: 3

This is a standard Infosys Technical round question for candidates who list data structures as a strength on their resume. The interviewer usually asks you to state the precondition out loud first: binary search only works on a sorted array. Candidates who jump straight to code without saying that sometimes get "what if the array isn't sorted?" as a pointed follow-up.

Recursion is a function calling itself with a smaller version of the same problem, until it reaches a base case that stops the calls. Each call adds a new frame to the call stack, which is why deep recursion without a proper base case causes a stack overflow.

python
# Recursive version
def factorial_recursive(n):
    if n == 0:
        return 1
    return n * factorial_recursive(n - 1)

# Iterative version
def factorial_iterative(n):
    result = 1
    for i in range(2, n + 1):
        result *= i
    return result

print(factorial_recursive(5))  # 120
print(factorial_iterative(5))  # 120

Infosys interviewers ask for the iterative version specifically to check whether you understand the tradeoff: recursion often reads cleaner, but the iterative version uses O(1) extra space instead of O(n) call-stack frames. SP and DSE candidates should expect a follow-up about tail call optimization, which Python does not perform, unlike some functional languages.

Atomicity: all operations in a transaction succeed together or all fail together. A bank transfer either debits the sender AND credits the receiver, or neither operation occurs. No partial commit.

Consistency: data must be in a valid state before and after the transaction. If the account balance cannot go negative, a withdrawal that would create a negative balance is rolled back.

Isolation: concurrent transactions do not see each other's intermediate states. Two simultaneous withdrawals from the same account cannot both succeed if together they exceed the balance.

Durability: once committed, a transaction's changes survive system crashes. The data is written to non-volatile storage before the commit is acknowledged.

ACID properties come up in almost every Infosys Technical interview. Know the bank transfer example cold. The interviewer will often ask you to explain which property prevents a specific failure scenario.

Normalization organizes tables to reduce data redundancy and dependency. Without it, updating a single fact (say, a customer's city) requires updating it in every row where that customer appears. Miss one row and the database is inconsistent.

  • 1NF: each column holds atomic values, no repeating groups or arrays in a single cell.
  • 2NF: 1NF plus no partial dependency. Every non-key column must depend on the entire primary key, not just part of it. Applies when the primary key is composite.
  • 3NF: 2NF plus no transitive dependency. Non-key columns depend only on the primary key, not on other non-key columns.

Several approaches work. The subquery approach is the most widely expected at Infosys:

sql
-- Approach 1: subquery (most commonly expected)
SELECT MAX(salary) AS second_highest
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);

-- Approach 2: using LIMIT and OFFSET (MySQL, PostgreSQL)
SELECT DISTINCT salary
FROM employees
ORDER BY salary DESC
LIMIT 1 OFFSET 1;

-- Approach 3: using a window function (impresses SP-track interviewers)
SELECT salary
FROM (
    SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk
    FROM employees
) ranked
WHERE rnk = 2;

This is one of the most consistently reported Infosys SQL questions across candidate experiences on GeeksforGeeks and Internshala. Know at least two approaches. The subquery version is expected at minimum. If you mention window functions, the interviewer may ask you to explain RANK vs DENSE_RANK vs ROW_NUMBER, so be ready for that follow-up.

INNER JOIN returns only rows where there is a match in both tables. LEFT JOIN (or LEFT OUTER JOIN) returns all rows from the left table, with NULLs for columns from the right table where there is no match. RIGHT JOIN is the mirror image. FULL OUTER JOIN returns all rows from both tables, with NULLs where there is no match on the other side.

The Infosys interviewer usually asks you to explain with an example: a Customers table and an Orders table. An INNER JOIN gives you only customers who have placed at least one order. A LEFT JOIN gives you all customers, including those with no orders (NULL order columns for them).

An index is a data structure (typically a B-tree) that speeds up row retrieval by creating a fast lookup path by indexed column values. A full table scan on a 10-million-row table becomes a millisecond B-tree traversal with the right index.

You would not use an index on small tables (the overhead exceeds the benefit), columns with very low cardinality (like a boolean flag), or tables that are written to heavily (indexes slow down INSERT and UPDATE because each write must also update the index). Over-indexing a write-heavy table is a real production mistake that Infosys panels sometimes ask freshers about, because it signals awareness beyond textbook knowledge.

GROUP BY collects rows by department, and HAVING filters groups after aggregation. WHERE cannot be used here because the condition depends on a COUNT, which only exists once the rows are grouped.

sql
SELECT department_id, COUNT(*) AS employee_count
FROM employees
GROUP BY department_id
HAVING COUNT(*) > 5;

This question tests whether a candidate confuses WHERE and HAVING, one of the most common SQL mistakes Infosys interviewers report seeing from freshers. The rule that separates them: WHERE filters individual rows before grouping; HAVING filters groups after aggregation functions like COUNT, SUM, or AVG have already run.

Deadlock is a state where two or more processes are permanently blocked, each waiting for a resource held by another.

The four necessary conditions (Coffman conditions): Mutual exclusion (at least one resource is held in a non-shareable mode). Hold and wait (a process holding at least one resource is waiting to acquire additional resources held by others). No preemption (resources cannot be forcibly taken from a process). Circular wait (a cycle exists: P1 waits for a resource held by P2, P2 waits for P3, P3 waits for P1).

Breaking any one condition prevents deadlock. The most common OS exam question that also appears in Infosys Technical rounds: "How would you prevent deadlock?" Answer: impose a total ordering on resources (prevents circular wait), or use a timeout with resource release (breaks hold and wait).

The Infosys interviewer listens for two minutes and then picks a specific technology you mentioned. If you say you built a REST API in Spring Boot, expect "what is the difference between @RestController and @Controller?" If you say you used a MySQL database, expect a SQL query question next.

Prepare your project in three parts: one sentence on what problem it solves, one sentence on the tech stack you personally built (not the team), one specific challenge you ran into and how you resolved it. Then prepare two levels deep on every technology you name. If you cannot go two levels deep on something, remove it from your description.

Infosys interviewers in the 2025-2026 cycle, based on candidate reports from GeeksforGeeks and Medium, consistently stop candidates who describe a team project using "we" throughout and ask "what did you specifically build?" If you cannot answer that clearly, the project discussion typically ends badly.

Prepare a one-paragraph answer about your specific contribution: module, function, or feature name, the lines of code or API endpoints you wrote, and one decision you made that had a visible result. Generic answers like "I helped the team" do not pass this question.

Hard questions

7

The pseudocode shown in Infosys test variants:

c
Function Mystery(arr):
    result = arr[0]
    FOR i = 1 TO length(arr) - 1:
        IF arr[i] > result THEN
            result = arr[i]
    RETURN result

Answer: 9. The function tracks the running maximum as it scans the array from left to right. When arr[i] = 9 at index 3, 9 > current result (7), so result becomes 9. No later element beats it.

Infosys pseudocode questions often dress up simple algorithms (max-finding, factorial, palindrome check) in generic pseudocode notation. The speed trap: candidates read too carefully looking for a trick. Most questions are testing whether you can trace a simple loop, not whether you can find a subtle bug.

c
Function CountPairs(n):
    count = 0
    FOR i = 1 TO n:
        FOR j = i + 1 TO n:
            count = count + 1
    RETURN count

Answer: 10. This counts the number of pairs from 1 to n, which equals n*(n-1)/2 = 5*4/2 = 10. Tracing the outer loop: i=1, inner j runs from 2 to 5 (4 increments); i=2, j=3 to 5 (3); i=3, j=4 to 5 (2); i=4, j=5 (1). Total: 4+3+2+1 = 10.

Nested loop tracing is one of the most common pseudocode question types Infosys uses. Write out a small trace table on your scratch paper rather than doing it in your head.

c
Function IsPrime(n):
    IF n <= 1 THEN RETURN False
    FOR i = 2 TO n - 1:
        IF n MOD i == 0 THEN
            RETURN False
    RETURN True

Answer: False, after 2 iterations. The loop starts at i = 2: 21 MOD 2 = 1, no match, continue. At i = 3: 21 MOD 3 = 0, so the function returns False immediately without checking i = 4 through 20.

Infosys pseudocode questions on primality checking test whether you notice the early return. Several candidates in 2025 GeeksforGeeks write-ups reported picking "True" because they assumed the loop always runs to completion before producing a value. It does not, once a divisor turns up.

The first thing I'd check is whether this is actually a heap problem at all. "OutOfMemoryError" gets thrown for several distinct reasons and only one of them is the regular Java heap filling up with live objects. If the heap dump looks clean, I'd suspect Metaspace exhaustion, native memory pressure, or a thread leak instead.

Metaspace fills up when classes get loaded and never unloaded, which happens a lot with frameworks that generate proxy classes at runtime (Spring AOP, Hibernate, CGLIB) combined with hot redeploys or classloader leaks in application servers. I'd check with -XX:MaxMetaspaceSize and jcmd VM.native_memory to see if class metadata is growing unbounded across restarts. If it is, the fix is usually finding what's holding a reference to an old classloader, often a static field or a thread that outlives the deploy.

If Metaspace looks fine, the next suspect is native memory: direct ByteBuffers used by NIO or by a library doing off-heap caching. These don't show up in a heap dump because they live outside the managed heap, but they still count against process memory and can trigger OOM at the OS level or "Direct buffer memory" errors. Enabling -XX:NativeMemoryTracking=summary and comparing against `free -m` on the box usually surfaces this quickly. Last, I'd check for a thread leak, since each thread reserves its own stack (often 512KB-1MB by default), and a connection pool or executor that keeps spawning threads without bounding them can exhaust memory well before the heap itself looks full.

My first move is always EXPLAIN ANALYZE (or the equivalent execution plan in SQL Server) to compare what the optimizer is actually doing now versus what it used to do. Nine times out of ten, a query that degrades gradually without a schema change is a statistics problem, not a query problem. A large bulk load, a batch delete, or steady daily inserts can shift the row count and value distribution enough that the optimizer's cardinality estimates go stale, and it flips from an index seek to a full table scan or picks a bad join order.

So the concrete steps are: check when statistics were last updated, force a stats refresh (ANALYZE in Postgres, UPDATE STATISTICS in SQL Server), and re-run the plan. If that fixes it, the real fix is scheduling more frequent auto-stats or lowering the auto-analyze threshold for that table, not manually running it once and moving on.

If stats aren't the issue, I'd look at index and table bloat next, especially in Postgres where dead tuples from updates/deletes accumulate until autovacuum catches up, silently degrading index efficiency. I'd also check for parameter sniffing if this is SQL Server: a cached plan built for a skewed first execution can get reused for very different parameter values and perform badly for everyone else. Recompiling the query or using OPTION (RECOMPILE) on that specific query, rather than globally, is the targeted fix.

Marking the whole getInstance method synchronized works correctly, but it pays the locking cost on every single call forever, even after the instance is created and there's nothing left to protect. Under high concurrency that's a real bottleneck since every thread serializes on that lock just to read a reference that's already been set.

Double-checked locking fixes this by only acquiring the lock the first time, then skipping it on every subsequent call:

java
public class Config {
    private static volatile Config instance;

    public static Config getInstance() {
        if (instance == null) {
            synchronized (Config.class) {
                if (instance == null) {
                    instance = new Config();
                }
            }
        }
        return instance;
    }
}

The volatile keyword is not optional here. Without it, a thread can see a non-null reference to instance before the constructor's writes to its fields have actually been published, because object construction and reference assignment can be reordered under the Java Memory Model. That's the classic bug with this pattern when people copy it without understanding why volatile matters.

In practice I'd usually skip double-checked locking entirely and use the initialization-on-demand holder idiom instead, a static inner class that the JVM guarantees is only loaded (and thus the singleton only created) the first time it's referenced, using the class-loading lock instead of a hand-rolled one. It's simpler, has no volatile requirement, and is one of the few singleton patterns immune to reflection and serialization attacks if you also make the constructor throw on a second invocation.

The core problem is that the limit has to be enforced across instances, so you can't just keep a counter in memory on each node, that would let a client get N times the limit by hitting N different instances. You need a shared, low-latency store that all instances can hit for every request, which almost always means Redis.

For the algorithm, I'd lean toward a sliding window counter rather than a fixed window or a strict sliding log. Fixed windows have a boundary problem where a client can burst up to 2x the limit right at the window edge. A sliding log (storing every request timestamp) is accurate but memory-heavy at this volume. A sliding window counter approximates the true sliding window using two fixed windows and a weighted average, which is cheap to compute and close enough in practice. I'd implement the increment-and-check as a single Lua script executed atomically in Redis, so there's no race between the read and the write under concurrent requests.

The harder design question is what happens when Redis itself is slow or unreachable. Fail closed (reject all requests) protects your backend but takes down the whole API on a Redis blip. Fail open (allow all requests) keeps things available but removes protection exactly when you're most likely to be under load. In practice I'd fail open for a short grace period with a circuit breaker, log it loudly, and alert, because a few seconds of unlimited traffic is usually less damaging than a full outage, but that tradeoff should be an explicit decision with the team, not a default.

What we've seen

Across Infosys prep sessions run through LastRoundAI, the single biggest gap is candidates who prepare well for the Technical round and then treat the Pseudocode section of the online test as an afterthought. The Pseudocode section gives only 10 minutes for 5 questions, and the difficulty is marked high by PrepInsta and Unstop. Candidates who have never practiced tracing pseudocode on paper typically run out of time on the last 2 questions even if they know the underlying algorithms. Twenty minutes of deliberate pseudocode tracing practice beats two hours of generic aptitude grinding for this specific section.

The second pattern: candidates applying to the SE track who do not realize the coding section score is what determines SP/DSE eligibility during the same test. You do not reapply to a higher track later. If you do well in aptitude but submit a blank coding section, you get SE. The code quality and test case coverage in those 45 minutes is the primary variable you can control on test day.

Leave a Reply

Your email address will not be published. Required fields are marked *