SERVERLESS - QUIZ
Ganesh Samarthyam
ganesh@codeops.tech
bit.ly/codeopstech
QUESTION #1
Where does the term “lambda” used in the context of
serverless functions originate from?
a) From Alonzo Church’s “lambda calculus” (in 1936)
b) From Douglas McIlroy’s “pipes and filters” in Version 3 Unix
(in 1973)
c) From Alan Kay’s SmallTalk implementation (in 1972)
d) From Samuel Stanley Wilks’ lambda distribution in
multivariate analysis of variance (MANOVA)(in 1979)
QUESTION #1 - ANSWER
❖ The term “lambda” originates from
the “lambda calculus”. In 1936,
Alonzo Church developed a logic
system that was later adopted for
computation.
❖ Most languages (including Java, C#
and C++) support lambda functions
today.
❖ In languages supporting lambda
functions, it is an unnamed
function that takes input coming
variables and returns a value.
❖ A salient characteristic of lambda
functions is the lack of side-effects.
QUESTION #2
Which one of the following principles is key to apply for
creating lambda functions in microservices architectural
style?
a) Liskov’s Substitution Principle (LSP)
b) Dependency Inversion Principle (DIP)
c) Open Closed Principle (OCP)
d) Single Responsibility Principle (SRP)
QUESTION #2 - ANSWER
❖ Serverless functions fit into
microservices style
❖ Each function should “do one
thing, and do it well” - Single
Responsibility Principle (SRP)
QUESTION #3
You are using a serverless platform. Which one of the
following are you NOT likely to do?
a) Configure Virtual Machines (VMs) for running serverless
functions
b) Allow automatically scale-out based on work-load
c) Do not pay for idle compute time
d) Trigger serverless functions based on infrastructure events
QUESTION #3 - ANSWER
In serverless, we aren’t worried about underlying operating systems or
hardware resources. So “Configure Virtual Machines (VMs) for running
serverless functions” is something we don’t do and hence the correct
answer.
Other options:
➤ Allow automatically scale-out based on work-load - true because
serverless platforms support “configuration-less auto-scaling”
➤ Do not pay for idle compute time - “pay as you go”
➤ Trigger serverless functions based on infrastructure events” - because
“event-driven” is the
QUESTION #4
Which one of the following is NOT suitable for using
serverless model?
a) Desktop applications that have extensive user interaction
through Graphical User Interfaces (GUIs)
b) Event-driven applications for processing large number of
events (IoT devices)
c) Creating a map-reduce task for large-scale data processing
d) Developing a chatbot to respond to user queries
QUESTION #4 - ANSWER
Desktop applications with have extensive user interaction is
not a suitable candidate for serverless.
Other options:
Event-driven applications for processing large number of
events (IoT devices), big data applications (including creating
map-reduce tasks for large-scale data processing), developing
a chatbot to respond to user queries - these are typical use
cases for serverless
QUESTION #5
You are developing a serverless application. Where are you
likely to store access credentials, configuration settings, and
database connection strings?
a) Embed them within the code in serverless functions
b) Put them as (encrypted) environment variables
c) Pass them as separate parameters everytime a function is
called
d) Pass them a JSON or XML string everytime a function is
called
QUESTION #5 - ANSWER
Put them as (encrypted) environment variables
Other options:
It is a bad practice to embed credentials as well as things like
within the code in serverless functions
Its cumbersome and sometimes even not feasible to keep
passing them along as explicit arguments or in JSON/XML
files.
QUESTION #6
Which one of the following is TRUE about serverless?
a) You must manage the lifetime of Docker containers
b) You must take care of patching the underlying operating
system
c) You must provide the code (and its dependencies - if needed)
to be executed
d) You must monitor for failures in underlying hardware and
manually restart the machines whenever needed
QUESTION #6 - ANSWER
Of course, we need to provide the code (and its dependencies -
if needed) to be executed
Other options:
We should not need to care of OS or hardware aspects. In
some serverless platforms, containers are explicitly used - but
we still should not be forced to manage their lifetime.
QUESTION #7
Which one of the following a key characteristic of
serverless?
a) Serverless functions typically execute for a long time
(typically in days)
b) Serverless platforms don’t support non-scripting languages
like Java and C#
c) Development process is characterised by extremely slow
iteration and deployment times (typically in weeks) when using
serverless
d) Serverless functions are required to be stateless
QUESTION #7 - ANSWER
Being stateless is one of the key characteristics of serverless functions
Other options:
Serverless functions typically execute for a short duration (in the order
of seconds in many serverless platforms)
Serverless platforms support wide range of languages - and most
platforms support mainstream languages like Java and C#
Development process is characterised by extremely fast iteration and
deployment times when using serverless
QUESTION #8
You are creating a chatbot application which is served by
serverless functions(s) in the backend. Which one of the
following is TRUE?
a) You must create a serverless function in Java and specify the
JVM tuning parameters when invoking the function
b) You can specify the maximum time limit for executing the
serverless function
c) You have to spin-up Virtual Machines (VMs) as needed
depending on the load (i.e., number of requests to be served)
d) You should write provision and configure servers with scripts
written in Chef/Puppet/Ansible/other suitable tools
QUESTION #8 - ANSWER
You can optionally specify the maximum time limit for executing the
serverless function (most platforms provide such a timeout feature)
Other options:
There is no need to write the serverless function in Java - and you
shouldn’t care about tuning underlying runtime explicitly for performance
With serverless, auto-scaling is expected (so no spinning-up Virtual
Machines as needed depending on the load)
No need to provision and configure servers with scripts written in Chef/
Puppet/Ansible/other suitable tools
QUESTION #9
Which one of the following best describes the “freeze/thaw
cycle” in serverless?
a) It refers to how public cloud is unsuitable for mission-critical
workloads
b) It refers to how CI/CD pipelines get frozen because of
breaking builds
c) It refers to how containers that underly serverless functions
gets frozen up and is warmed up again
d) It is another name for “circuit-breaker” pattern in DevOps
QUESTION #9 - ANSWER
It refers to how containers that underly serverless functions
gets frozen up and is warmed up again
QUESTION #10
When you are a developing a serverless application. Which
one of the following will you avoid for state management/
persistence?
a) A relational database
b) A key-value store
c) Block storage
d) File system on the server
QUESTION #10 - ANSWER
File system on the server.
Though some platforms make available underlying server
details (like a temporary files in file system), it is not
recommended to use it for persistence - its unsafe to do so
and abstraction leak”
Depending on need/context, you can choose to use RDBMS,
No-SQL databases or block storage

