Infosys FA1 Mock Assessment

Wingspan Proctor v3.0.6 Duration: 150 Mins Max Marks: 20

Instructions & Guidelines to Candidates

View README.md

Exam Rules

  1. Follow the class diagram strictly. Read the problem statement, examples and the other details provided carefully and implement the solution.
  2. Code submitted with compilation errors may not get evaluated.
  3. DO NOT add any new method apart from the one given in the file where you write the solution.
  4. DO NOT alter the method name or the argument list of the method that is provided to you.
  5. DO NOT write codes that result in infinite loops / infinite recursive calls, because it just won't work!
  6. The test cases provided are a subset of test cases that will be used to test your code.
Mark Reduction Warnings:
  • Removal / modification of package statements
  • Infinite loops / infinite recursive calls
  • Class diagram violation
  • Improper constructor prototype or definition
Candidate Instructions Screen
Original Screen Capture - Wingspan Proctor Instructions

Question 1: Programming Fundamentals — Token Validation

5 Marks Raw .md

Problem Description

Mr. Charles is developing a pharmaceuticals system to generate a verification token based on the input string. Write code in the given Java method to implement the requirement.

Input & Output Format

  • Input: A String containing at most one $ character.
  • Output: Returns a String.
  • Constraints: input string length >= 1

Validation Rules

  • Check whether the input string contains two parts separated by a $ in the format <part1>$<part2>.
  • If format is valid (both parts non-empty):
    • part1 must contain only lowercase alphabets (a-z).
    • part2 must contain only digits (0-9).
  • Return:
    • If both conditions satisfied: return "<part1>_valid"
    • Otherwise: return "<part1>_invalid"
  • If the input string does not follow the required format (e.g. missing $, multiple $, empty parts): return "invalid".

Sample Test Cases

Example Input Expected Output Explanation
1 "colpol$01" "colpol_valid" Valid format, part1 is lowercase letters, part2 is digits
2 "123e$456" "123e_invalid" Valid format, but part1 contains digits
3 "dolo650" "invalid" Missing '$' delimiter
4 "crocin$50$" "invalid" Contains multiple '$' symbols
Question 1 Screen Capture
Original Screen Capture - Question 1

Question 2: Programming Fundamentals — Inventory Batch Audit

5 Marks Raw .md

Problem Description

The "CERT-AO" organization audits inventory batches. Write code in the given Java method to implement the requirement.

Input & Output Format

  • Input:
    • 1D integer array named actualArr representing actual quantities.
    • 1D integer array named thresholdArr representing target threshold values.
  • Output: Returns a 1D String array named outArr.
  • Constraints: 0 <= actual quantity <= 99, 0 <= target threshold <= 99, arrays have identical length.

Rules

  • For each element at index i in actualArr:
    • If actualArr[i] >= thresholdArr[i]: add "<element>_RELEASED" to outArr.
    • Otherwise: add "<element>_REJECTED" to outArr.
  • Process for all elements and return outArr.

Sample Test Cases

# actualArr thresholdArr Expected Output (outArr)
1 [8, 3, 24, 28, 55, 44] [5, 5, 6, 25, 18, 42] ["8_RELEASED", "3_REJECTED", "24_RELEASED", "28_RELEASED", "55_RELEASED", "44_RELEASED"]
2 [6, 77, 66, 23] [5, 99, 50, 68] ["6_RELEASED", "77_REJECTED", "66_RELEASED", "23_REJECTED"]
3 [10, 15, 20, 21, 10] [20, 25, 31, 23, 15] ["10_REJECTED", "15_REJECTED", "20_REJECTED", "21_REJECTED", "10_REJECTED"]
4 [29, 10, 31, 55, 35] [20, 5, 20, 20, 10] ["29_RELEASED", "10_RELEASED", "31_RELEASED", "55_RELEASED", "35_RELEASED"]
Question 2 Screen Capture
Original Screen Capture - Question 2

Question 3: Object Oriented Programming — UpSkill Certification

5 Marks Raw .md

"UpSkill" global educational organization offers training and certification. To get certified, users must take a prerequisite course and pay fees for both. Automate fee calculation based on the given class diagram.

