Related Coding / DSA
Currency Conversion from Exchange Rates
Given a list of direct exchange rates, find the conversion rate between any two currencies, including pairs that have no direct rate.
Given a list of integers, find the maximum sum you can obtain by choosing elements such that no two chosen elements are adjacent in the list. You may choose no elements, so the answer is 0 for an empty list or when every choice would reduce the sum.
Given a list of integers, return the maximum sum you can obtain by selecting elements such that no two selected elements are adjacent. You may choose no elements, so return 0 for an empty list or when every value is negative. The list has at most 100000 elements, and each value is between -10000 and 10000 inclusive. Start with any clarifying questions.
Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.
Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.
Continue to DashboardHidden because they name the technique, which a real interviewer would not tell you.
Continue preparing
Related Coding / DSA
Given a list of direct exchange rates, find the conversion rate between any two currencies, including pairs that have no direct rate.
Related Coding / DSA
Given the root of a binary tree, determine whether it is a valid binary search tree.
Related Coding / DSA
Given one-way routes between cities each with a cost, find the cheapest total cost from a source city to a destination city using at most k intermediate stops.
Related Coding / DSA
Given a set of coin denominations and a target amount, find the minimum number of coins (with unlimited supply of each denomination) needed to make exactly that amount, or report it is impossible.