Serverless Summit - Quiz

  • 1.
    SERVERLESS - QUIZ GaneshSamarthyam ganesh@codeops.tech
  • 2.
  • 3.
    QUESTION #1 Where doesthe term “lambda” used in the context of serverless functions originate from? a) From Alonzo Church’s “lambda calculus” (in 1936) b) From Douglas McIlroy’s “pipes and filters” in Version 3 Unix (in 1973) c) From Alan Kay’s SmallTalk implementation (in 1972) d) From Samuel Stanley Wilks’ lambda distribution in multivariate analysis of variance (MANOVA)(in 1979)
  • 4.
    QUESTION #1 -ANSWER ❖ The term “lambda” originates from the “lambda calculus”. In 1936, Alonzo Church developed a logic system that was later adopted for computation. ❖ Most languages (including Java, C# and C++) support lambda functions today. ❖ In languages supporting lambda functions, it is an unnamed function that takes input coming variables and returns a value. ❖ A salient characteristic of lambda functions is the lack of side-effects.
  • 5.
    QUESTION #2 Which oneof the following principles is key to apply for creating lambda functions in microservices architectural style? a) Liskov’s Substitution Principle (LSP) b) Dependency Inversion Principle (DIP) c) Open Closed Principle (OCP) d) Single Responsibility Principle (SRP)
  • 6.
    QUESTION #2 -ANSWER ❖ Serverless functions fit into microservices style ❖ Each function should “do one thing, and do it well” - Single Responsibility Principle (SRP)
  • 7.
    QUESTION #3 You areusing a serverless platform. Which one of the following are you NOT likely to do? a) Configure Virtual Machines (VMs) for running serverless functions b) Allow automatically scale-out based on work-load c) Do not pay for idle compute time d) Trigger serverless functions based on infrastructure events
  • 8.
    QUESTION #3 -ANSWER In serverless, we aren’t worried about underlying operating systems or hardware resources. So “Configure Virtual Machines (VMs) for running serverless functions” is something we don’t do and hence the correct answer. Other options: ➤ Allow automatically scale-out based on work-load - true because serverless platforms support “configuration-less auto-scaling” ➤ Do not pay for idle compute time - “pay as you go” ➤ Trigger serverless functions based on infrastructure events” - because “event-driven” is the
  • 9.
    QUESTION #4 Which oneof the following is NOT suitable for using serverless model? a) Desktop applications that have extensive user interaction through Graphical User Interfaces (GUIs) b) Event-driven applications for processing large number of events (IoT devices) c) Creating a map-reduce task for large-scale data processing d) Developing a chatbot to respond to user queries
  • 10.
    QUESTION #4 -ANSWER Desktop applications with have extensive user interaction is not a suitable candidate for serverless. Other options: Event-driven applications for processing large number of events (IoT devices), big data applications (including creating map-reduce tasks for large-scale data processing), developing a chatbot to respond to user queries - these are typical use cases for serverless
  • 11.
    QUESTION #5 You aredeveloping a serverless application. Where are you likely to store access credentials, configuration settings, and database connection strings? a) Embed them within the code in serverless functions b) Put them as (encrypted) environment variables c) Pass them as separate parameters everytime a function is called d) Pass them a JSON or XML string everytime a function is called
  • 12.
    QUESTION #5 -ANSWER Put them as (encrypted) environment variables Other options: It is a bad practice to embed credentials as well as things like within the code in serverless functions Its cumbersome and sometimes even not feasible to keep passing them along as explicit arguments or in JSON/XML files.
  • 13.
    QUESTION #6 Which oneof the following is TRUE about serverless? a) You must manage the lifetime of Docker containers b) You must take care of patching the underlying operating system c) You must provide the code (and its dependencies - if needed) to be executed d) You must monitor for failures in underlying hardware and manually restart the machines whenever needed
  • 14.
    QUESTION #6 -ANSWER Of course, we need to provide the code (and its dependencies - if needed) to be executed Other options: We should not need to care of OS or hardware aspects. In some serverless platforms, containers are explicitly used - but we still should not be forced to manage their lifetime.
  • 15.
    QUESTION #7 Which oneof the following a key characteristic of serverless? a) Serverless functions typically execute for a long time (typically in days) b) Serverless platforms don’t support non-scripting languages like Java and C# c) Development process is characterised by extremely slow iteration and deployment times (typically in weeks) when using serverless d) Serverless functions are required to be stateless
  • 16.
    QUESTION #7 -ANSWER Being stateless is one of the key characteristics of serverless functions Other options: Serverless functions typically execute for a short duration (in the order of seconds in many serverless platforms) Serverless platforms support wide range of languages - and most platforms support mainstream languages like Java and C# Development process is characterised by extremely fast iteration and deployment times when using serverless
  • 17.
    QUESTION #8 You arecreating a chatbot application which is served by serverless functions(s) in the backend. Which one of the following is TRUE? a) You must create a serverless function in Java and specify the JVM tuning parameters when invoking the function b) You can specify the maximum time limit for executing the serverless function c) You have to spin-up Virtual Machines (VMs) as needed depending on the load (i.e., number of requests to be served) d) You should write provision and configure servers with scripts written in Chef/Puppet/Ansible/other suitable tools
  • 18.
    QUESTION #8 -ANSWER You can optionally specify the maximum time limit for executing the serverless function (most platforms provide such a timeout feature) Other options: There is no need to write the serverless function in Java - and you shouldn’t care about tuning underlying runtime explicitly for performance With serverless, auto-scaling is expected (so no spinning-up Virtual Machines as needed depending on the load) No need to provision and configure servers with scripts written in Chef/ Puppet/Ansible/other suitable tools
  • 19.
    QUESTION #9 Which oneof the following best describes the “freeze/thaw cycle” in serverless? a) It refers to how public cloud is unsuitable for mission-critical workloads b) It refers to how CI/CD pipelines get frozen because of breaking builds c) It refers to how containers that underly serverless functions gets frozen up and is warmed up again d) It is another name for “circuit-breaker” pattern in DevOps
  • 20.
    QUESTION #9 -ANSWER It refers to how containers that underly serverless functions gets frozen up and is warmed up again
  • 21.
    QUESTION #10 When youare a developing a serverless application. Which one of the following will you avoid for state management/ persistence? a) A relational database b) A key-value store c) Block storage d) File system on the server
  • 22.
    QUESTION #10 -ANSWER File system on the server. Though some platforms make available underlying server details (like a temporary files in file system), it is not recommended to use it for persistence - its unsafe to do so and abstraction leak” Depending on need/context, you can choose to use RDBMS, No-SQL databases or block storage