Posts

Showing posts from May, 2022

Bajaj Finserv Coding Questions

  Introduction Bajaj Finserv Limited is an Indian non-banking financial services company headquartered in Pune. It is focused on lending, asset management, wealth management and insurance. This article will discuss some of the most important bajaj finserv coding questions that are asked in the Bajaj Finserv recruitment process.  Question 1 Let's have a look at the first coding question for Bajaj Finserv. We will discuss the problem statement and then its solution. Problem Statement Write a program that checks whether there are two entries in the array A[] whose total is exactly x, given an array A[] of n numbers and another number x. TestCases Below are some of the example test cases shown to explain the problem: Example 1 Input:  arr[] = {0, -1, 2, -3, 1} x= -2 Output:  YES Example 2 Input:  arr[] = {1, -2, 1, 0, 5} x = 0 Output:  NO Solution Using the two-pointer technique to solve this problem can be difficult. However, the array must be sorted before employing two-pointer appr

Triplet Sum In An Array

  Introduction Triplet Sum is a common interview question asked in many companies like Accolite, Amazon, OYO rooms, Samsung, Microsoft. Triplet Sum is an extension of Two Sum Problem based on Binary Search. Problem Statement Given an array of integers, write a program to find the distinct triplets which sum up to a given value ‘K’. Example Input: 10 5 5 5 2 12 Output: 5 5 2 Explanation: 5 5 2 is the only triplet to form sum equal to 12 Input: 1 2 3 1 2 3 6 Output: 1 2 3 Explanation: 1 2 3 is the only unique triplet to form sum equal to 6 Let us now discuss the approaches for the Triplet sum in array .  Approach: 1 The first approach for the Triplet Sum problem is as follows. Find all the triplets of the array and count all the triplets that give sum=k. Three nested loops for three different indexes to check the values at those indexes sum up to ‘K’. Make a set to keep track of the visited triplets. If the triplet is not found in thes set then print the triplet else continue. Code: // P

HackWithInfy

  HackWithInfy is an Indian coding competition for engineering students graduating in 2023, 2024, and 2025. The curriculum is specifically designed to instill a culture of rapid problem-solving and imaginative thinking early in academic life. HackWithInfy is the ideal platform for kids to explore their interest in programming while also giving them the chance to compete for attractive rewards. Top performers will have the opportunity to work for Infosys. HackWithInfy consists of two rounds, the first of which is an individual online test and the second of which is a Grand Finale. This year, Hack With Infy is available to final-year engineering students and second and third-year engineering students in India who want to prove their worth and win INR3.5 lakhs in cash awards. Prizes: Prize money of INR 200000, INR 100000, and INR 50000 will be awarded to the top achievers. Infosys offers pre-placement interviews for niche technical roles. Opportunity to serve as a Campus Ambassador Paid