Coforge Interview Questions: Technical and HR Answers for Freshers
Practise explaining Java behaviour, tracing a coding solution and defending a SQL query. Use project follow-ups and honest HR templates to build answers you can support with evidence.
KnowledgeGate Team
Exam prep & CS education

Knowing Java or SQL is different from explaining a decision while someone asks follow-up questions, especially when your CV makes that skill a talking point. These Coforge interview questions are representative practice, not an official or verified previously asked Coforge list. Worked technical answers and honest HR templates help you explain your reasoning, check boundaries and describe your own contribution clearly. Connect this rehearsal to your wider placement preparation, keeping the role and your actual experience in view.
How to use these questions for a Coforge interview
Practise each topic through four steps: definition, worked example, edge case and justification. A definition starts the answer; explaining what happens when the input changes shows depth. Adapt the mix to the advertised role and the skills you list on your CV.
If your CV lists Java, SQL and a library project, prepare one Java behaviour example, one SQL query and one personally implemented project decision. An unlisted technology should not displace those foundations without a job-description reason.
The earlier Wipro interview guide owns a first-non-repeating trace and a request-to-result project walkthrough. This Coforge set instead concentrates on Java dispatch, SQL grouping, and transactional stock checks.
The earlier Tech Mahindra interview guide works a second-largest trace and duplicate-safe registration. The interval-merging drill here gives you a different coding device while the project section stays focused on last-copy concurrency.
Coforge's careers page describes innovation, collaboration, care and career growth. Use your actual job listing and recruiter invitation to establish the required skills and interview stages. Build your preparation around those details.
Java and OOP: explain behaviour, then defend the design
What is the difference between overloading and overriding? Overloading uses different parameter lists, with selection at compile time. A changed return type alone does not overload a method. Overriding supplies a subclass implementation of an inherited instance method, with runtime dispatch.
class Animal {
String sound() { return "animal"; }
}
class Dog extends Animal {
@Override String sound() { return "woof"; }
}
// Inside a method:
Animal a = new Dog();
System.out.println(a.sound()); // woofThe reference type is Animal, but the object's runtime type is Dog, so the overridden instance method prints woof. Static methods are hidden, not dynamically overridden.
Where did you use encapsulation? Explain a private field availableCopies = 2 and a borrow() operation that checks availableCopies > 0 before decrementing. One successful borrow gives 2 - 1 = 1; a request at 0 fails. This protects the non-negative stock invariant, but does not itself solve concurrent database updates. Extend this reasoning with CS fundamentals interview practice.
Coding: merge overlapping booking intervals
Given booking intervals [[1, 3], [2, 6], [8, 10], [9, 12]] , merge overlaps and return [[1, 6], [8, 12]]. Sort by start time, then extend the current interval while the next start is at most the current end.
static int[][] merge(int[][] intervals) {
if (intervals.length < 2) return intervals;
Arrays.sort(intervals, Comparator.comparingInt(a -> a[0]));
List<int[]> merged = new ArrayList<>();
int start = intervals[0][0], end = intervals[0][1];
for (int i = 1; i < intervals.length; i++) {
if (intervals[i][0] <= end) {
end = Math.max(end, intervals[i][1]);
} else {
merged.add(new int[]{start, end});
start = intervals[i][0];
end = intervals[i][1];
}
}
merged.add(new int[]{start, end});
return merged.toArray(new int[0][]);
}After sorting, start with [1, 3]. The next interval begins at 2, so extend the end to 6. The interval [8, 10] starts after 6, so emit [1, 6] and start a new interval. [9, 12] then extends its end to 12. The result is [[1, 6], [8, 12]].
Sorting takes O(n log n) time; the scan is linear. The output list needs O(n) space. Test [] and [[4, 4]] to check the empty and single-interval boundaries. A booking that starts exactly at the current end merges under the <= condition.
SQL: separate row filtering from group filtering
Which departments have at least two employees with salary at least 40,000? Use this sample data for Employee(id, department, salary):
id | department | salary |
|---|---|---|
1 | A | 40000 |
2 | A | 60000 |
3 | B | 50000 |
4 | B | 30000 |
5 | C | 70000 |
SELECT department, COUNT(*) AS qualifying_count
FROM Employee
WHERE salary >= 40000
GROUP BY department
HAVING COUNT(*) >= 2;Explain the logical steps. WHERE retains IDs 1, 2, 3, 5. ID 1 qualifies because >= includes equality at 40000; ID 4 fails because 30000 < 40000.
Grouping gives A = 2, B = 1 and C = 1. HAVING keeps only (A, 2). It filters the grouped count, whereas WHERE filters individual rows before grouping.
Does this count every employee in departments that qualify? No. qualifying_count counts only rows passing WHERE. A lower-paid employee in department A would not increase this count. Counting all employees in qualifying departments is a different business question and needs a different query. State what your result means before discussing alternatives.
Project discussion: show your contribution and diagnose a failure
Explain your project and contribution. An illustrative answer is: “Our three-person library project tracked books and loans. I implemented the borrow endpoint and its SQL update. I tested unavailable books and simultaneous requests.” Use only details you actually implemented.
Two users borrow the last copy. What happens? Starting with availableCopies = 1, separate read-then-write handlers can both read 1 and both report success. Put the availability check into the update:
UPDATE books
SET available_copies = available_copies - 1
WHERE id = 42 AND available_copies > 0;In a transactional database that serialises conflicting row updates, the first successful request affects 1 row and leaves 1 - 1 = 0 copies. The next affects 0 rows and must return an unavailable result. Check affected rows; executing the statement alone does not establish success.
If borrowing also inserts a loan record, perform both operations in the same transaction and roll back on failure. For “What would you improve?”, name a missing test, such as failed loan insertion after stock reduction, and explain the expected rollback.
HR questions: give reasons, evidence and honest constraints
Tell me about yourself. Practise a 45-60 second response: current focus, project evidence and next learning goal. A sample candidate could begin: “I am a final-year computing student focusing on Java and SQL. In a library project I implemented borrowing checks and tested failures. I am looking for an entry-level role where I can strengthen backend development and explain my work clearly.” Replace every claim with your own evidence and add one concrete detail.
Why Coforge? “Coforge's careers page talks about collaboration and career growth. That interests me because I learned most when reviewing project changes with teammates. I would like to understand how learning and code review work in this role.” Connect this to a responsibility in the actual listing and a contribution you can explain.
Describe a disagreement. An illustrative three-member team disagrees about caching versus fixing an incorrect SQL join. Explain how you reproduced the wrong result, agreed to fix correctness first, then measured speed. Name your own action and what the test established, without inventing customer impact.
Are you open to relocation or shifts? A sample candidate's answer is: “I can relocate with four weeks' notice; I would need to discuss the location and working hours before confirming.” Replace that notice period with your genuine constraint. Further HR answer practice can help you make these responses specific without memorising a script.
Avoid answer traps and rehearse one complete explanation
Three traps deserve a direct remedy:
Memorised definitions collapse under follow-ups. Trace actual values.
Invented project metrics invite unsupported claims. Describe a reproducible test.
Automatic agreement on work arrangements creates mismatched expectations. State genuine constraints and ask for details.
Try this 30-minute rehearsal: 10 minutes on the coding trace, 8 on SQL, 7 on project follow-ups and 5 on HR answers. Record the session and correct one unclear explanation before repeating it.
The short version: state assumptions, show evidence, test an edge case and admit what you do not know. For optional structured interview and resume practice, explore the Interview & Resume Preparation Course. Bring your own project details so each answer remains yours.
Keep learning
Infosys Interview Questions for Freshers: Technical, Project and HR Answers
Prepare for technical, project, coding and HR follow-ups with a worked project defence, SQL query, coding trace, answer models and a seven-day plan.
TCS Interview Questions: Technical and HR Model Answers for Freshers
Prepare for technical follow-ups and HR evidence checks with worked SQL, coding, project, introduction and behavioural practice fixtures.
Salesforce Interview Questions: Technical Examples and HR Model Answers
Practise explaining a two-sum solution, preserving missing SQL records and defending a booking design. Then build HR answers around your own contribution and evidence.
Hexaware Interview Questions and Answers: Technical, Coding and HR Rounds
Prepare answers that survive follow-up questions. This guide covers CS fundamentals, a worked SQL query, a coding trace, project defence, HR responses and a timed mock.