Rebuilt High-Resolution UML Class Diagram

UpSkill Rebuilt UML Class Diagram
Original Class Diagram Photo
Original Screen Photo - Class Diagram
Question 3 Details Screen
Original Screen Photo - Fee Calculation Rules

Class & Method Specifications

Class Method Name & Signature Implementation Details
Course identifyCourseFee(): int Code provided, no need to implement
Certification generateCertificationId(): void Code provided, no need to implement
identifyModeOfCertificationFee(): int Code provided, no need to implement
Employee
(extends Certification)
validateEmployee(): boolean Code provided, no need to implement
identifyDiscountPercent(certification: Certification): Integer Code provided, enhance as per requirement
calculateTotalFee(certification: Certification): void Need to be implemented

Logic Requirements

1. identifyDiscountPercent(certification: Certification): Integer

The current implementation sets discount of 10 if employee is valid (validateEmployee() == true), else 0.

Enhance the logic to update discount percent:

  • If the mode fee identified by certification.identifyModeOfCertificationFee() >= 350, provide an additional discount of 5.
  • Identify additional discount based on course fee determined by course.identifyCourseFee():
    Course FeeAdditional Discount
    4500 and above10
    Between 3500 (inclusive) and 4500 (exclusive)8
    Between 2500 (inclusive) and 3500 (exclusive)5
  • Return final discount percent (e.g. 10 + 5 + 5 = 20%).

2. calculateTotalFee(certification: Certification): void

  • Invoke course.identifyCourseFee() to identify courseFee (double).
  • Identify basicFee (int) as 5000.
  • Invoke validateEmployee() method.
  • If validateEmployee() == true AND courseFee != -1.0:
    • For reqCourseType present in first row of courseTypeArr ({"Concept Based", "Hands-On", "Hybrid"}), identify cost (double) from second row ({"200.0", "500.0", "1000.0"}). Perform case-sensitive comparison.
    • Update cost: cost = cost + basicFee + courseFee.
    • If employeeType is "Trainee" AND orgName is "Infosys" (perform case-insensitive comparison): deduct 2000.0 from cost.
    • Set certificationFee of Certification class with the identified cost.
    • Invoke certification.generateCertificationId().
  • Otherwise:
    • Set certificationFee to -1.0.
    • Set certificationId to "NA".

Question 4: Data Structures — Queue Coupon Classification

5 Marks Raw .md

Problem Description

An e-commerce system stores coupons in the order they arrive. It also prevents misuse of blocked coupons. Write code in the given Java method to classify coupons based on the rules.

Input & Output Format

  • Input:
    • ArrayDeque<Integer> allowedQueue (coupons in sequence)
    • ArrayList<Integer> blockedList (blocked coupons)
  • Output: Returns ArrayDeque<String> outQueue.
  • Constraints: 0 <= number of coupons <= 10, 1000 <= coupon value <= 9999.

Classification Rules

For each coupon processed from front to rear:

  • If the coupon:
    • Appears more than once in allowedQueue, AND
    • Is not present in blockedList
    → Classify as "EC" (Eligible Coupon) and store as "<coupon>_EC" in a temporary data structure.
  • Otherwise: → Classify as "IC" (Invalid Coupon) and add "<coupon>_IC" directly to the output queue.
  • After processing all elements: → Append all elements from the temporary data structure in reverse order to the output queue.

Sample Test Cases

allowedQueue (Front→Rear) blockedList tempDataStructure outQueue (Front→Rear)
[4820, 1999, 4820, 2501, 2501, 6000, 3200, 3200] [2501, 7000] {"4820_EC", "4820_EC", "3200_EC", "3200_EC"} ["1999_IC", "2501_IC", "2501_IC", "6000_IC", "3200_EC", "3200_EC", "4820_EC", "4820_EC"]
[3000, 3000, 4200, 4200] [3000, 4200] - ["3000_IC", "3000_IC", "4200_IC", "4200_IC"]
Question 4 Screen Capture
Original Screen Capture - Question 4
Question 4 Sample Table
Sample Input & Output Table