Published: 23rd August 2025 | Reading Time: 9 minutes
KPIT Technologies is a major global technology consulting and software company specialized in providing innovative solutions for major sectors such as automotive, manufacturing, energy, and others. With an ever-increasing demand for skilled technology professionals, KPIT seeks candidates who possess a winning combination of domain-specific expertise along with strong coding prowess. Coding skills are very critical in the selection process by KPIT since the company wants to recruit those who would contribute in developing cutting-edge projects and innovating technology.
This article discusses KPIT Technologies, gives an overview of why coding skills are important in recruitment, highlights some top coding questions for 2025, and proposes tips for coding assessments that candidates should tackle while in the recruitment process.
KPIT Technologies is a global leader in IT consulting and product engineering. It specializes in providing transformation across automotive, manufacturing, and energy industries. KPIT's team works on developing next-generation products that are electric vehicle solutions, autonomous driving, connected vehicles, and digital transformation for enterprises.
Among all the technology domains, automotive software, IoT, AI/ML, and cloud computing make it very attractive for technology professionals to take a critical position with KPIT Technologies. Since the company has a global presence, it would provide its employees with ample opportunities to grow professionally during their time with the company.
KPIT considers coding and algorithmic skills as main aspects in the selection process, since they are crucial in providing high-quality software solutions to their clients. Job applicants, especially in the technical and engineering domain, need to demonstrate, as part of the hiring process, their coding competency. Coding is central to the jobs for which KPIT recruits, including software developers, engineers, and consultants.
Coding skills really are the key indicators of a candidate's ability to solve complex problems, think critically, and build scalable solutions, all of which are crucial for KPIT's success in the highly competitive technology landscape. Strong coding skills will simply ensure that the candidates are capable enough to make effective contributions to projects involving innovative and sophisticated technologies.
Here are the top KPIT coding questions in 2025:
You are creating a secure login mechanism. The password has to abide by some rules: it has to be at least one digit, one lower case letter, one upper case letter, no space, and six characters in length minimum. If the password is correct, then return "password valid;" otherwise return "Invalid password, try again."
Input:
abjnlL09
Output:
password valid
#include <bits/stdc++.h>
using namespace std;
bool isValidPassword(string s) {
if (s.length() < 6) return false;
bool hasDigit = false, hasLower = false, hasUpper = false;
for (char c : s) {
if (c == ' ' || c == '/') return false;
if (isdigit(c)) hasDigit = true;
else if (islower(c)) hasLower = true;
else if (isupper(c)) hasUpper = true;
}
return hasDigit && hasLower && hasUpper;
}
int main() {
string s;
getline(cin, s);
if (isValidPassword(s)) cout << "password valid";
else cout << "Invalid password, try again";
}
def is_valid_password(s):
if len(s) < 6:
return False
has_digit = any(c.isdigit() for c in s)
has_lower = any(c.islower() for c in s)
has_upper = any(c.isupper() for c in s)
return has_digit and has_lower and has_upper and ' ' not in s and '/' not in s
s = input()
if is_valid_password(s):
print("password valid")
else:
print("Invalid password, try again")
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
if (isValidPassword(s)) {
System.out.println("password valid");
} else {
System.out.println("Invalid password, try again");
}
}
public static boolean isValidPassword(String s) {
if (s.length() < 6) return false;
boolean hasDigit = false, hasLower = false, hasUpper = false;
for (char c : s.toCharArray()) {
if (c == ' ' || c == '/') return false;
if (Character.isDigit(c)) hasDigit = true;
if (Character.isLowerCase(c)) hasLower = true;
if (Character.isUpperCase(c)) hasUpper = true;
}
return hasDigit && hasLower && hasUpper;
}
}
This program verifies if the provided password meets the conditions: a digit, a lower case letter, an upper case letter, no space, and no forward slash, and at least 6 characters in length. If the password meets all the conditions, then the program prints "password valid" and else "Invalid password, try again.".
Rahul copies his adjacent student's answer by rearranging letters during an exam. Your task is to check if Rahul's answer is a scrambled version of the student's. You are given two strings: the student's and Rahul's answers. If they are anagrams of each other, return "1" (copied), otherwise return "0" (not copied).
Input:
CAR
ACR
Output:
1
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
sort(s1.begin(), s1.end());
sort(s2.begin(), s2.end());
if (s1 == s2) cout << "1";
else cout << "0";
return 0;
}
s1 = input().upper()
s2 = input().upper()
if sorted(s1) == sorted(s2):
print(1)
else:
print(0)
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1 = sc.next().toUpperCase();
String s2 = sc.next().toUpperCase();
char[] arr1 = s1.toCharArray();
char[] arr2 = s2.toCharArray();
Arrays.sort(arr1);
Arrays.sort(arr2);
if (Arrays.equals(arr1, arr2)) {
System.out.println("1");
} else {
System.out.println("0");
}
}
}
The goal is to check if two given strings are anagrams of each other (i.e., if one string is a scrambled version of the other). If they are anagrams, the output is "1" (copied); otherwise, the output is "0" (not copied).
You are given a string that contains a set of IDs. Every ID is a substring of the string. You need to return lexicographically maximum possible ID by looking at all substrings. The ID is obtained by sorting all substrings of the input string and returning the last one.
Input:
Abdc
Output:
dc
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
vector<string> substrings;
for (int i = 0; i < s.length(); i++) {
substrings.push_back(s.substr(i));
}
sort(substrings.begin(), substrings.end(), greater<string>());
cout << substrings[0] << endl;
}
s = input()
substrings = [s[i:] for i in range(len(s))]
substrings.sort(reverse=True)
print(substrings[0])
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
List<String> substrings = new ArrayList<>();
for (int i = 0; i < s.length(); i++) {
substrings.add(s.substring(i));
}
Collections.sort(substrings, Collections.reverseOrder());
System.out.println(substrings.get(0));
}
}
Given a string, we generate all possible substrings, sort them in lexicographical order, and output the highest one (i.e., the last in lexicographical order). This is an emulation of generating all possible IDs and choosing the one with the highest ranking.
Given a budget and a list of party costs and fun values, you must determine the maximum fun you can have without exceeding the budget. You must pick the parties that have the most fun within the budget. For each party, the cost and fun values are provided.
Input:
50 10
3 8
9 6
10 2
...
Output:
50 2948
#include <bits/stdc++.h>
using namespace std;
int main() {
int budget, n;
while (cin >> budget >> n && (budget || n)) {
vector<int> cost(n), fun(n);
for (int i = 0; i < n; ++i) cin >> cost[i] >> fun[i];
vector<vector<int>> dp(n+1, vector<int>(budget+1, 0));
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= budget; ++j) {
if (cost[i-1] <= j)
dp[i][j] = max(fun[i-1] + dp[i-1][j-cost[i-1]], dp[i-1][j]);
else
dp[i][j] = dp[i-1][j];
}
}
int max_fun = dp[n][budget], total_cost = budget;
for (int i = 0; i <= budget; ++i) {
if (dp[n][i] == max_fun) {
total_cost = i;
break;
}
}
cout << total_cost << " " << max_fun << endl;
}
}
def max_fun(budget, n, cost, fun):
dp = [[0] * (budget + 1) for _ in range(n + 1)]
for i in range(1, n + 1):
for j in range(1, budget + 1):
if cost[i-1] <= j:
dp[i][j] = max(fun[i-1] + dp[i-1][j-cost[i-1]], dp[i-1][j])
else:
dp[i][j] = dp[i-1][j]
max_fun_value = dp[n][budget]
total_cost = budget
for i in range(budget + 1):
if dp[n][i] == max_fun_value:
total_cost = i
break
return total_cost, max_fun_value
while True:
budget, n = map(int, input().split())
if budget == 0 and n == 0:
break
cost, fun = [], []
for _ in range(n):
c, f = map(int, input().split())
cost.append(c)
fun.append(f)
result = max_fun(budget, n, cost, fun)
print(result[0], result[1])
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true) {
int budget = sc.nextInt();
int n = sc.nextInt();
if (budget == 0 && n == 0) break;
int[] cost = new int[n];
int[] fun = new int[n];
for (int i = 0; i < n; i++) {
cost[i] = sc.nextInt();
fun[i] = sc.nextInt();
}
int[][] dp = new int[n + 1][budget + 1];
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= budget; j++) {
if (cost[i - 1] <= j) {
dp[i][j] = Math.max(fun[i - 1] + dp[i - 1][j - cost[i - 1]], dp[i - 1][j]);
} else {
dp[i][j] = dp[i - 1][j];
}
}
}
int maxFun = dp[n][budget], totalCost = budget;
for (int i = 0; i <= budget; i++) {
if (dp[n][i] == maxFun) {
totalCost = i;
break;
}
}
System.out.println(totalCost + " " + maxFun);
}
}
}
This is a classic knapsack problem where we maximize the fun within a given budget. The program takes a list of party costs and fun values and outputs the maximum fun that can be achieved without exceeding the budget.
You work for a weather service that needs to convert temperatures into various formats. Given a temperature in Celsius, you need to convert it into Fahrenheit and Kelvin. Create a program that takes a Celsius temperature input and outputs the corresponding temperature in both Fahrenheit and Kelvin.
Input:
25
Output:
Fahrenheit: 77
Kelvin: 298.15
#include <iostream>
using namespace std;
void convertTemperature(double celsius) {
double fahrenheit = (celsius * 9/5) + 32;
double kelvin = celsius + 273.15;
cout << "Fahrenheit: " << fahrenheit << endl;
cout << "Kelvin: " << kelvin << endl;
}
int main() {
double celsius;
cin >> celsius;
convertTemperature(celsius);
return 0;
}
def convert_temperature(celsius):
fahrenheit = (celsius * 9/5) + 32
kelvin = celsius + 273.15
print(f"Fahrenheit: {fahrenheit}")
print(f"Kelvin: {kelvin}")
celsius = float(input())
convert_temperature(celsius)
import java.util.Scanner;
public class Main {
public static void convertTemperature(double celsius) {
double fahrenheit = (celsius * 9/5) + 32;
double kelvin = celsius + 273.15;
System.out.println("Fahrenheit: " + fahrenheit);
System.out.println("Kelvin: " + kelvin);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double celsius = scanner.nextDouble();
convertTemperature(celsius);
}
}
This program accepts a temperature in Celsius as an input and outputs Fahrenheit and Kelvin. The equation used to convert from Celsius to Fahrenheit is Fahrenheit = (Celsius * 9/5) + 32, and from Celsius to Kelvin is Kelvin = Celsius + 273.15.
You are creating a task management system. Every task has a priority level assigned to it, and you have to process them based on the priority level. The system must offer the tasks in highest to lowest priority. The input is an array of functions with name and priority level. Update the priorities dynamically.
Input:
5
Task1 1
Task2 3
Task3 2
Task4 1
Task5 3
Output:
Task2 3
Task5 3
Task3 2
Task1 1
Task4 1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Task {
string name;
int priority;
};
bool compare(Task a, Task b) {
return a.priority > b.priority;
}
int main() {
int n;
cin >> n;
vector<Task> tasks(n);
for (int i = 0; i < n; i++) {
cin >> tasks[i].name >> tasks[i].priority;
}
sort(tasks.begin(), tasks.end(), compare);
for (auto task : tasks) {
cout << task.name << " " << task.priority << endl;
}
return 0;
}
def task_priority_queue(n, tasks):
tasks.sort(key=lambda x: x[1], reverse=True)
for task in tasks:
print(f"{task[0]} {task[1]}")
n = int(input())
tasks = [tuple(input().split()) for _ in range(n)]
tasks = [(task[0], int(task[1])) for task in tasks]
task_priority_queue(n, tasks)
import java.util.*;
public class Main {
static class Task {
String name;
int priority;
Task(String name, int priority) {
this.name = name;
this.priority = priority;
}
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
scanner.nextLine();
List<Task> tasks = new ArrayList<>();
for (int i = 0; i < n; i++) {
String name = scanner.next();
int priority = scanner.nextInt();
tasks.add(new Task(name, priority));
}
tasks.sort((a, b) -> Integer.compare(b.priority, a.priority));
for (Task task : tasks) {
System.out.println(task.name + " " + task.priority);
}
}
}
This program manages a task priority queue. It first reads n tasks, each with a name and priority. The tasks are sorted in descending order by priority using a custom comparator or sorting function. After sorting, it outputs the task names along with their priorities.
You are building a recommendation system for an e-commerce platform. Given a customer's purchase history (a list of items with prices), write a program to recommend new items based on items most frequently bought together. Output the items likely to be bought next, sorted by relevance based on purchase history.
Input:
4
Item1 30
Item2 15
Item3 30
Item4 20
Output:
Item1
Item3
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
map<string, int> purchaseHistory;
vector<string> items(n);
for (int i = 0; i < n; i++) {
string item;
int price;
cin >> item >> price;
purchaseHistory[item] = price;
}
// Sorting items based on prices (assumed most bought are higher priced)
vector<pair<string, int>> sortedItems(purchaseHistory.begin(), purchaseHistory.end());
sort(sortedItems.begin(), sortedItems.end(), [](auto &a, auto &b) {
return a.second > b.second;
});
for (auto &item : sortedItems) {
cout << item.first << endl;
}
return 0;
}
def recommend_items(n, purchases):
purchase_history = {}
for item, price in purchases:
purchase_history[item] = price
sorted_items = sorted(purchase_history.items(), key=lambda x: x[1], reverse=True)
for item in sorted_items:
print(item[0])
n = int(input())
purchases = [tuple(input().split()) for _ in range(n)]
purchases = [(item, int(price)) for item, price in purchases]
recommend_items(n, purchases)
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
Map<String, Integer> purchaseHistory = new HashMap<>();
for (int i = 0; i < n; i++) {
String item = scanner.next();
int price = scanner.nextInt();
purchaseHistory.put(item, price);
}
List<Map.Entry<String, Integer>> sortedItems = new ArrayList<>(purchaseHistory.entrySet());
sortedItems.sort((a, b) -> Integer.compare(b.getValue(), a.getValue()));
for (Map.Entry<String, Integer> item : sortedItems) {
System.out.println(item.getKey());
}
}
}
The above example tracks item purchases and recommends items based on the highest price. It stores items and their prices in a map, sorts them in descending order by price, and then outputs the item names in order of their prices.
You are tasked with creating a job scheduler for a cloud computing service. You are given a list of tasks, each with a start time, end time, and CPU demand. The goal is to schedule the maximum number of non-overlapping functions within a specific time window. Print the IDs of the tasks that can be completed without conflict.
Input:
5
Task1 1 4 5
Task2 2 3 3
Task3 3 5 4
Task4 0 6 6
Task5 5 7 2
Output:
Task2 Task5
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Task {
string id;
int start, end, cpu;
};
bool compare(Task a, Task b) {
return a.end < b.end; // Sort by end time
}
int main() {
int n;
cin >> n;
vector<Task> tasks(n);
for (int i = 0; i < n; i++) {
cin >> tasks[i].id >> tasks[i].start >> tasks[i].end >> tasks[i].cpu;
}
sort(tasks.begin(), tasks.end(), compare);
vector<string> result;
int last_end_time = -1;
for (auto& task : tasks) {
if (task.start >= last_end_time) {
result.push_back(task.id);
last_end_time = task.end;
}
}
for (const auto& id : result) {
cout << id << " ";
}
cout << endl;
return 0;
}
def job_scheduling(n, tasks):
tasks.sort(key=lambda x: x[2]) # Sort tasks by end time
result = []
last_end_time = -1
for task in tasks:
if task[1] >= last_end_time:
result.append(task[0])
last_end_time = task[2]
print(" ".join(result))
n = int(input())
tasks = [input().split() for _ in range(n)]
tasks = [(task[0], int(task[1]), int(task[2]), int(task[3])) for task in tasks]
job_scheduling(n, tasks)
import java.util.*;
public class Main {
static class Task {
String id;
int start, end, cpu;
Task(String id, int start, int end, int cpu) {
this.id = id;
this.start = start;
this.end = end;
this.cpu = cpu;
}
}
public static void jobScheduling(List<Task> tasks) {
tasks.sort(Comparator.comparingInt(a -> a.end));
List<String> result = new ArrayList<>();
int lastEndTime = -1;
for (Task task : tasks) {
if (task.start >= lastEndTime) {
result.add(task.id);
lastEndTime = task.end;
}
}
result.forEach(task -> System.out.print(task + " "));
System.out.println();
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
scanner.nextLine(); // consume newline
List<Task> tasks = new ArrayList<>();
for (int i = 0; i < n; i++) {
String id = scanner.next();
int start = scanner.nextInt();
int end = scanner.nextInt();
int cpu = scanner.nextInt();
tasks.add(new Task(id, start, end, cpu));
}
jobScheduling(tasks);
}
}
The program schedules the maximum number of non-overlapping tasks by sorting tasks by their end time. It then iterates through the sorted tasks and selects tasks that start after the last selected task ends, ensuring no overlap occurs in the schedule.
You have a queue of customers with each customer assigned a priority level (1-10). The higher the number on the priority level, the earlier the customer needs to be served. Reorder the queue by priority from top to bottom and write out the order in which customers need to be served.
Input:
5
Alice 7
Bob 5
Charlie 10
David 3
Eva 8
Output:
Charlie Eva Alice Bob David
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Customer {
string name;
int priority;
};
bool compare(Customer a, Customer b) {
return a.priority > b.priority; // Sort by priority in descending order
}
int main() {
int n;
cin >> n;
vector<Customer> customers(n);
for (int i = 0; i < n; i++) {
cin >> customers[i].name >> customers[i].priority;
}
sort(customers.begin(), customers.end(), compare);
for (auto& customer : customers) {
cout << customer.name << " ";
}
cout << endl;
return 0;
}
def customer_support_queue(n, customers):
customers.sort(key=lambda x: x[1], reverse=True) # Sort by priority (descending)
for customer in customers:
print(customer[0], end=" ")
print()
n = int(input())
customers = [input().split() for _ in range(n)]
customers = [(customer[0], int(customer[1])) for customer in customers]
customer_support_queue(n, customers)
import java.util.*;
public class Main {
static class Customer {
String name;
int priority;
Customer(String name, int priority) {
this.name = name;
this.priority = priority;
}
}
public static void customerSupportQueue(List<Customer> customers) {
customers.sort((a, b) -> Integer.compare(b.priority, a.priority));
for (Customer customer : customers) {
System.out.print(customer.name + " ");
}
System.out.println();
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
scanner.nextLine(); // consume newline
List<Customer> customers = new ArrayList<>();
for (int i = 0; i < n; i++) {
String name = scanner.next();
int priority = scanner.nextInt();
customers.add(new Customer(name, priority));
}
customerSupportQueue(customers);
}
}
The program prioritizes the customers based on their priority level so that they can be given priority in handling. It sorts the list of customers based on priority by using a custom comparator and prints the names accordingly. This leads to effective handling of customer requests.
You need to schedule the delivery of multiple packages with varying delivery times. You can only deliver one package at a time, but want to minimize the time spent providing all packages. Given the delivery times of packages, find the optimal order to deliver them.
Input:
4
3
2
1
5
Output:
1 2 3 5
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> times(n);
for (int i = 0; i < n; i++) {
cin >> times[i];
}
sort(times.begin(), times.end());
for (int time : times) {
cout << time << " ";
}
cout << endl;
return 0;
}
def optimal_package_delivery(n, times):
times.sort() # Sort the delivery times in ascending order
for time in times:
print(time, end=" ")
print()
n = int(input())
times = [int(input()) for _ in range(n)]
optimal_package_delivery(n, times)
import java.util.*;
public class Main {
public static void optimalPackageDelivery(List<Integer> times) {
Collections.sort(times);
for (int time : times) {
System.out.print(time + " ");
}
System.out.println();
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
List<Integer> times = new ArrayList<>();
for (int i = 0; i < n; i++) {
times.add(scanner.nextInt());
}
optimalPackageDelivery(times);
}
}
This program finds the most efficient delivery order by sorting the delivery times in ascending order. By delivering packages with shorter times first, it minimizes the total time spent. The sorted package delivery times are then outputted as the optimal sequence for delivering all packages.
You are managing tasks for a team. Each task has a deadline, and you want to maximize the number of tasks completed before their deadline. You can only work on one task at a time. Determine the maximum number of tasks you can complete within the given deadlines.
Input:
5
4 3
2 2
4 2
2 1
1 4
Output:
2
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Task {
int deadline, duration;
};
bool compare(Task a, Task b) {
return a.deadline < b.deadline;
}
int main() {
int n;
cin >> n;
vector<Task> tasks(n);
for (int i = 0; i < n; i++) {
cin >> tasks[i].deadline >> tasks[i].duration;
}
sort(tasks.begin(), tasks.end(), compare);
int count = 0, current_time = 0;
for (auto& task : tasks) {
if (current_time + task.duration <= task.deadline) {
count++;
current_time += task.duration;
}
}
cout << count << endl;
return 0;
}
def task_deadline_management(n, tasks):
tasks.sort(key=lambda x: x[0]) # Sort tasks by their deadline
count = 0
current_time = 0
for task in tasks:
if current_time + task[1] <= task[0]:
count += 1
current_time += task[1]
print(count)
n = int(input())
tasks = [tuple(map(int, input().split())) for _ in range(n)]
task_deadline_management(n, tasks)
import java.util.*;
public class Main {
static class Task {
int deadline, duration;
Task(int deadline, int duration) {
this.deadline = deadline;
this.duration = duration;
}
}
public static void taskDeadlineManagement(List<Task> tasks) {
tasks.sort(Comparator.comparingInt(a -> a.deadline));
int count = 0, currentTime = 0;
for (Task task : tasks) {
if (currentTime + task.duration <= task.deadline) {
count++;
currentTime += task.duration;
}
}
System.out.println(count);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
List<Task> tasks = new ArrayList<>();
for (int i = 0; i < n; i++) {
int deadline = scanner.nextInt();
int duration = scanner.nextInt();
tasks.add(new Task(deadline, duration));
}
taskDeadlineManagement(tasks);
}
}
The program sorts tasks based on their deadlines and selects tasks that can be completed within the available time frame. It counts the maximum number of tasks that can be completed by iterating through sorted tasks and checks if the task can fit within its deadline.
A company assigns shifts to employees. Given the start and end times of employee shifts, you must determine how many employees work at a given time. Output the maximum number of employees working simultaneously.
Input:
3
9 12
11 14
13 16
Output:
2
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> shifts(n);
for (int i = 0; i < n; i++) {
cin >> shifts[i].first >> shifts[i].second;
}
vector<int> times;
for (auto& shift : shifts) {
times.push_back(shift.first);
times.push_back(shift.second);
}
sort(times.begin(), times.end());
int max_count = 0, current_count = 0;
for (int i = 0; i < times.size(); i++) {
current_count++;
max_count = max(max_count, current_count);
}
cout << max_count << endl;
return 0;
}
def employee_work_shifts(n, shifts):
times = []
for shift in shifts:
times.append(shift[0])
times.append(shift[1])
times.sort()
max_count = 0
current_count = 0
for time in times:
current_count += 1
max_count = max(max_count, current_count)
print(max_count)
n = int(input())
shifts = [tuple(map(int, input().split())) for _ in range(n)]
employee_work_shifts(n, shifts)
import java.util.*;
public class Main {
public static void employeeWorkShifts(List<int[]> shifts) {
List<Integer> times = new ArrayList<>();
for (int[] shift : shifts) {
times.add(shift[0]);
times.add(shift[1]);
}
Collections.sort(times);
int maxCount = 0, currentCount = 0;
for (int time : times) {
currentCount++;
maxCount = Math.max(maxCount, currentCount);
}
System.out.println(maxCount);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
List<int[]> shifts = new ArrayList<>();
for (int i = 0; i < n; i++) {
int start = scanner.nextInt();
int end = scanner.nextInt();
shifts.add(new int[]{start, end});
}
employeeWorkShifts(shifts);
}
}
The program computes the total maximum number of employees present at a given time by sorting all of the start and end shift times. It also verifies the number of shifts taken at the same time at any instant by iterating through the sorted times and tabulating the maximum number of workers available at any instant.
Here are a few practical tips for KPIT coding questions:
In conclusion, KPIT Technologies is a world-renowned global leader in the tech consulting industry, and coding skills are a fundamental part of its recruitment process. Good coding skills never fail to bring a candidate to class. They are also indicative of the deployment of problem-solving mindsets that enable one to deal well with KPIT. By practicing the best coding questions, mastering core algorithms, and following handy tips about coding assessments, a candidate can finally try their luck on KPIT written tests in 2025.
Coding tests usually include data structures, algorithms, problem-solving, and system design questions such as sorting algorithms, dynamic programming, and graphs-related problems.
Practice coding problems, study algorithms, and build a solid foundation on basic concepts. Have good problem-solving skills and partake in mock interviews to enhance speed and accuracy.
Generally, KPIT conducts 3-4 rounds of interviews: an online test, a technical interview, HR interview, and sometimes, a group discussion.
Companies like Google, Microsoft, and Amazon have the most difficult coding interview questions, as they usually focus on problem-solving and optimization.
Source: NxtWave - CCBP Blog
Original URL: https://www.ccbp.in/blog/articles/kpit-coding-questions