FastPrepTop-Funded Villages and Projects
Problems/Top-Funded Villages and Projects

Top-Funded Villages and Projects

Adobe logoAdobe● MediumFULLTIMENEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Adobe online assessment for full-time and new-grad roles. The report asks for a two-level funding analysis for 2024, with ties. It leaves out the table layouts, what to do with zero funding, and the order of the results. Our version is about 90% the same as the reported question.

You are given three finite relations encoded as string matrices:

  • Each villages row is [villageId, villageName].
  • Each projects row is [projectId, villageId, projectName].
  • Each funds row is [projectId, date, amount], where date uses YYYY-MM-DD format and amount is a nonnegative decimal integer.

Only funding rows whose date is in calendar year 2024 contribute. A project's funding is the sum of its contributing rows, and a project with no contributing row has funding 0. A village's total funding is the sum of the funding for all of its listed projects.

Consider every village that has at least one listed project. Keep every village tied for the maximum total funding. Within each selected village, keep every project tied for that village's maximum project funding.

Return one row [villageName, projectName, projectFunding] for every retained project. Encode projectFunding as a base-10 string. Sort the rows by village name, then project name, then village ID, then project ID, all in ascending lexicographic order. Return an empty matrix when there are no villages or no projects.

Function

topFundedVillageProjects(villages: String[][], projects: String[][], funds: String[][]) → String[][]

Examples

Example 1

villages = [["v1","Maple"],["v2","River"],["v3","Hill"]]projects = [["p1","v1","Clinic"],["p2","v1","Library"],["p3","v2","Bridge"],["p4","v2","School"],["p5","v3","Well"]]funds = [["p1","2024-01-10","50"],["p2","2024-05-20","50"],["p3","2024-02-01","60"],["p3","2024-12-15","40"],["p4","2023-08-01","200"],["p5","2024-04-12","80"]]return = [["Maple","Clinic","50"],["Maple","Library","50"],["River","Bridge","100"]]

Maple and River each receive a village total of 100, so both survive the first tie. Maple's two projects tie at 50; River's Bridge project has 100 while School has 0. Hill's total of 80 is not maximal.

Example 2

villages = [["v2","Beta"],["v1","Alpha"]]projects = [["p2","v2","Orchard"],["p1","v1","Garden"]]funds = [["p1","2023-12-31","90"],["p2","2025-01-01","90"]]return = [["Alpha","Garden","0"],["Beta","Orchard","0"]]

Neither funding row belongs to 2024. Both village totals and both project totals are therefore 0, so both tie levels retain every listed project. Village-name ordering places Alpha first.

Example 3

villages = []projects = []funds = []return = []

There is no village-project pair to rank, so the result is empty.

Constraints

  • 0 <= villages.length, projects.length, funds.length <= 100000.
  • Village IDs are unique, project IDs are unique, and every project and funding row references an existing ID.
  • IDs and names contain between 1 and 100 printable ASCII characters.
  • Every date is a valid Gregorian date in YYYY-MM-DD format.
  • 0 <= amount <= 10^9, and every project and village sum fits in a signed 64-bit integer.

More Adobe Online Assessment questions

  • Base Unit ConversionsOA · Seen Nov 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
  • Count Parent Nodes With a Target SumOA · Seen Aug 2026
  • Largest Binary Number by ConcatenationOA · Seen Aug 2026
  • Count Events by CategoryOA · Seen Aug 2026
  • Graph M-ColoringOA · Seen Aug 2026
  • Hall of Shifting TilesOA · Seen Aug 2026
  • K-th Ancestor Subtree Preorder QueryOA · Seen Aug 2026
  • Maze ReachabilityOA · Seen Aug 2026
  • Minimum Numeric Code TransformationOA · Seen Aug 2026

Similar questions at other companies

  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Subscription and Usage-Based Billing CalculatorStripe · OA
  • Count Servers With No Requests in a Time WindowIBM · OA
  • Maximum Escape Game ScoreMicrosoft · OA
  • Build Sessions from Unordered Events (Part 1)Scale AI · OA
  • Minimum Distinct Prefix CostChubb · OA
  • Decode Words with Anagram KeysCresta · OA
  • Count Redundant File BackupsGoldman Sachs · OA
  • Top Mutual-Friend RecommendationsVisa · OA
  • Top Mutual-Friend RecommendationsSuperhuman · OA
See Adobe hiring insights
Saved
class Solution {
    public String[][] topFundedVillageProjects(String[][] villages, String[][] projects, String[][] funds) {
        // Write your code here.
    }
}
Checking account…