AMCAT Automata Fix Questions with Answers (All Three Types)
Automata Fix gives you broken code and asks you to fix it, not write it from scratch. All three question types with worked examples and a prep strategy.
AMCAT Automata Fix gives you code with errors and asks you to correct it. Not write it from scratch: find the bug, fix only that.
This is a distinct skill from the standard Automata test. The AMCAT Automata section asks you to write working code from a blank editor given a problem statement. Automata Fix hands you broken code and asks you to identify what is wrong and correct only the faulty part. Students who prepare only for standard Automata often underperform on Automata Fix because the mental model shifts: you are reading and diagnosing, not composing.
This guide covers what Automata Fix tests, the three question types with worked examples, how the grader evaluates your output, and a preparation approach that takes you from zero to clear.
What Automata Fix Tests (and How It Differs from Automata)
The Automata Fix section is a coding assessment within the AMCAT (Aspiring Minds Computer Adaptive Test) platform, administered by SHL India. Cognizant, Wipro, and several other companies configure it as part of their fresher hiring flow. Where the standard Automata section asks you to write code from scratch, Automata Fix presents existing code with one or more defects.
| Parameter | Automata (standard) | Automata Fix |
|---|---|---|
| Task | Write code from scratch | Find and fix errors in given code |
| Skill tested | Algorithm design, implementation | Code reading, debugging, error classification |
| Languages supported | C, C++, Java, Python | C, C++, Java |
| Question format | Open-ended problem statement | Buggy code with expected behaviour |
| Compile and run | Allowed | Allowed (multiple times) |
The test environment for Automata Fix allows you to compile and run the given code as many times as needed to verify your fix. Using print statements to trace variable values is permitted. The final submission must pass all test cases to earn full marks.
Fix only what is broken. Rewriting an entire function when one line is wrong will not earn extra marks and risks introducing new bugs. Read the code carefully before touching it.
The Three Question Types in Automata Fix
Every Automata Fix question falls into one of three categories. Recognising the type before you start editing saves significant time.
1. Compilation (Syntax) Errors
The code will not compile. Your task is to correct the syntax without changing the program’s intended logic. Common issues in this type:
- Missing or malformed
#includedirectives - Incorrect data types (such as using
floatwhere an integral type is required by the language specification) - Missing semicolons or mismatched braces
- Incorrect function signatures
The test case and expected output are provided in the problem statement, which makes it straightforward to verify your fix once the code compiles.
2. Logical Errors
The code compiles and runs, but produces wrong output. The logic is broken. Common causes:
- Off-by-one errors in loop conditions (
i < nvsi <= n) - Misplaced semicolons that alter loop or conditional scope
- Incorrect operators (addition where subtraction is needed, greater-than where less-than is needed)
- Wrong variable used in a calculation
- Incorrect initial value (loop counter starting at 1 instead of 0, or a running sum initialised to 1 instead of 0)
Logical errors take longer to diagnose than syntax errors because the code runs. You have to trace the execution either mentally or with print statements to find where the output diverges from what is expected.
3. Code Reuse
A partially written program is given. Your task is to complete it by implementing the missing functions. A helper code tab in the test interface shows the existing functions and classes you can call.
This is the most complex question type. You are not fixing a single bug; you are implementing logic that must integrate cleanly with the scaffolding already provided. The functions you write must call the helper functions exactly as defined in the helper tab. Writing a standalone implementation that bypasses those helpers will not match the expected output.
Worked Examples: Syntax Error, Logical Error, Code Reuse
Work through each problem before reading the solution. That is how pattern recognition is built.
Example 1: Syntax Error (switch statement)
Problem:
#include n
int main()
{
float x = 1.1;
switch (x)
{
case 1: printf("Choice is 1");
break;
default: printf("Invalid choice");
break;
}
return 0;
}
Issues to find:
#include nis malformed. The standard input/output header requires angle brackets and the correct filename.- In C, the expression in a
switchstatement must be of integral type (int,char, orenum).floatis not valid; the compiler rejects it.
Solution:
#include <stdio.h>
int main()
{
int x = 1;
switch (x)
{
case 1: printf("Choice is 1");
break;
default: printf("Invalid choice");
break;
}
return 0;
}
What changed:
#include ncorrected to#include <stdio.h>.float x = 1.1changed toint x = 1, making x an integral type valid for a switch expression.
Two separate bugs in a single question is normal for syntax-error questions. Address both before submitting.
Example 2: Logical Error (for loop semicolon)
Problem:
void main() {
int i, j, n = 5;
for(i = 1; i < n; i++)
{
for(j = i; j < n; j++);
{
printf("%d", i);
}
printf("\n");
}
}
The bug: The semicolon immediately after for(j = i; j < n; j++) is the entire issue. In C, a semicolon immediately after a loop header is a valid empty statement; the compiler treats it as the complete body of the inner loop. The block { printf("%d", i); } that follows is then parsed as a standalone block attached to the outer for loop, not the inner one. It runs exactly once per outer iteration regardless of j.
The intended output is a specific numeric pattern; the broken code produces a degenerate version of it because the inner loop runs (silently, with an empty body) and then the print block runs once.
Solution: Remove the semicolon.
void main() {
int i, j, n = 5;
for(i = 1; i < n; i++)
{
for(j = i; j < n; j++)
{
printf("%d", i);
}
printf("\n");
}
}
Why this class of bug matters:
The stray-semicolon-after-loop-header is one of the most frequently tested logical error patterns in Automata Fix. Train your eye to scan the line immediately after every loop header. If a semicolon appears there, verify whether it belongs or is the bug.
Example 3: Code Reuse (equilibrium index)
Problem: Find the equilibrium element in an array. An equilibrium element is one where the sum of all elements to its left equals the sum of all elements to its right.
For a[] = {1, 2, 3, 4, 3, 3}, the equilibrium element is 4 (at index 3), because 1+2+3 = 3+3 = 6.
Given scaffolding:
#include <stdio.h>
int left_side_sum(int a[], int n, int idx);
int right_side_sum(int a[], int n, int idx);
int findEquilibriumIndex(int a[], int n);
int main() {
int a[10], n, i;
scanf("%d", &n);
for(i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
int equiIndex = findEquilibriumIndex(a, n);
if(equiIndex != -1) {
printf("%d", a[equiIndex]);
}
return 0;
}
Task: Implement left_side_sum, right_side_sum, and findEquilibriumIndex using the declared signatures exactly.
Solution:
int left_side_sum(int a[], int n, int idx) {
int sum = 0;
for(int i = 0; i < idx; i++) {
sum += a[i];
}
return sum;
}
int right_side_sum(int a[], int n, int idx) {
int sum = 0;
for(int i = idx + 1; i < n; i++) {
sum += a[i];
}
return sum;
}
int findEquilibriumIndex(int a[], int n) {
for(int i = 0; i < n; i++) {
if(left_side_sum(a, n, i) == right_side_sum(a, n, i)) {
return i;
}
}
return -1;
}
Key points:
- The function signatures must match exactly what the scaffolding declares. Changing a parameter name or return type breaks the compile step.
findEquilibriumIndexreturns the index, not the element value. Themain()function uses that index to printa[equiIndex]. Return the index; do not print inside your function.- Time complexity is O(n squared) for this implementation. That is acceptable for the array sizes used in Automata Fix test cases.
- If you know the prefix-sum approach, it reduces the solution to O(n). Either version passes correctness; the O(n) version scores better on the complexity axis if the grader measures it.
How the Automata Fix Grader Evaluates Your Output
The grader runs your corrected code against multiple test case tiers. According to SHL India’s assessment framework, the evaluation covers four dimensions:
Correctness across test tiers:
- Basic cases: standard, expected inputs matching the problem statement.
- Advanced cases: edge cases and moderately complex inputs (empty arrays, single-element arrays, negative values).
- Boundary cases: extreme inputs (maximum array size, overflow-prone values, strings with special characters).
A fix that handles the basic cases but crashes on boundary inputs earns partial marks, not full marks.
Runtime error handling:
Null pointer dereferences, array-out-of-bounds accesses, and unguarded recursion (stack overflow) all count against your score. After fixing the stated bug, check that your code handles inputs beyond the example provided in the question.
Logic preservation:
For syntax-error questions, the grader checks that you corrected the error without altering the program’s intended logic. Rewriting the entire function when one line needed fixing is penalised on this axis.
Approach quality:
Code reuse questions reward solutions that use the provided helper functions as intended. A standalone implementation that produces the correct output but ignores the helper structure will score lower on this dimension.
Practical working approach:
Before touching the code, read it top to bottom once. Then re-read the section that looks suspicious. Most Automata Fix bugs are local: one line or one token. Students who start editing immediately waste time making fixes in the wrong place.
Prep Strategy: Four Weeks to Automata Fix Readiness
Week 1: Build the code-reading habit
The foundational skill for Automata Fix is reading code you did not write. Take programs from your own past work and introduce deliberate bugs: a stray semicolon after a loop, a float variable in a switch, a wrong loop boundary. Then diagnose and fix them. Do this 15 to 20 times across C and Java.
Focus areas this week: C syntax rules (switch integral requirement, loop structure, scanf format specifiers, include directives), Java method signatures, pointer basics in C.
Week 2: Syntax error drills
Work through 20 to 30 syntax-error debugging exercises from external sources. HackerRank’s Bug Fixing challenge set is a suitable starting point. C programming forums and old question papers also have good material.
Focus areas: common include errors, data type rule violations, brace and parenthesis mismatches, semicolon placement.
Week 3: Logical error and code completion drills
Logical errors require tracing execution state. Practice tracing with pen and paper before running the code: write the variable values at each loop iteration for the broken version, then for the fixed version, and confirm they match the expected output.
For code completion exercises, make it a rule to read every function signature in the scaffold before writing any implementation. The signature specifies the return type, argument types, and naming; your implementation must match all three.
Week 4: Timed practice and pattern consolidation
By Week 4, the goal is recognising each bug type within 60 seconds of reading the code. Speed under pressure comes from pattern recognition, not from reading faster.
Take timed practice sets. After each set, classify every mistake: did not recognise the bug type; recognised but made the wrong fix; correct fix but too slow. Each category points to a different drill for the following session.
For a broader AMCAT preparation strategy, the AMCAT test preparation and most-repeated questions guide covers all sections systematically, including the quantitative and logical reasoning sections that appear alongside Automata Fix in the full test.
Cognizant’s GenC Pipeline and the Automata Fix Section
Cognizant is one of the companies that specifically uses AMCAT Automata Fix in its fresher hiring pipeline. According to CIOL’s coverage of Cognizant’s workforce strategy, Cognizant plans to hire up to 25,000 fresh graduates in 2026 as AI drives a broader pyramid workforce model.
The Automata Fix section appears at the aptitude screening stage, before the technical interview. Clearing it is a gate to the interview round, not an optional module.
| Track | CTC Band |
|---|---|
| GenC (standard entry) | ₹4.0 to 4.5 LPA |
| GenC Elevate / GenC Pro | ₹6.5 to 9.0 LPA |
The Cognizant Automata Fix pattern guide covers Cognizant-specific examples and the exact scoring configuration Cognizant uses. For the full GenC selection pipeline from eligibility to offer, the Cognizant recruitment pattern and important topics guide is the right starting point.
Debugging Logic and What It Prepares You For
The mental model Automata Fix trains, reading unfamiliar code, classifying the error type, making a targeted correction without disturbing the rest of the logic, is the same instinct senior software engineers apply daily. Most working programmers spend more time reading and diagnosing code than writing it from scratch.
The stray semicolon in Example 2 illustrates this precisely: a single punctuation token silently redirects an entire inner loop’s execution without any compiler warning. Tracing that required reading the code structurally, not just linearly. The same step-by-step structural trace applies when debugging an LLM prompt chain where one misplaced instruction token shifts the output in unexpected ways.
The 2026 AI roadmap for Indian engineering students maps where that debugging instinct takes you next. For students who want to try building with LLM APIs before committing to a full programme, TinkerLLM is FACE Prep’s self-paced entry point at ₹299.
Clear the Automata Fix section first. The instinct you build here transfers.
Primary sources
Frequently asked questions
What companies use AMCAT Automata Fix?
Cognizant uses Automata Fix in its GenC fresher hiring process. Wipro and several other IT services companies also configure it as part of their AMCAT screening flow.
How many questions are in the AMCAT Automata Fix section?
The section covers three question types: one syntax error, one logical error, and one code reuse question. The exact count may vary by employer configuration, but the three-type structure is consistent.
What programming languages can I use in Automata Fix?
Automata Fix supports C, C++, and Java. Unlike the standard AMCAT Automata section, Python is not available in Automata Fix.
Can I use print statements to debug in Automata Fix?
Yes. The test environment allows you to compile and run the code as many times as needed before final submission. Using print statements to trace variable values is permitted and often the fastest way to verify a logical error fix.
Is Automata Fix harder than standard AMCAT Automata?
They test different skills. Standard Automata tests algorithm design from scratch; Automata Fix tests code reading and bug diagnosis. Students with strong reading comprehension but less algorithm-writing experience often find Automata Fix more approachable.
What is the helper code tab in Automata Fix?
In code reuse questions, the test interface provides a helper code tab showing the existing functions and classes you can call. Your implementation must use these helpers as defined; writing a standalone solution that bypasses them misses the intent of the question and costs marks.
How do I prepare for code reuse questions in Automata Fix?
Practice implementing functions given a pre-written scaffold. Read the existing function signatures before writing a single line of code. The signature tells you the return type, argument types, and what the calling code expects from your implementation.
A self-paced playground for building with LLMs.
TinkerLLM is FACE Prep's sister property. A guided environment for shipping real LLM applications, the kind of project that earns a paragraph on your resume, not a line.
Try TinkerLLM (₹299 launch)