Skip to content

Adani Coding Questions - DSA Problems & Solutions

Practice Adani placement paper coding questions with detailed solutions. Access Adani OA coding problems in C++, Java, Python.

This page contains Adani coding questions from Adani OA placement papers with detailed solutions.

Adani OA Coding Section:

  • Problems: 2-3 coding problems
  • Time: 90 minutes
  • Languages: C++, Java, Python

Question 1: Infrastructure Resource Allocation

Section titled “Question 1: Infrastructure Resource Allocation”
Q1: Allocate resources optimally across infrastructure projects.

Solution (Java):

public Map<String, Integer> allocateResources(
List<Project> projects, int totalResources) {
// Sort projects by priority
projects.sort((a, b) -> Integer.compare(b.priority, a.priority));
Map<String, Integer> allocation = new HashMap<>();
int remaining = totalResources;
for (Project project : projects) {
int allocated = Math.min(project.requiredResources, remaining);
allocation.put(project.id, allocated);
remaining -= allocated;
if (remaining <= 0) break;
}
return allocation;
}

Time Complexity: O(n log n)


Practice Adani coding questions regularly!