Notifications
 

Interview Questions in Amazon for Interns

 
 

Interview Questions in Amazon for interns

Amazon also hires people through the internship channel. Last year it visited IITs and other premier B.Tech College. See the interview questions asked in Amazon. Difficulty level is almost same as SDE-1 , Problem solving skills and coding skills were the two main observations:

Q1. For a given source string str, remove all the characters as mentioned in function remove. Eg. If str contains “abcfbgji” and remove contains “bg”, then this function should result in: “acfji”

Q2. length of Longest Substring Without Repeating Characters. For e.g. for “abcabcbb” is “abc”, which the length is 3. For “bbbbb” the longest substring is “b”, with the length of 1 


Q3.  Write program to find a loop in linked list.

Q4. Write a simple Java program to convert number to words. You can Download the  sample Java program given below and save it as Dtowords.java 

Compile and run it

** Java Program to convert Number to words **

import java.io.*;

class Dtowords

  {

    static String str1[]=new String [10];

    static String str2[]=new String [10];

    static String str3[]=new String [10];

    String str,st;

static

{  

        str1[0]="ZERO"; str1[1]="ONE";

     str1[2]="TWO"; str1[3]="THREE";

     str1[4]="FOUR";str1[5]="FIVE";

     str1[6]="SIX"; str1[7]="SEVEN";

     str1[8]="EIGHT";str1[9]="NINE";

        str2[0]="TEN";str2[1]="ELEVEN";

     str2[2]="TWELVE";str2[3]="THIRTEEN";

     str2[4]="FOURTEEN";str2[5]="FIFTEEN";

     str2[6]="SIXTEEN";str2[7]="SEVENTEEN";

     str2[8]="EIGHTEEN";str2[9]="NINETEEN";

        str3[0]="";str3[1]="";

     str3[2]="TWENTY";str3[3]="THIRTY";

     str3[4]="FORTY";str3[5]="FIFTY";

     str3[6]="SIXTY";str3[7]="SEVENTY";

     str3[8]="EIGHTY";str3[9]="NINETY";

}

  public static String cal(String str)

     {

    String result,dig,dig1;

    result="";

    int n,l,j,rem;

    l=str.length();

if(str.charAt(0)=='0')

 {

 str=str.substring(1,l);

 }

n=Integer.parseInt(str);

    l=str.length();

if(l==1)

  result=str1[n];

if(l==2)

 {

  rem=n%10;

  j=n/10;

  if(str.charAt(0)=='1')

   result=str2[rem];

  else

     {  

   if(rem!=0)

     result=str3[j]+"  "+str1[rem];

     else result=str3[j];

     }

   }   

if(l==3)

   {

    dig=cal(str.substring(1,3));

    if(str.charAt(2)=='0')

    result=str1[n/100]+" HUNDRED ";

    else

    result=str1[n/100]+" HUNDRED "+" AND "+dig;

   }

if(l==4)

   {

   dig=cal(str.substring(2,4));

   result= str1[n/1000]+" THOUSAND "+cal(str.substring(1,4));

 }

 

if(l==5)

   {

  dig=cal(str.substring(0,2));

 result= dig+" THOUSAND "+cal(str.substring(2,5));

   }  

if(l==6)

  {

   dig=cal(str.substring(1,3));

  dig1=cal(str.substring(4,6));

   //result=str1[n/100000]+" LAKH "+dig+" THOUSAND "+str1[(n%1000)/100]+" HUNDRED "+dig1;

   result=str1[n/100000]+" LAKH "+cal(str.substring(1,6));

  }

if(l==7)

  {

   result=cal(str.substring(0,2))+" LAKH "+cal(str.substring(2,7));

  }

if(l==8)

  {

    result=cal(str.substring(0,1))+" CRORE "+cal(str.substring(1,8));

  }

if(l==9)

  {

     result=cal(str.substring(0,2))+" CRORE "+cal(str.substring(2,9));

   }

return result;

     }

 

public static void main(String args[])

  throws IOException

   {

  String num,w;

  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

    System.out.println("enter the number");

    num=br.readLine();

   w=cal(num);

 System.out.println(w);

 }

}

 

Q5.  Which sorting method is more effective for huge date set like we have it in e-commerce website

Q6. Are you familiar with any platform for e-commerce

Q7. How do you convert time of order placed based on the location from where the person is browsing the website. The order should not have the server time. It should have the local time based on the geographic location of the person.

Q8. How can you embed a video in a website and allow the users to upload in even low bandwidth.

Q9.  Write a Java program to count the number of characters, words and lines in a file

Q10. Write a java program to copy a source file to another.

by specifying the name of the source file and the destination file. For example, to copy a file called FIRST.TXT to a file called SECOND.TXT, use the following command line:

 java CopyFile FIRST.TXT SECOND.TXT

All the best for your interview.  You can join the discussion forum by commenting in this blog. We have the Java programs for the last two questions. Mention your email id in the blog. We will send you the answers.

Join us on FB and linkedin to interact with Amazon Employees: JobLagao on Facebook JobLagao on LinkedIN  |JobLagao on Twitter

 
About the Author:
 
 
 

Connect with us

Like us on Facebook  

 
 
Comment using your Joblagao account
 
Close

Leave a comment

 
or comment with facebook account