Amazon 2024 Papers
Previous year papers with coding questions
Practice Amazon placement paper coding questions with detailed solutions. Access Amazon OA coding problems in Java, C++, Python.
This page contains Amazon coding questions from Amazon OA placement papers with detailed solutions.
Amazon OA Coding Section:
Solution (Java):
public int[] twoSum(int[] nums, int target) { Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < nums.length; i++) { int complement = target - nums[i]; if (map.containsKey(complement)) { return new int[]{map.get(complement), i}; } map.put(nums[i], i); } return new int[]{};}Time Complexity: O(n)
Solution (Java):
public int lengthOfLongestSubstring(String s) { Map<Character, Integer> map = new HashMap<>(); int maxLen = 0; int left = 0;
for (int right = 0; right < s.length(); right++) { char c = s.charAt(right); if (map.containsKey(c) && map.get(c) >= left) { left = map.get(c) + 1; } map.put(c, right); maxLen = Math.max(maxLen, right - left + 1); }
return maxLen;}Time Complexity: O(n)
Amazon 2024 Papers
Previous year papers with coding questions
Amazon Technical Questions
Technical questions with solutions
Amazon Main Page
Complete Amazon placement guide
Practice Amazon coding questions regularly!