Microsoft Online Assessment Question | Dynamic Programming

microsoft logo
microsoft
Offer
August 25, 202522 reads

Summary

I recently faced a dynamic programming problem during my Microsoft online assessment. The problem involved selecting articles to maximize intellectual value while respecting a page limit. It was a variation of the knapsack problem, which I solved using dynamic programming.

Full Experience

I was preparing for my Microsoft online assessment when I encountered this dynamic programming question. The problem required me to select a subset of articles to maximize the total intellectual value without exceeding the page limit. I approached it by considering the knapsack problem variation, where each article has a weight (pages) and value (intellectual value). I used a dynamic programming approach to keep track of the maximum value achievable for each possible page count.

Interview Questions (1)

Q1
Maximize Intellectual Value with Page Limit
Data Structures & AlgorithmsHard

You are given a set of articles, where each article i requires 2 * A[i] pages to be read completely and provides an intellectual value of I[i]. You can read at most p pages in total, and your task is to select a subset of articles such that the total number of pages read does not exceed p, while maximizing the total intellectual value gained.

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!