Amazon Web Services (AWS) - Interview Questions and Answers for 'Lambda' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Interview Questions


 3332 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Amazon Web Services (AWS) - Interview Questions and Answers for 'Lambda' - 36 question(s) found - Order By Newest

  Q1. What is a Lambda Expression ? What's its use ?Core Java
Admin
info@buggybread.com
Ans. Its an anonymous method without any declaration.

Lambda Expression are useful to write shorthand Code and hence saves the effort of writing lengthy Code.

It promotes Developer productivity, Better Readable and Reliable code.

  Sample Code for lambda

 Help us improve. Please let us know the company, where you were asked this question :   


   Like         Discuss         Correct / Improve     java   java8   lambda expression   architecture     Asked in 57 Companies      expert        frequent

Try 1 Question(s) Test


Not frequently asked as it was introduced with Java 8.
 Q2. Difference between final and effectively final ? Why is effectively final even required ?Core Java
Admin
info@buggybread.com
Ans. Final variable means a variable that has been declared final and hence cannot be de referenced after initialization. Effective final means a variable that has not been declared final but haven't been reassigned the value after initialization.

First is the regulation that restricts the reassignment and will raise a compilation error if we try to do so. Second is the outcome without the restriction.

Effective Final is the eventual treatment of the variable that is required for many features. For eq - Java 8 requires that local variables referenced from a lambda expression must be final or effectively final.It means all local referenced from lambda expressions must be such that their value shouldn't be changed after initialization whether declared final or not.

 Help us improve. Please let us know the company, where you were asked this question :   


   Like         Discuss         Correct / Improve     java   java8   java 8   final   effective final   final vs effective final   lambda expressions      expert

Try 2 Question(s) Test


 Q3. Difference between Predicate, Supplier and Consumer ? Core Java
Admin
info@buggybread.com
Ans. Predicate represents an anonymous function that accepts one argument and produces a result.

Supplier represents an anonymous function that accepts no argument and produces a result.

Consumer represents an anonymous function that accepts an argument and produces no result.

  Sample Code for Predicate

  Sample Code for Supplier

  Sample Code for Consumer

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   java8   predicate   consumer   supplier   lambda expression      expert


 Q4. What are the problems one could face while working with serverless technologies like AWS Lambda ?Amazon Web Services (AWS)2018-01-30 18:05:47

Ans. Warm up time for certain technologies like Java ( JVM Warmup )

Performance

Size of Deployable ( Bigger size packaging should go in S3 )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     serverless technologies  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda     Asked in 1 Companies


 Q5. What would you do if you see an error thrown by a lambda function as "Access Denied" while doing something with S3 ?Amazon Web Services (AWS)2018-10-26 11:34:47

Ans. Just like people , AWS resources too have execution roles or permissions. Seems like in such a situation Lambda function may not have sufficient privileges to perform operations on S3. For example - The execution role of Lambda may just have read permissions on S3 and we may be trying to perform PutObject operation.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws s3  aws storage  amazon cloud storage  amazon s3  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q6. What are the advantages and disadvantages of using Lambda over EC2 ?Amazon Web Services (AWS)2019-01-24 07:04:29

Ans. Advantages -

Much Cheaper
Continuous scaling
Higher level and Serverless

Disadvantages -

Warm up time
Limited flexibility in terms of technologies
Limited control

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda  aws ec2  aws computing  amazon cloud computing  amazon ec2


 Q7. What are the different trigger types in AWS Lambda ?Amazon Web Services (AWS)2019-01-25 10:35:19

Ans. Api Gateway
Alexa
CloudFront
CloudWatch
Code Commit
Kinesis
S3
SNS

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda trigger


 Q8. Write a Program that gets a set of numbers , filters out the non prime numbers , calculate the factorial of each prime number and then finds the average of all factorials using Lambda expressions2017-05-14 14:02:57

