Amazon SDE OA | amazon OA代写 |亚麻Online Assessment代写 | 亚马逊面试作弊

Let’s take a look at the recent online exams on Amazon SDE together,If you need amazon OA代写(OA Ghostwriting).

Question 1

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences.

Note:The same word in the dictionary may be reused multiple times in the segmentation. You may assume the dictionary does not contain duplicate words.

Example 1:

Input: s = "catsanddog" wordDict = ["cat", "cats", "and", "sand", "dog"] Output: [ "cats and dog", "cat sand dog" ] 

Example 2:

Input: s = "pineapplepenapple" wordDict = ["apple", "pen", "applepen", "pine", "pineapple"] Output: [ "pine apple pen apple", "pineapple pen apple", "pine applepen apple" ] 

Explanation: Note that you are allowed to reuse a dictionary word.

Example 3:

Input: s = "catsandog" wordDict = ["cats", "dog", "sand", "and", "cat"] Output: []

Answer:

Java Code Answer
import java.util.*;

public class Code {
  public static void main(String[] args) {
	String s = "catsanddog";
    List<String> wordDict = new ArrayList<>();
    wordDict.add("cat");
    wordDict.add("cats");
    wordDict.add("and");
    wordDict.add("sand");
    wordDict.add("dog");
    
  	List<String> res = breakWord(s.length(), s, wordDict, new ArrayList<String>(), new ArrayList<String>());
  	System.out.println(res.size());
    for(String ss: res) {
    	System.out.println(ss);
  	}
  }
  
  public static List<String> breakWord(int n, String sc, List<String> wordDict, List<String> sb, List<String> res) {
        if(String.join("", sb).length() == n) res.add(String.join(", ", sb));
        
        for(String w: wordDict) {
            if(sc.indexOf(w) == 0) {
	            System.out.println(w);
                sb.add(w);
                breakWord(n, sc.substring(w.length()), wordDict, sb, res);
                sb.remove(sb.size()-1);
                    
            }
        }
        return res;
    }
}

Question 2

Given an array containing n numbers. The problem is to find the length of the longest contiguous subarray such that every element in the subarray is strictly greater than its previous element in the same subarray. Time Complexity should be O(n).

Examples:

Input : arr1[] = {5, 6, 3, 5, 7, 8, 9, 1, 2} Output : 5 The subarray is {3, 5, 7, 8, 9}
Input : arr2[] = {12, 13, 1, 5, 4, 7, 8, 10, 10, 11} Output : 4 The subarray is {4, 7, 8, 10}

Answer:

Java Code Answer
public class Code {
  public static void main(String[] args) {
    int[] inp = new int[]{12, 13, 1, 5, 4, 7, 8, 10, 10, 11}, res = new int[]{0, 0};
    int start = 0, i = 1, length = 1, max = Integer.MIN_VALUE;
    
    while(i < inp.length) {
      if(inp[i] > inp[i - 1]) {
        length++;
      } else {
        if(length > max) {
          max = length;
          res[0] = start;
          res[1] = i - 1;
        }
          length = 1;
          start = i;
      }
      i++;
    }
    
    System.out.println(res[0] + ", " + res[1]);
    System.out.println(max);
  }
}

经过我们的强力面试辅助,OA代写,候选人通过这些面试题的解析和沟通,面试官不仅了解了候选人的编程能力,也看到了我在解决问题过程中清晰的思路和有效的沟通技巧。这些不仅有助于应对 Meta 的面试,同时也能提升我们解决实际编程问题的能力。祝大家面试顺利!

Through our strong interview assistance and OA ghostwriting, the candidate not only understood their programming skills but also saw my clear thinking and effective communication skills in problem-solving through the analysis and communication of these interview questions. These not only help us cope with Meta interviews, but also enhance our ability to solve practical programming problems. Wishing everyone a smooth interview!

如果你也需要我们的面试辅助服务,请立即联系我们

If you also need our interview assistance services, please contact us immediately.

author avatar
azn7u2@163.com

Leave a Reply

Your email address will not be published. Required fields are marked *