Infosys Hackwithinfy Coding Questions download Beautiful function HackWithInfy

Hackwithinfy Coding Questions | HackWithInfy Previous Year Placement Papers | Infosys Specialist Programmer coding questions hackerearth

Hackwithinfy Coding Questions: Hackwithinfy is an India-wide coding competition for engineering students graduating in 2022. Top performers are also given the opportunity to work with Infosys. Infosys launched HackWithInfy in 2018 in order to find the top coders in the country. This application has a high level of difficulty, but the prize is also incredibly pleasant. This page contains all of the HackWithInfy sample prior coding questions that have been asked in each of the three rounds since 2018. In addition to the previous year’s questions, HackWithInfy has example and sample questions for practise.

Notification Details
RecruiterInfosys HackWithInfy
Join our Telegram

Preparation for HackWithInfy Coding Competition

 HackWithInfy Previous Year Placement Papers, syllabus & pattern

Hack With Infy interview questions & experience

The 48-hour hackathon between teams and the Infosys Meridian Grand Finale. In July 2021, the top 100 competitors from Round 1 will compete in a four day virtual grand finals. Finalists will also be invited to a pre-placement interview at Infosys for the position of Power Programmer. Stay connected with our Naukrimessenger website to get more details regarding upcoming exam notification, Merit List, selection list, cut off list, old question papers, allotment, admit card, syllabus, answer key, rank list, result, etc.

Infosys HackWithInfy Registration

HackWithInfy Coding Topics

The topics which you must be clear with are:

  •     Dynamic Programming
  •     Greedy Algorithms
  •     Backtracking
  •     Stack
  •     Queue
  •     Mapping Concepts
  •     Array manipulation
  •     String manipulation
  •     Tree
  •     Graph
  •     Bit Mapping and Hashing
  •     Recursion and Heap
  •     Divide and Conquer

HackWithInfy Coding Topics Questions

Question1: Surya has N dishes of different types arranged in a row: A1,A2,…,AN where Ai denotes the type of the ith dish. He wants to choose as many dishes as possible from the given list but while satisfying two conditions:

He can choose only one type of dish.

No two chosen dishes should be adjacent to each other.

Surya wants to know which type of dish he should choose from, so that he can pick the maximum number of dishes.

Example :

Given N= 9 and A= [1,2,2,1,2,1,1,1,1]

For type 1, Surya can choose at most four dishes. One of the ways to choose four dishes of type 1 is A1,A4, A7 and A9.

For type 2, Surya can choose at most two dishes. One way is to choose A3 and A5.

So in this case, Surya should go for type 1, in which he can pick more dishes.

Question 2: There are three piles of Pebbles. The first pile contains a Pebbles, the second pile contains b Pebbles and the third pile contains c Pebbles. You must choose one of the piles and split the Pebbles from it to the other two piles; specifically, if the chosen pile initially contained s Pebbles, you should choose an integer k (0≤k≤s), move k Pebbles from the chosen pile onto one of the remaining two piles and s−k Pebbles onto the other remaining pile. Determine if it is possible for the two remaining piles (in any order) to contain x Pebbles and y Pebbles respectively after performing this action.

Question 3: Malik has recently learned about number bases and is becoming fascinated.

Malik learned that for bases greater than ten, new digit symbols need to be introduced, and that the convention is to use the first few letters of the English alphabet. For example, in base 16, the digits are 0123456789ABCDEF. Malik thought that this is unsustainable; the English alphabet only has 26 letters, so this scheme can only work up to base 36. But this is no problem for Malik, because Malik is very creative and can just invent new digit symbols when she needs them. (Malik is very creative.)

Malik also noticed that in base two, all positive integers start with the digit 1! However, this is the only base where this is true. So naturally, Malik wonders: Given some integer N, how many bases b are there such that the base-b representation of N starts with a 1?

Hackwithinfy Coding Questions | Beautiful Function

Question 1: Let’s define a Beautiful Function F(x) in such a way: Add 1 to the value of x, if the result of addition contains any trailing zeros then remove them all.

F(11)= F(12)

F(19) = 2(20-> 2)

F(99)= 1 (100-> 10 -> 1)

Let’s define a number to be reachable from x, if we can apply the Beautiful Function some number of times (possibly zero) to x and get that numbers as result.

Eg: 102 is reachable from 10099 as F (F(10099))) = F (101) = 102

You are given a number N. Calculate how many numbers are reachable from N.

Questions 2: There is a unique ATM in wonderland. Imagine this ATM is an array of numbers. You can withdraw cash only from either ends of the array. Shloka wants to withdraw x amount of cash from the ATM.

What are the minimum number of withdrawals Shloka would need to accumulate x amount of cash. If it is not for possible for Shloka to withdraw x amount, return -1.

Infosys HackWithInfy Interview Questions

  •     Explain About Your projects
  •     What are the requirements of your projects
  •     Explain about KNN(as I have mentioned Machine Learning in my resume)
  •     What do you know about java?
  •     How do you sort a linked list (Not By Swapping their values)
  •     Prime Number Program with low time complexity
  •     Explain about Incremental Model(Software Engineering)
  •     Explain about the Software Development Life Cycle?
  •     Why do you want to join Infosys?
Important Details

Leave a Comment