Panda Guru LogoPanda
Guru

FIS Global | IT Trainee | 2024 Batch | On-Campus

Round 1 – (Online Assessment)

Questions: 1. Wedding game

In a wedding that you are attending, there are some chairs that have digits inscribed at their backs. The chairs are lined in a row such that they form a string of the digits. Find the minimum number of sets M that can be formed from these digits such that:

  1. The number of digits in each set is one gf more than one.
  2. Each set is formed using consecutive digits and no digit can be used more than once.
  3. In each set, the number formed using the digits is less than or equal to Y.

Input1 = S, String of Digits.
Input2 = Y. No Number should be greater than Y.
Input3 = Size of String S.

Output Specification: Your Function should return M, the minimum number of Sets.

Example 1:
Input1 = “1234”
Input2 = 4
Input3 = 4

Output = 4

C++ Code:

#include <bits/stdc++.h> using namespace std; int minimumSets(string s, int x, int l) { int count = 0, n = 0; bool f = false; for(int i=0; i<l; i++) { n = n * 10 + (s[i] - '0'); if(n <= x) f = true; else { if(f) count += 1; n = s[i] - '0'; f = false; if(n <= x) f = true; else n = 0; } } if(f == true) count += 1; return count; } int main() { string s; cin >> s; int input2 = 0; cin >> input2; int input3 = s.size(); cout << minimumSets(s, input2, input3) << "\n"; return 0; }

2. Mr. Myers and the Exam

A mathematics question paper has a certain number of questions and each question is assigned some random maximum marks. Mr. Myers wants to edit the marks assigned to the questions such that:

Input Specification:
input1: The number of questions in the paper
input2: The array representing the original marks assigned to every question

Output Specification:
The minimum total marks Mr. Myers can set the paper for.

Example 1:
input1: 5
input2: {1,2,3,4,5}
Output: 15

Example 2:
input1: 5
input2: {1,4,5,4,5}
Output: 23

C++ Code:

#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int n; cin >> n; ll arr[n]; for(int i=0; i<n; i++) cin >> arr[i]; sort(arr, arr + n); ll prev = arr[0]; ll ans = arr[0]; for(int i=1; i<n; i++) { ll cur = arr[i]; if(prev > cur) cur = prev + 1; else if(cur == prev) cur++; ans += cur; prev = cur; } cout << ans << "\n"; return 0; }
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 2 – (Technical Interview)

Questions:

No DSA, Computer Networks, Operating System Questions were asked by my Panel.
The interview lasted for around 50 Min.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 3 - (HR Interview)

Questions:

The interview lasted for 15 minutes.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Final Verdict – Selected