Ans. public class BuggyBread1 {
   
   public static void main(String args[]) {
      
      // Declare and Initialize the Collection
      Set<Integer> intSet = new HashSet<Integer>();

      // Add Elements
      intSet.add(1);
      intSet.add(2);
      intSet.add(3);
      intSet.add(4);
      intSet.add(5);

      double averageOfNonPrimeFactorials = intSet.stream().filter(p->checkIfPrime(p)).collect(Collectors.averagingInt(p->calculateFactorial(p)));
      
      System.out.println(averageOfNonPrimeFactorials );
   }
   
   static private boolean checkIfPrime(int num){
      for(int count=2;count < num;count++){
         if(num % count == 0){
            return false;
         }
      }
      return true;
   }
   
   static private int calculateFactorial(int num){
      int factorial = 1;
      for(int count=num;count > 0;count--){
         factorial = factorial * count;
      }
      return factorial;
   }
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java 8  lambda expressions  lambda  filter  Collectors  factorial  prime number


 Q9. What does the following lambda expression means ?

helloJava8 ( x-> x%2 )
Admin
info@buggybread.com
Ans. helloJava8 receives an Integer as argument and then returns the modulus of that Integer.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   java8   lambda expression


Rarely asked as it was introduced with Java 8.
 Q10. Difference between DoubleSummaryStatistics , IntSummaryStatistics and LongSummaryStatistics ?Core Java
Admin
info@buggybread.com
Ans. They all does the same task i.e to compute statistical information on the stream of data. They differ by the way they store the statistical information as they expect a different data type of the values being used.

IntSummaryStatistics and LongSummaryStatistics expect non floating point values and hence stores the statistical information like min,max and sum as non floating values ( int or long ) whereas DoubleSummaryStatistics stores these information as floating value.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   java8   java 8   lambda expressions   doublesummarystatistics   intsummarystatistics   longsummarystatistics   summarystatistics


Rarely asked as it was introduced with Java 8.
 Q11. What is the use of :: operator wef from Java 8 ?Core Java2016-07-25 13:27:57

Ans. We can refer to a function using this operator like System.out.println(intList.stream().reduce(Math::max).get());

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     :: operator   lambda expression  java 8


 Q12. What is a method reference in Java ?Core Java2017-01-29 13:55:22

Ans. Introduced with java 8 , Method References help us to point to methods by their name.

A method references is described using :: symbol

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     method reference  java 8  lambda expressions


 Q13. What is Lambda Calculus ?Core Java2017-05-29 09:55:22

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     lambda calculus


 Q14. Lets say we have a set "set1" with objects of Class A, Class has a non static string called element1, Write a code ( using lambda expression ) to see if there is any object in the set with element1 = "Hello". Core Java2017-08-06 11:51:10

Ans. set1.stream().filter(p->p.element1.equals("Hello")).findAny().isPreent();

or

set1.stream().map(A::getElement1).anyMatch("Hello"::equals)

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     lambda expressions  java 8  java8  java 8 filter  findAny()


 Q15. Given a collection of Employee objects, how can we get the customers with name starting with 'A' using lambda expression.Core Java2017-08-17 11:01:46

Ans. List emp = Arrays.asList("American", "Indian", "Finn");
emp.stream().filter(em -> em.startsWith("A")).forEach(System.out.println);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java8  java 8  lambda     Asked in 1 Companies


 Q16. Tell me something about Amazon Lambda.Amazon Web Services (AWS)2018-01-11 11:18:18

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     amazon lambda  aws  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q17. What is the difference between AWS Gateway API and Lambda ?Amazon Web Services (AWS)2018-01-30 18:04:58

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     AWS Lambda  AWS Gateway API


 Q18. Can you explain the integration between API Gateway and Lambda if we wish to develop services using these tools.Amazon Web Services (AWS)2018-01-30 18:06:37

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws api gateway  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q19. Can we build web services using AWS Lambda ?Amazon Web Services (AWS)2018-01-30 18:07:25

Ans. We have to complement it to AWS Gateway API.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     AWS Lambda  AWS Serverless  AWS Gateway


 Q20. What are the benefits of using AWS Lambda over EC2 ?Amazon Web Services (AWS)2018-01-30 18:07:57

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     AWS  AWS Lambda  AWS EC2


 Q21. Can we reserve resources in AWS Lambda just like we do for Ec2 instances ?Amazon Web Services (AWS)2018-01-30 18:08:28

Ans. No

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda  aws ec2  aws computing  amazon cloud computing  amazon ec2


 Q22. How to know IP of the machine where lambda function runs ?Amazon Web Services (AWS)2018-04-12 09:57:17

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     AWS Lambda


 Q23. What should we do If we need to know the IP of the machine where Lambda function runs ?Amazon Web Services (AWS)2018-04-12 09:57:51

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q24. How to assign a static or IP range to Lambda Function ?Amazon Web Services (AWS)2018-04-12 09:58:10

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     AWS  AWS Lambda


 Q25. Write code to get count of every 5 letter word in a string using lambda expression

Core Java2018-04-18 13:06:13

Ans. String str = "I had been saying that he had been there";

Map<String,Long> countWords = Arrays.asList(str.split(" ")).stream().filter(p->p.length() = 5).collect(Collectors.groupingBy(p->p,Collectors.counting()));

System.out.println(countWords);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Collectors  lambda  filter  coding  java 8


 Q26. What are you using AWS lambda for ?Amazon Web Services (AWS)2018-05-22 06:00:56

Ans. We are using it for computation (EC2) , Storage (S3) and Database (RDS)

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     AWS Lambda     Asked in 1 Companies


 Q27. Have you used Java 8 Lambda expressions ?Core Java2018-06-30 13:24:52

 This question was recently asked at 'One Click Retail'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java 8  lambda expressions     Asked in 1 Companies        frequent


 Q28. How can we schedule Lambda function to run daily ?Amazon Web Services (AWS)2018-10-26 11:41:04

Ans. We can schedule that through CloudWatch.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     lambda function  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda function  aws cloudwatch  amazon cloudwatch


 Q29. How does AWS Lambda handle failure during event processing?Amazon Web Services (AWS)2019-01-08 16:14:00

Ans. In AWS Lambda we can run a function in synchronous or asynchronous mode. In synchronous mode, if AWS Lambda function fails, then it will just give an exception to the calling application. In asynchronous mode, if AWS Lambda function fails then it will retry the same function at least 3 times.If AWS Lambda is running in response to an event in Amazon DynamoDB or Amazon Kinesis, then the event will be retried till the Lambda function succeeds or the data expires. In DynamoDB or Kinesis, AWS maintains data for at least 24 hours.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q30. What are the factors on which Lambda usage is priced ?Amazon Web Services (AWS)2019-01-24 07:05:02

Ans. No of requests, Computation duration

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q31. What is the use case of having Code Commit trigger within AWS Lambda ?Amazon Web Services (AWS)2019-01-25 10:36:11

Ans. If we would like a program to be executed if someone commits code to the repository.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda trigger


 Q32. Why serverless is called serverless if there are actually servers serving the requests ?Infrastructure2019-01-25 10:37:26

Ans. Because Vendors need not worry about provisioning , managing and maintaining the servers and it's intrinsically taken care of by AWS.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Amazon Web Services (AWS)  aws serverless  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q33. How do you manage environment specific configuration for your lambda functions ?Amazon Web Services (AWS)2019-01-30 14:29:04

Ans. We are using Yaml for initializing configuration and Environment Variables for overriding them.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q34. Which is a better way to keep environment specific configuration in AWS Lambda - Environment Variables or external service like S3 or RDS ? Amazon Web Services (AWS)2019-01-30 14:29:53

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q35. How can we take snapshots and track changes to environment variables in Elastic Beanstalk or Lambda ? Amazon Web Services (AWS)2019-01-31 09:55:52

Ans. We can use AWS Config

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws elastic beanstalk  amazon elastic beanstalk  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda


 Q36. Can we use Param Store with AWS Lambda ?Amazon Web Services (AWS)2019-02-04 14:23:09

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws param store  amazon param store  aws lambda  amazon lambda




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this