Infosys OA experience (On Campus)

infosys logo
infosys
August 20, 2026 · 1 reads

Summary

I completed the Infosys on‑campus online assessment, which lasted 3 hours, included four questions, and required solving three to move to the next round.

Full Experience

Time duration:3hrs total 4questions must solve 3 questions to enter next round

I remember only three questions from the process: Screenshot 2026-08-20 211629.png

Screenshot 2026-08-20 211611.png Screenshot 2026-08-20 211540.png

one more question is: you are given no.of items n cost of n elements cost[i] type of the items type[i] there are two type 0 and 1 we are given a BUDGET B and we need to select max no.of items we could select an item atmost once but if you choose even one type 1 item

you should pay for reusable cooler bag cost C only once you pay C i mean if you take two type1 only one time C is cut finally output needs to be total no.of items that can be selected constraints are large

Screenshot 2026-08-20 215707.png

Interview Questions (1)

1.

Maximize Items Selection with Reusable Cooler Bag Cost

Data Structures & Algorithms

You are given:

  • An integer n, the number of items.
  • An array cost[0…n‑1] where cost[i] is the price of the i‑th item.
  • An array type[0…n‑1] where each type[i] is either 0 or 1.
  • An integer B, the total budget available.
  • An integer C, the cost of a reusable cooler bag.

You may select each item at most once. If you select at least one item of type 1, you must pay the cooler‑bag cost C exactly once (regardless of how many type 1 items you take). The goal is to maximize the total number of selected items while staying within the total budget B (including the optional cooler‑bag cost). Output the maximum possible number of items.

Constraints are large, requiring an efficient algorithm.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!