SAMSUNG R&D Noida | On-site OA | April 2025

Location
Noida
Posted
12 Apr 2025
331 reads

Summary

I encountered a coding problem during my Samsung R&D On-site Online Assessment in April 2025 involving medicine bottle delivery optimization.

How it went

Given N medicine bottles and M containers and each container has capacity to carry W[i] bottles. The delivery van can take two containers (only one can also be loaded) to nearby hospital in single trip. Containers can be reused. Find number of trips to deliver minimum N bottles. If not possible, print -1

Contraints 1 <= N,M,W[i] <= 1000 W.length == M

N = 5, M = 2 W[] = {1, 3} Output = 2

N = 6, M = 2 W[] = {4, 5} Output = -1

N = 720, M = 5 W[] = {27, 52, 119, 144, 124} Output = 5

I tried using 2d/3d DP but got TLE.

Questions asked (1)

  1. 01

    Minimum Trips to Deliver Medicine Bottles

    Data Structures & Algorithms

    Given N medicine bottles and M containers and each container has capacity to carry W[i] bottles. The delivery van can take two containers (only one can also be loaded) to nearby hospital in single trip. Containers can be reused. Find number of trips to deliver minimum N bottles. If not possible, print -1

    Contraints 1 <= N,M,W[i] <= 1000 W.length == M

    N = 5, M = 2 W[] = {1, 3} Output = 2

    N = 6, M = 2 W[] = {4, 5} Output = -1

    N = 720, M = 5 W[] = {27, 52, 119, 144, 124} Output = 5

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Samsung recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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