Use nodemon to watch the node_modules directory
You want to use nodemon to watch the node_modules directory for a certain project. However, you do not want this config to affect your other projects.
Which of the following would be an appropriate way to do so in the given scenario?
Options
- Override the ignoreRoot config in your local nodemon.json
- Override the ignoreRoot config in your $HOME/nodemon.json
- Override the watchmodule config in your local nodemon.json
- Override the watchmodule config in your $HOME/nodemon.json
Freed up to handle other requests
Each request to a web server takes 40 ms to complete, and 35ms of that 40ms is database I/O that can be done asynchronously.
Which of the following operations will you use if you want that 35ms per request to get freed up to handle other requests?
Options
- Non-blocking asynchronous operations
- Blocking asynchronous operations
- Non-blocking synchronous operations
- Blocking synchronous operations
Find a temporary file of your application
You need to (hypothetically) find a certain temporary file of your application using npm. Assuming that the default locations were used, which of the following environment variables determines where the file is?
Options
- TMPDIR
- TMP
- TEMP
- Any of the above
Override the default behaviour of REPL evaluation function
You want to override the default behaviour of the REPL evaluation function used in Node. Which of these would you add the alternative evaluation function to in the given scenario?
Options
- repl.REPLServer
- Config.REPLServer
- Socket.REPLServer
- override.REPLServer
Working with Timers
In the given code snippet, you have to replace XXXXX with a certain method to get the desired output.
function timerExample() {
console.log('Time!');
}
XXXXX(tierExample, 1000);
What is the correct combination of the method and desired output by substituting that method in place of XXXXX?
Options
1.XXXXX - setTimeout()
Result - timerExample() will execute after any I/O operations(if used) in the current event loop
2.XXXXX - setinterval()
Result - timerExample() will execute about every 1 second until it is stopped
3.XXXXX - setTimeout()
Result - timerExample() will execute as close to 1000 millisecond
4.XXXXX - process.nextTick()
Result - timerExample() will execute as close to 1000 millisecond
Generate an SSH key
On a Windows machine that has gitbash, you would like to generate an SSH key and add it to the ssh agent for Github. What would be your first command after generating and saving the key?
Note: id_rsa is a key name
Options
- ssh-add ~/.ssh/id_rsa
- eval $(ssh-agent -s)
- ssh-keygen -t rsa -b 4096
- None of the above
Execution needs to be cancelled
A piece of code is scheduled to execute after a designated amount of time. You realize that execution needs to be cancelled.
If used for scheduling the code execution, which of the following would prevent cancelling the same?
Options
- setInterval()
- setImmediate()
- process.nextTick()
- setTimeout()
Publish a scoped package
In the process of creating a scoped public package, you have created a scoped package that has the user scope. What command would you use to publish this?
Note: username is "username"
Options
- npm publish --access public
- npm publish --access username
- npm publish --scope username -access public
- npm publish ---scope=@username -access public
Callback parameter of the argument list is omitted
Which of these are likely to be returned by the method shown below if the callback parameter of the argument list is omitted?
query (command, [callback])
Options
- Await
- Promise
- Resultset
- This will result in compile time error
Transfer data from one process to another
In Node.js, you use the .pipe() function to transfer data from one process to another. Unfortunately, the write queue is currently busy and so .write() returns a false value.
Which of the following events will be emitted once the data buffer is emptied to resume the incoming data flow in this situation?
Options
- .drain()
- .read()
- .transform()
- .duplex()
Using sigils in Elixir
ou want to generate a list of words while working with Elixir.
Which of the following sigils can be used to achieve this?
Options
- ~c
- ~s
- ~w
- ~r
Implementing pattern matching
Determine the output of the given code snippet in Elixir.
[head | _] = [3,6,9] #line1
head * 2 #line2
_ * 3 #line3
Options
1.[6,12,18]
[9,18,27]
2.[3,6,9]
[3,6,9]
3.Compilation error at line 1
4.Compilation error at line 2
5.Compilation error at line 3
Working with lists
What happens when following line of code is run in Elixir?
length([1, [2], 3]) = 3
Options
- All values of length will be set to 3.
- A Compile Error is thrown
- A Match Error is thrown
- The first value of length is set to 3
Verifying arguments
Which of these callbacks can be used to verify the arguments given to the provider and prepare the state that will be given to load/2?
Options
- init/1
- init/3
- link/3
- spawn/1
The crypto module
Which of the following files need to be edited to include the crypto module in Elixir?
Options
- mix.exs
- mix.logger
- mix.repo
- mix.store
Creating callbacks
You have created two callbacks X and Y in Elixir. You now want to annotate X and Y to inform the compiler that your intention for the subsequent function definition is to define a callback.
Which of these annotations should you use to achieve this?
Options
- @impl true
- @impl false
- @doc
- @impl doc
- @doc true
Implementing configuration files
What does the following configuration file do when implemented in Logger?
config :logger,
compile_time_purge_matching: [
[application: :abc],
[module: Sample, function: "abc/3", level_lower_than: :error]
]
Options
- It purges all log calls from an application named :abc.
- It only keeps errors from Sample.abc/3
- Both Choice 1 and 2
- It does not do anything.
Flattening lists
What can be said about the codes A and B given below?
A:
[1, [2], 3]
|> List.flatten()
B:
[1, [2], 3]
v() |> List.flatten()
Options
- Both A and B are equivalent.
- Both A and B are not equivalent.
- A will run without error but B will throw errors.
- B will run without error but A will throw errors.
Pattern matching in Elixir
Analyze the snippet given below and determine its output.
{a, a} = {4, 7}
Options
- 4
- 7
- 11
- A (MatchError) will occur
Setting configuration via config files
You have set the following configuration via config files before the :logger application is started.
:compile_time_purge_matching
What will happen to logger calls with a level lower than the above given option?
Options
- They will be completely removed at compile time.
- They will cause overhead during runtime.
- They will be ignored during runtime.
- None of these
Multiple-argument aggregate functions
You have a table ABC with columns a and b. You now want to use a multiple-argument aggregate function to display a in descending order of b. To do this, you have written the following two queries.
A:
SELECT string_agg(a, ',' ORDER BY b) FROM ABC;
B:
SELECT string_agg(a ORDER BY b, ',') FROM ABC;
Which of these queries is an incorrect way to implement the given objective?
Options
- Only A
- Only B
- Both A and B
- Neither A nor B
Updating existing rows
You want to update existing rows of a column using the UPDATE command. Which of these informations is/are mandatory when doing this?
1. The name of the table and column to update.
2. The new value of the column.
3. The rows that need to be updated.
Options
- Only 1 and 3
- Only 2 and 3
- All 1, 2 and 3
- Insufficient information
Linking rows in PostgreSQL
How does PostgreSQL link rows in separate tables?
Options
- It uses foreign key and primary key linking in its internal system tables
- it uses a JSON file to store the links
- It uses reverse indexing
- None of these
Turning off AUTOCOMMIT
Assume that you have turned off autocommit and just done one commit at the end when performing multiple INSERTs.
In the given scenario, what will PostgreSQL do if the insertion of one row fails?
Options
- The insertion of all rows inserted up to that point would be rolled back.
- PostgreSQL only loads partial data.
- All insertions are discarded.
- None of these
Opening a cursor
You have opened a cursor variable and given it a specific query to execute as follows:
OPEN curs1 FOR EXECUTE format('SELECT * FROM %I WHERE col1 = $1',tabname) USING keyvalue;
Which of the following can be inferred from the given statement?
Options
- The table name is inserted into the query via format() and comparison value for col1 is inserted via a USING parameter.
- The table name is inserted into the query via format() along with the comparison value for col1.
- The table name is inserted into the query along with the comparison value for col1 is inserted via a USING parameter.
- The table name is inserted into the query via a USING parameter.
Changing data type of column
Assume that you are using the following command to convert a column to a different data type.
ALTER TABLE products ALTER COLUMN price TYPE numeric(10,2);
Which of these choices is/are TRUE in the given scenario?
Options
- This will succeed only if each existing entry in the column can be converted to the new type by an implicit cast.
- PostgreSQL will attempt to convert the column's default value (if any) to the new type, as well as any constraints that involve the column.
- Both Choice 1 and 2
- None of these
Working without parentheses
You come across the following query when working in PostgreSQL.
SELECT a FROM b UNION SELECT x FROM y LIMIT 10
Which of these choices correctly depicts how this query is evaluated?
Options
- It is evaluated as (SELECT a FROM b UNION SELECT x FROM y) LIMIT 10
- It is evaluated as SELECT a FROM b UNION (SELECT x FROM y LIMIT 10)
- It throws a syntax error
- It throws a runtime error
Inserting data
You are inserting a lot of data at the same time into your table when working with PostgreSQL. You want to do this in the most efficient way possible.
Which of these commands will help you achieve your objective?
Note: You can ignore the flexibility of the command.
Options
- COPY command
- INSERT command
- UPDATE command
- Both Choice 1 and 2
- Both Choice 2 and 3
Working with PostgreSQL service
Which of these commands can you use to check whether PostgreSQL service is running on Linux machines(Ubuntu destro)?
Options
- sudo service status -postgresql
- sudo service postgresql status
- sudo service postgresql -all
- sudo service postgresql -status
Performing operations on a table
You want to perform the following operations on a table using PostgreSQL:
1. Select index_id and make distinct query on the column_name column.
2. Return the highest index_id of each distinct column.
Which of these queries can help you do this?
Options
1.SELECT UNIQUE ON (column_name) index_id
FROM table_name
group by column_name, index_id desc;
2.SELECT UNIQUE ON (column_name) index_id
FROM table_name
order by column_name, index_id desc;
3.SELECT DISTINCT ON (column_name) index_id
FROM table_name
group by column_name, index_id desc;
4.SELECT DISTINCT ON (column_name) index_id
FROM table_name
order by column_name, index_id desc;
Requesting resource representation through a HTTP request
You are requesting resource representation through a HTTP request consisting of Accept-Encoding field. When doing so, the server failed to send the response as per the specified encoding.
Which of these error codes should be sent by server in that scenario?
Options
- 400(Bad Request)
- 404(Not Found)
- 406(Not Acceptable)
- 500(Internal Server Error)
Analyzing the constraints applied to the REST Architectural system
You are analyzing the constraints applied to the REST Architectural system.
In the given context, which of these constraints would you credit with the promotion of independent evolvability?
Options
- Uniform Interface
- Layered System
- Code-On-Demand
- Client-server interaction constraint
Combining layered systems and uniform interface constraints
While analyzing the REST Architecture, you find that the combination of layered system and uniform interface constraints induces certain architectural properties.
These properties seem similar to which of these styles?
Options
- uniform pipe-and-filter style
- Data Layer style
- Key-Data style
- funnel-pipe style
Benefits of Cache constraints
You are analyzing the REST Architecture of a system. In the given context which of these benefits would you attribute to cache constraints?
1. Improved efficiency
2. Improved scalability
3. Improved user-perceived performance
Options
- Only 1
- Only 2
- Only 3
- Only 1,2
- All 1,2,3
Types of REST Connectors
An HTTP proxy receives a CONNECT method request in a REST Based Architecture.
In the given context, which of these types of REST Connectors would you expect the REST connector to switch to?
Options
- Cache
- Client-Server
- Tunnel
- Resolver
Imposing layered system constraints in REST
The requirement for a layered system is considered as a fundamental principle in REST.
In the context of the REST architecture, which of these architectural benefits are attained by imposing layered system constraints?
Options
- Placing a bound on overall system complexity
- Promotion of substrate independence
- Interface uniformity
- Only Choice 1 and Choice 2
- Only Choice 2 and Choice 3
Types of REST Components
A REST component needs to be used to govern the namespace for a requested resource.
In the given context, which of these types of REST components would you consider using?
Options
1.origin server
2.gateway
3.proxy
4.user agent
Determining the design approach
You are building a shopping cart for your application. When doing so, you have designed the following request code for the endpoint /abc.
POST /abc { "abc-request": [ { "method": "POST", "path": "/customer", "ref": "newcustomer", "body": {"name": "Tony Stark"} }, { "method": "POST", "path": "/order", "ref": "neworder", "body": {"customer": "@{newcustomer.id}"} } ] }
What can be said about the design approach used in the given scenario?
Options
- You are using the Resource modeling design approach
- You are using the Separation of concerns design approach
- You are using the Composite API design approach
- None of these
Choosing correct REST API Design approach
You want to address the following use cases when implementing REST API calls.
1. Subsequent calls do not need to reference previous data
2. If a call fails, there is no need to roll back changes made by earlier steps
Which of these REST API design approaches can you use to achieve this?
Options
- Batch APIs
- Composite APIs
- Either Choice 1 or 2
- Neither Choice 1 nor 2
Using multiple resolvers to improve the longevity of resource references
You are using multiple resolvers to improve the longevity of resource references through indirection.
Which of these trade-offs are you likely to suffer from when doing so?
Options
- Increased request latency
- Decreased network integrity
- Decreased request reliability
- Decreased connection security
Using the Memoization Technique
You want to improve the performance of a code used to calculate the factorial of a number using memoization. In the given context, which of the following will be increased while doing so?
1. Time complexity
2. Space complexity
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Improving time complexity of code
Which of these code snippets can be used to improve the time complexity of the below given code snippet to O(log(N))?
public static int Search(int arr[], int elementToSearch) { for (int index = 0; index < arr.length; index++) { if (arr[index] == elementToSearch) return index; } return -1; }
Options
1.public static int Search(int arr[], int firstElement, int lastElement, int elementToSearch) { if (lastElement >= firstElement) { int mid = firstElement + (lastElement - firstElement) / 2; if (arr[mid] == elementToSearch) return mid; if (arr[mid] > elementToSearch) return Search(arr, firstElement, mid - 1, elementToSearch); return Search(arr, mid + 1, lastElement, elementToSearch); } return -1; 2.public static int Search(int[] integers, int elementToSearch) { int startIndex = 0; int lastIndex = (integers.length - 1); while ((startIndex <= lastIndex) && (elementToSearch >= integers[startIndex]) && (elementToSearch <= integers[lastIndex])) { int pos = startIndex + (((lastIndex-startIndex) / (integers[lastIndex]-integers[startIndex]))* (elementToSearch - integers[startIndex])); if (integers[pos] == elementToSearch) return pos; if (integers[pos] < elementToSearch) startIndex = pos + 1; else lastIndex = pos - 1; } return -1; } 3.Both Choice 1 and 2 4.Neither Choice 1 nor 2
Failure of resources in a website
You are dealing with failure of resources in a website that runs on microservices. When debugging this issue it is observed that this is because a certain service XYZ in the website is down.
What is the best possible action that can be taken in the given scenario?
Options
- The website should be made unavailable
- The website should run and the functionality of XYZ should be degraded
- The website should run and the functionality of XYZ should be mocked
- The website should run and a new service with the same functionality must be started
Manage the memory in your system
You want to do the following when managing the memory in your system.
1. Eliminate fragmentation
2. The user should decide the size of the memory block
In the given context, which of these memory management schemes can be used?
Options
- Segmentation
- Paging
- Swapping
- Memory allocation
Ternary relationships in an ER Diagram
What is the degree associated to a ternary relationship in an ER Diagram?
Option
- one
- two
- three
- four
Weak entities in tables
A certain table contains information about some customer like ID, Address, Name, Surname.
Which of these information can be considered as weak entities?
Options
- Name,Surname
- ID
- Address
- Address,Surname
Primary and foreign keys in a database
Which of the following statements is/are NOT correct about primary and foreign keys in a database?
1. A table in a database can only have a single primary key.
2. Primary keys might contain NULL values.
3. You cannot write a query to drop a foreign key constraint as it is linked to a primary key.
Options
- Only 3
- 1 and 3
- Only 2
- 2 and 3
- All Are Incorrect
Benefits of Cache constraints
You are analyzing the REST Architecture of a system. In the given context which of these benefits would you attribute to cache constraints?
1. Improved efficiency
2. Improved scalability
3. Improved user-perceived performance
Options
- Only 1
- Only 2
- Only 3
- Only 1,2
- All 1,2,3
Determining the design approach
You are building a shopping cart for your application. When doing so, you have designed the following request code for the endpoint /abc.
POST /abc { "abc-request": [ { "method": "POST", "path": "/customer", "ref": "newcustomer", "body": {"name": "Tony Stark"} }, { "method": "POST", "path": "/order", "ref": "neworder", "body": {"customer": "@{newcustomer.id}"} } ] }
What can be said about the design approach used in the given scenario?
Options
- You are using the Resource modeling design approach
- You are using the Separation of concerns design approach
- You are using the Composite API design approach
- None of these
Requesting resource representation through a HTTP request
You are requesting resource representation through a HTTP request consisting of Accept-Encoding field. When doing so, the server failed to send the response as per the specified encoding.
Which of these error codes should be sent by server in that scenario?
Options
- 400(Bad Request)
- 404(Bad Request)
- 406(Not Acceptable)
- 500(Internal Server Error)
Predict the output
What will be the output of the given code snippet?
x = ['fun', 2, 'cricket', 'done'] try: print (x[1]) print (x[3]) print (x[4]) except IndexError: print("Go Home")
Options
1.fun
Go Home
2.2
done
Go Home
3.2
done
4.fun
done
Determine the output
What will be the output of the given snippet of code?
import re x = "Nothing you wear is more important than your smile" y = re.search( r'more', x, re.M|re.I) if y: print ("True :", y.group()) else: print ("Yes") z= re.match( r'more', x, re.M|re.I) if z: print ("Fine :", z.group()) else: print ("No")
Options
T1.rue : more
Fine: more
2.True : Nothing you wear is more important than your smile
No
3.True : more
No
4.Yes
No
Predict the output
What will be the output of the given code snippet?
def fun(x,y): try: z = (x-y) d=x/z except ZeroDivisionError: print ("Please mind your calculations") else: print (d) # Driver program to test above function fun(1,2) fun(5,5)
Options
- Error
2.-1.0
Please mind your calculations
3.Please mind your calculations
Please mind your calculations
4.Please mind your calculations
Predict the output
What will be the output of the given code snippet?
x = ['fun', 2, 'cricket', 'done'] try: print (x[1]) print (x[3]) print (x[4]) except IndexError: print("Go Home")
Options
1.fun
Go Home
2.2
done
Go Home
3.2
done
4.fun
done
Analyze the code
What will be the output of the given code snippet?
def div(a, b): try: c = a // b print(c) except ZeroDivisionError: print("Change parameter ") div(3, 2) div(3,0) div(25,5)
Options
- Syntax Error
- 1
- 1
Change parameter
4.1
Change parameter
5
Predict the output
What will be the output of the given code ?
def Sum(a,b): try: c = ((a+b) / (a-b)) except ZeroDivisionError: pass except ZeroDivisionError: print("Error") else: print (c) Sum(2, 3) Sum(3, 3)
Options
- -5
- Error
- ZeroDivisionError
- None of the above
Determine the output
What will be the output of the given code snippet?
try : x = 5 if x < 6 : y = x/(x-3) print ("My", y) print ("Why",c) except(ZeroDivisionError, NameError): print ("Change the world ")
Options
- Syntax Error
- My 2.5
Change the world
3.My 2.5
4.Change the world
Determine the output
What will be the output of the given code snippet?
class Run(object): # Constructor def __init__(boy, why): boy.why = why def Identity(boy): return boy.why def isBoy(boy): return False class Forrest(Run): def isBoy(boy): return True x= Run("John") print(x.Identity(), x.isBoy()) x = Forrest("Abram") print(x.Identity(), x.isBoy())
Options
1.Why False
Why True
2.Error
3.John False
4.John False
5.Abram True
Abram True
Find the output
What will be the output of the given snippet of code?
import re x = "Nothing you wear is more important than your smile" y = re.search( r'(.*) than (.*?) .*', x, re.M|re.I) if y: print ("True :", y.group()) print ("False : ", y.group(1)) else: print ("Yes")
Options
- Error
- Yes
- True : Nothing you wear is more important than your smile
4.True : Nothing you wear is more important than your smile
False : Nothing you wear is more important
Determine the output
What will be the output of the given snippet of code?
import re Flat = "Flat Number B101 # Oceanus Freesia" x = re.sub(r'#.*$', "", Flat) print ("Address : ", x)
Options
- Error
- ('Address : ', 'Flat Number B101 ')
- Flat Number B101 # Oceanus Freesia
- Address : Flat Number B101
Using the proxies
You have made the configuration changes shown below for the <tx:annotation-driven/> element.
proxy-target-class="true"
In the given scenario how many of these elements will be forced to use CGLIB proxies?
1.<tx:annotation-driven/>
2. <aop:aspectj-autoproxy/>
3.<aop:config/>
Options
- 0
- 1
- 2
- 3
Identify the components
In any Spring application, the interface X provides the basic framework and functionality whereas Y provides enterprise specific functionalities.
Which of the following options identifies X and Y correctly?
Options
1.X: BeanFactory
Y: EnterpriseContext
2.X: FactoryContext
Y: ApplicationContext
3.X: BeanFactory
Y: ApplicationContext
4.X: FactoryContext
Y: EnterpriseContext
The class exclusion problem
Which of these code snippets successfully excludes the class "myAutoConfiguration.class"?
Options
1.@Configuration @EnableAutoConfiguration(exclude={myAutoConfiguration.class}) public class MyConfiguration { } 2.@Configuration @SpringBootApplication @EnableAutoConfiguration(exclude={myAutoConfiguration.class}) public class MyConfiguration { } 3.@Configuration @EnableAutoConfiguration(disable={myAutoConfiguration.class}) public class MyConfiguration { } 4.@Configuration @SpringBootApplication @EnableAutoConfiguration(disable={myAutoConfiguration.class}) public class MyConfiguration { }
Testing Spring
Which of these annotations need to be used along with the given annotation to inject a MockMvc instance for testing a spring app?
@SpringBootTest
Options
- @WebMvcTest
- @MockMvcTest
- @ConfigureWebMockMvc
- @AutoConfigureMockMvc
- None of the above
The Concurrency problem
You are trying to place constraints on a single user’s ability to log in to your Spring application. Assume that you have already added a listener to your web.xml file to keep Spring Security updated about session lifecycle events.
In the given scenario, which of these lines of code can you use in your application context to prevent a second login?
Options
1.<concurrency-control max-sessions="1" /> 2.<session-management invalid-session-url="/invalidSession.htm" /> 3.<concurrency-control max-sessions="1" error-if-maximum-exceeded="true" /> 4.<concurrency-control max-sessions="1" session-authentication-error-url/>
Problem with Classes
What is the result of compiling and executing the code snippet given below?
1. class Outer_Demo { 2. private int num = 175; 3. public class Inner_Demo { 4. public int getNum() { 5. 6. return num; 7. } 8. } 9. } 10. 11. public class My_class2 { 12. public static void main(String args[]) { 13. Outer_Demo outer = new Outer_Demo(); 14. Outer_Demo.Inner_Demo inner = outer.newInner_Demo(); 15. System.out.println(inner.getNum()); 16. } 17. }
Options
- 175
- Compilation error at line 14
- Compilation error at line 15
- Runtime error
Debug the interface problem
You implemented the two functional interfaces, as shown in the Java 8 code snippet given below.
public class University{ @FunctionalInterface interface TheoryMarks{ abstract float theoryMarks(); } @FunctionalInterface interface PracticalMarks extends TheoryMarks{ abstract float practicalMarks(); public static void printMarks() { System.out.println("Calculation of marks"); }}}
However, the code is returning a compilation error. What could be the reason for receiving this compilation failure?
Options
- Static method is defined after the abstract method
- A functional interface cannot extend another functional interface
- The PracticalMarks interface will have two abstract method
- Methods are not mentioned as public abstract
Working with Interfaces
Determine the output of the given code snippet.
interface Foo { String name = "Foo"; void print(); } class Bar implements Foo { String name = "Bar"; public void print() { System.out.println(name); // Line 1 } public static void main(String[] args) { Foo foo = new Bar(); // Line 2 foo.print(); // Line 3 } }
Options
- Foo
- Bar
Problem on threads
Which of these deductions can be made from the code snippet given below?
class A { { System.out.println(1); } } class B extends A { { System.out.println(2); } } class C extends B { { System.out.println(3); } } class D extends B { { System.out.println(4); } }
Options
- Class A is the only child of class C because it comes after class B and therefore overrides it
- Class B is a child for two different classes
- Class B is a parent to both classes C and D
- Class C is only a parent to class B
- Class D is a child of class A because it is underneath it
An Inheritance issue
Which of the following deductions can be made from the code snippet given below?
class A { { System.out.println(1); } } class B extends A { { System.out.println(2); } } class C extends B { { System.out.println(3); } } class D extends B { { System.out.println(4); } }
Options
- Class A is the only child of class C because it comes after class B and therefore overrides it
- Class B is a child for two different classes
- Class B is a parent to both classes C and D
- Class C is only a parent to class B
- Class D is a child of class A because it is underneath it
Predict the output
Predict the output of the following code snippet.
#include<iostream> using namespace std; class A { public: virtual void function1() {cout<<"A :: function1()\n";}; virtual void function2() {cout<<"B :: function2()\n";}; virtual ~A(){}; }; class B: public A { public: ~B(){}; virtual void function1_virtual() { cout<<"B :: function1()\n"; }; }; int main() { B *b = new B; A *a = b; a->function1(); a->function2(); delete (a); return (0); }
Options
- A :: function1()
- B :: function2()
- A :: function1(),B :: function2()
- B :: function2(),A :: function1()
Resource acquisition fails in C++
It is given that resource acquisition fails when using the Resource Acquisition Is Initialization in C++.
What happens to all resources acquired by every fully-constructed member and base subobject as a result of this?
Options
- They are released in reverse order of initialization.
- They are released in reverse order of acquisition
- They are destroyed
- None of these
Prevent unrecoverable destruction
You want to prevent unrecoverable destruction of resources when working with the move assignment operator in C++.
Which of these actions if taken will help you achieve this?
Options
- Properly handle self-assignment in the move assignment operator.
- Free resources such as memory and file handle.
- Provide move constructor along with the move assignment operator
- None of these
RAII-class instance in C++
You want to use the resource via an instance of a RAII-class. In which of the given scenarios can this be achieved?
1. The RAII-class has automatic storage duration.
2. The RAII-class has lifetime that is bounded by the lifetime of an automatic object.
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Analyse the code
//Line1 template <class T> class mycontainer { //some code }; // Line2 template <> class mycontainer <char> { char element; public: mycontainer (char arg) {element=arg;} //some code };
Analyse the code snippet given above and choose the correct inferences that can be made.
Options
- Line 2 defines the class template specialization
- Line1 defines the class template specialization
- Line 2 defines the generic class template
- Both L1 and L2 are part of the class template specialization
Analyze the code
Which of these code snippets are valid examples of rvalue expressions in C++?
1.
int a; int& sample () { return a; } sample() = 1;
2.
int a; int sample () { return a; } sample;
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Predict the output
Predict the output of the following code snippet.
using namespace std; class A { public: ~A() { cout << "Destructor of class A\n"; } }; class B:public A { public: ~B() { cout<< "Destructor of class B\n"; } }; int main() { A* a = new B; delete a; }
Options
- Destructor of class A
- Destructor of class B
- Destructor of class ,Destructor of class B
- Destructor of class B,Destructor of class A
Accumulate function in C++
You want to use the accumulate function of the <numeric> header in C++ to return the result of accumulating all the values in the range [first,last) to init.
Which of these code snippets is equivalent to the behaviour of the accumulate function?
Options
1.template <class InputIterator, class T> T accumulate (InputIterator first, InputIterator last, T init) { while (first!=last) { init = init + *first; ++first; } return init; } 2.template <class InputIterator, class T> T accumulate (InputIterator first, InputIterator last, T init) { while (first!=last) { init=binary_op(init,*first) ++first; } return init; } 3.Both 1 or 2 4.None of these
Obtain the output as 18
Which of these lambda expressions can be used in place XXX to produce the output as 18?
#include int main() { using namespace std; XXX cout << result << endl; }
Options
1.int result = [](int x) { return [](int y) { return y * 3; }(x) + 3; }(5);
2.int result = [](int x) { (int y) { return y * 3; }(x) + 3; }(5);
3.Either 1 or 2
4.Neither 1 nor 2
Analyse the code
Analyse the code snippet given below and choose the correct option.
void funtion1(int (*)(int)) {} void function2(char (*)(int)) {} void function3(int (*)(int)) {} // #1 void function3(char (*)(int)) {} // #2 auto samplelambda = [](auto a) { return a; }; function1(samplelambda); // Line1 function2(samplelambda); // Line2 function3(samplelambda); // Line3
Options
- Line 2 and Line 3 will throw an error
- Only Line 2 will throw an error
- Only Line 3 will throw an error
- Only Line 1 and Line 3 will throw an error
OOPS in PHPv
Which of the following statements regarding OOPS in PHP is/are true?
S1: __construct() function is used to define constructor in PHP.
S2: While writing a code in PHP to provide a common function names to the implementers you may use interfaces.
Options
- $1
- $2
- $1 and $2
- None
Delete or flush all files
You want to delete or flush all the files from a particular folder location using PHP.
Which of these code snippets can be used to achieve this objective?
Note: Assume folder path is “path/to/temp/”.
Options
1.$files = glob('path/to/temp/*');
foreach($file in $files){
if(is_file($file))
unlink($file);
}
2.$files = glob('path/to/temp/*');
foreach($files as $file){
if(is_file($file))
unlink($file);
}
3.$files = glob('path/to/temp/*');
foreach($files as $file){
if(is_file($file))
delete($file);
}
4.$files = glob('path/to/temp/*');
foreach($file in $files){
if(is_file($file))
delete($file);
}
Optimizing Web server Response
Analyze the below given snippet and choose the most optimized version that executes the similar functionality.
for( $i=0; i< count($arrB); $i++){
echo count($arrB);
}
Options
1.for( $i=0; i< $len; $i++){
$len = count($arrB);
echo $len;
}
2.$len = count($arrB);
for( $i=0; i< $len; $i++){
echo $len;
}
3.While( $i< $len){
$len = count($arrB);
echo $len;
$i++;
}
4.for( $i=0; i< $len; $i++){
$len = count($arrB);
}
echo $len;
}
Finally block is NOT executed
Assume that you have used a finally block after a try-catch block when working in PHP. In which of the given scenarios will the finally block NOT be executed?
1. A return statement is encountered inside either the try or the catch blocks.
2. The finally block contains a return statement.
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Handling exception in PHP
Predict the output of the following code snippet.
<?php
function sample() {
try {
throw new Exception('Hello World');
} catch (Exception $e) {
return 'catch';
} finally {
return 'finally';
}
}
echo sample();
?>
Options
- Hello World
- catch
- finally
- None of these
Working with the ‘+’ operator
Predict the output of the following code snippet.
<?php
$a = array(
0=>"ONE",
2=>"TWO");
$b = array(
1=>"Three",
2=>"Four");
foreach(($a + $b) as $key=>$value)
{
print("$key: $value\n");
}
?>
Options
1.0: ONE
2: TWO
1: THREE
2: TWO
2.0: ONE
2: TWO
1: THREE
2: FOUR
3.0: ONE
2: TWO
1: THREE
4.None of these
Backed enum “Fruit” is created
You have created a backed enum "Fruit" as follows in PHP.
<?php
enum Fruit: string
case Apple = 'A';
case Lemon = 'L';
case Orange = 'O';
case Tomato = 'T';
}
?>
In the given context, what will happen if a variable is assigned as a reference to the backed case Lemon?
Options
- The value property of Lemon is enforced to be read-only
- The following error is thrown:
- Error: Cannot acquire reference to property Fruit::$value
- The value L is printed
- A ValueError is thrown
Constructors in PHP
You have created two classes named A and B such that A is the parent of B. You have also defined a constructor C inside the child class B.
Which of these choices is/are true regarding A's constructor?
Options
- It is called implicity
- It is not called implicity
- It is run insider B
- None of these
Improve security in PHP
In order to increase security, you have decided to put the PHP parser binary in /usr/local. Which of the following is/are some downsides of doing this?
A. PATH_INFO and PATH_TRANSLATED need to be configured
B. Any file containing PHP tags would need an additional first line
C. Any file containing PHP tags would need to be made executable
Options
- A
- A,B
- B,C
- A,B,C
Set the persistence mode for a soap server
You have used the below given method to set the persistence mode for a soap server using PHP 5.
SOAP_PERSISTENCE_SESSION
The persistence of which of the following is/are unlikely to be affected in the given scenario?
1. Objects of the class.
2. Static data member of the class.
Options
- Only1
- Only 2
- Both 1,2
- Neither 1 nor 2
Switch cases in Go
Predict the output of the following code snippet.
func main() { var X interface{} switch i := X.(type){ case nil: fmt.Printf("X is :%T",i) case int: fmt.Printf("X is int") case float64: fmt.Printf("X is float64") case func(int) float64: fmt.Printf("X is func(int)") case bool, string: fmt.Printf("X is bool or string") default: fmt.Printf("Don't Know") } }
Options
- X is int
- X is bool or string
- X is func(int)
- X is :<nil>
For loops in Go
How many times will the "for" loop execute in the following code snippet?
package main import "fmt" func main(){ var a int = 2 var b int = 5 var expression_1 int var expression_2 int expression_1 = (5*a - 2*b) expression_2 = (4*a + 8*b) % (b-1) for expression_1 = expression_2 { expression_1+= 5 fmt.Println(expression_1) expression_2-- fmt.Println(expression_2) } }
Options
- 0
- 1
- 2
- Infinite
Working with tokens in Go
You have a Go program that consists of various tokens.
Which of these tokens can you use to recognize a user-defined item?
Options
- Whitespace
- Comments
- Keywords
- Identifiers
Handling errors
Predict the output of the following code snippet.
func Sqrt(num float64)(float64, error) { if(num < 0){ return 0, errors.New("The result is a Complex Number") } return math.Sqrt(num), nil } func main() { output, error:= Sqrt(-4) if error != nil { fmt.Println(error) }else { fmt.Println(output) } output, error = Sqrt(256) if error != nil { fmt.Println(error) }else { fmt.Println(output) } }
Options
1.2
16
2.16
2
3.Error
4.16
The result is a Complex Number
5.The result is a Complex Number
16
Working with functions
What output will be produced when the following code snippet is executed?
func Sequence() func() int { i:= 0 return func() int { i+=1 return i } } func main(){ num := Sequence() fmt.Println(num()) fmt.Println(num()) fmt.Println(num()) num1 := Sequence() fmt.Println(num1()) fmt.Println(num1()) }
Options
1.1
2
3
1
2
2.0
1
2
0
1
3.1
2
3
4
5
4.0
1
2
3
4
Working with functions
What will be displayed on the screen when the following code snippet is executed?
package main import "fmt" func main() { var X int = 020 var Y float64 = 10.5 var Z float64 Z = float64(X)-float64(Y) fmt.Println(Z) }
Options
- 9.5
- 4.5
- 5.5
- Error
Working with composite literals
Which of the following intializations will throw an error in Go?
1. a := [...]string {Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
2. m := map[int]string{Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Defering a function
You decide to defer a function call when coding in Go. What is the benefit of doing this?
1. It guarantees that you will never forget to close the file.
2. The parameters of this function are initialized to zero values by default.
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Handling errors
You are using the following code snippet to loop through an array using for.
sum := 0 XXX, value := range array { sum += value }
What can be used in place of XXX if you need the second item in the range and discard the first?
Options
1.for ? 2.for ;; 3.for _ 4.for (;)
Performing allocations
Consider the following code snippet.
type SyncedBuffer struct { lock sync.Mutex buffer bytes.Buffer } p := new(SyncedBuffer) var v SyncedBuffer
Which of these deductions can be made about the values p and v?
Options
- Both p and v will work correctly without further arrangement.
- Both p and v will NOT work correctly without further arrangement.
- Only v will work correctly without further arrangement.
- Only p will work correctly without further arrangement.
Running a exploit using Aircrack
You want to run a 802.11 packet injection program while running a exploit using Aircrack.
In the given context, which of these tools provided with Aircrack are you likely to use for this purpose?
Options
- aireplay
- airodump
- airdecap
- airowiz
Attempting session hijacking
Which of these symptoms observed while monitoring telemetry is indicative of a Session Hijacking attempt?
Options
- Telnet sessions start freezing
- a sudden burst of network activity for a short period,
- Repeated ARP updates
- Choice 1 and Choice 3
- All of the given options
Gathering encrypted packers during reconnaissance
You have encrypted packets that have been gathered during reconnaissance.
In the given context, which of these tools can be used for cracking the encryption?
Options
- Aircrack
- Cain and Abel
- John the Ripper
- All of the given options
Attacking an OpenSSH server
An OpenSSH server needs to be attacked by loading a user defined library with SSH server rights.
Which of these program executions would be required to successfully perform this attack?
Options
- /bin/login
- /bin/RSA
- /bin/RSA_Generation
- /bin/Root
Performing DNS enumeration on a Networkv
Which of the following information can be gathered by performing DNS enumeration on a Network?
1. usernames
2. computer names
3. IP addresses of potential target systems.
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Types of IP attacks
The following IP address in the web logs is found connecting to contiguous ports and each of its connections always have a time_wait status.
192.168.3.4
What kind of attack is the compromised IP executing?
Options
- DDOS
- Clickjacking
- Session hijack
- XSS
Performing a bounce attack to breach a network
You are using a binary file payload delivery from a FTP server during a bounce attack to breach a network.
Which of these logs would you modify/corrupt to stop the network administrator from identifying the source of the attack?
Options
- Crash Log
- Session Log
- Error Log
- None of these
Performing a reflection-based distributed denial of service
You want to perform a reflection-based distributed denial of service (DDoS) attack that turns a small DNS query into a much larger payload.
Which of these extensions to the DNS protocol for a DNS request can be used to do so?
Options
- EDNS0
- WDNS8
- FDNS1
- KDNS2
Performing a NetBIOS Enumeration on a Network
Which of the following information can be gathered by performing a NetBIOS Enumeration on a Network?
1. List of computers that belong to a domain.
2. List of shares on the individual hosts on the network.
3. Policies and passwords.
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Using the Firewall level detection mechanism
You want to use the Firewall level detection mechanism to monitor any port scanning activity in a network that needs to be exploited.
Which of these port scanning techniques would you use to infiltrate the network without being detected?
Options
- SYN Scan
- ACK SCAN
- TCP connect()
- FTP Bounce Scan
Hooks in React
You are using the following code to extract previous props/state while using hooks(not custom hooks).
function Counter() { const [count, setCount] = useState(1); X } What can be used in place of X to complete it? Options 1.const prevCountRef = useRef(); useEffect(() => { prevCountRef.current = count; const prevCount = prevCountRef.current }); 2.const prevCountRef = useRef(); useEffect(() => { prevCountRef.current = count; }); const prevCount = prevCountRef.current; 3.function usePrevious(value) { const ref = useRef(); useEffect(() => { ref.current = value; }); return ref.current; } 4.function usePrevious(value) { const ref = useRef(); useEffect(() => { ref.current = count; }); return ref.current; }
The State of Components
A component that uses state has two snippets of code as given here
A
<h1>It is {this.state.date.toLocaleTimeString()}.</h1>
B.
<MyStuff thing={this.state.thing} />
Which of the snippets may lead to issues in the architecture?
Options
- Both A and B are fine. The children receive the state as props
- Yes, this is fine for A but not for B since user defined components would have their own state
- Yes, this is fine for A but not for B since user defined components would have their own stateYes, this is fine for B, but not for A, since the state can be modified in the child with unpredictable consequences
- No, this is not fine for either A or B since the state may be cascaded and would lead to unpredictable re-rendering
Operations in Node
Each request to a web server is taking 40 ms to complete and 35ms of that 40ms is database I/O that can be done asynchronously.
Which of the following operations will you use if you want that 35 ms per request to get freed up to handle other requests?
Options
- Non-blocking asynchronous operations
- Blocking asynchronous operations
- Non-blocking synchronous operations
- Blocking synchronous operations
Responses in Express
Which of this request-level information cannot be exposed using the property res.locals in the below given code snippet?
app.use(function(req, res, next){ res.locals.user = req.user; res.locals.authenticated = ! req.user.anonymous; next(); });
Options
- request path name
- authenticated user
- user settings
- download path name
Query for the User
Which of these queries can be used If you want to find all MongoDB users who do not have the username “John”?
Options
1.db.users.find({"username" : {"$ne" : "John"}}) 2.db.users.find({"username" : {"$not" : "John"}}) 3.db.users.find({"username" : {"$else" : "John"}}) 4.db.users.find({"username" : {"$except" : "John"}})
Node Streams
In Node.js you are using the .pipe() function to transfer data from one process to another. The write queue is currently busy and so .write() returns a false value.
Which of the following event will be emitted once the data buffer is emptied to resume the incoming data flow in this situation?
Options
- .drain()
- .read()
- .transform()
- .duplex()
Counter problem
You are writing a program which intends to increment the "hitCount" property of the "Analytics" object every time the http server gets a request.
Which of the following code segment(s) will work as intended?
Options
- var Analytics = { hitCount: 10, gotHit: function() { this.hitCount++; } } var http = require('http'); var server = http.createServer(function(req, res) { // process the request }); server.on('connection', Analytics.gotHit.bind(Analytics)); server.listen(80, '0.0.0.0');
- var Analytics = { hitCount: 10, gotHit: function() { this.hitCount++; } } var http = require('http'); var server = http.createServer(function(req, res) { Analytics.gotHit(); // process the request }); server.listen(80, '0.0.0.0');
- var Analytics = { hitCount: 10, gotHit: function() { this.hitCount++; } } var http = require('http'); var server = http.createServer(function(req, res) { // process the request }); server.on('connection', Analytics.gotHit); server.listen(80, '0.0.0.0');
- Both 1,2
- Both 1,3
Serving static images in Express
You want to serve static images in two different directories named thisd and thatd.
Which of these code snippets can you use to do this?
Options
1.app.use(express.static('thisd')) app.use(express.static('thatd')) 2.app.use(express.static('thisd',"thatd")) 3.app.use('static', express.static('thisd')) app.use('static', express.static('thatd')) 4.app.use('static', express.static('thisd',"thatd"))
Keys in MongoDB
Which of these characters are not allowed in key when storing data in key:value form?
Options
- \0
- . (dot character)
- $
- Only choice 1 and 2
- All of them ( Choice1,2 and 3)
Session Middleware in Express
You are using the express-session middleware for cookie session maintenance.
What consideration would you need to take in case you want to use this for a production environment?
Options
- You should never use it in a production environment
- You should use an in-memory store in the production environment
- You should set up a session store for the production environment
- No changes are necessary
ASP .NET Core MVC
You are using ASP.NET Core MVC.
In the given context, which of the the following is TRUE?
1. The view component and the controller component depends on the model component.
2. The model component depends on the view component and the controller component.
3. The model component neither depends on the view component nor the controller component.
Options
- Only 1
- Only 2
- Both 1 and 3
- Both 1 and 2
Fix this error
Which of these lines of codes in the code snippet given below will throw a compilation error?
public class Sample { public static void Main() { //L1 int num = 4; int A = Square(num); //L2 int B = Square(12); //L3 int C = Square(A * 3); } static int Square(int i) { int input = i; return input * input; } }
Options
- Only L1
- Only L2
- Only L3
- All L1, L2 and L3
- No error will be thrown
Delegates in C#
Which of the following code snippets would successfully convert any expression into a delegate?
Options
1.Expression<Func<int>> subtract = () => 4 -3; var sub = subtract.Compile(); var result = sub(); Console.WriteLine(result); 2.Expression<Func<int> subtract ()> => 4 -3; var sub = compile(subtract); var result = sub(); Console.WriteLine(result); 3.Either 1 or 2 4.None of these
Predict the output
Predict the output of the following code snippet.
string sentence = "Good Morning World"; string[] words = sentence.Split(' '); foreach (var word in words) { System.Console.WriteLine($"<{word}>"); }
Options
1.<Good>
<>
<>
<>
<Morning>
<World>
2.
<Good>
<Morning>
<World>
3.<Good>
<>
<Morning>
<World>
4.None of these
Boxing in C#
What type of boxing is being implementing in the code snippet given below?
int a = 100; object obj = (object)a;
Options
- Implicit boxing
- Explicit boxing
- Test boxing
- Declarative boxing
Entity Framework
Which of the following statements regarding entity framework features are TRUE?
1) Entity Framework performs automatic transaction management while querying or saving data.
2) Entity Framework does not allow you to configure the EF model by using data annotation attributes
3) Entity Framework does not allow you to configure the EF model by using Fluent API to override default conventions
Options
- 1
- 1,2
- 1,3
- 1,2,3
Iterating over a collection
You are iterating over a collection when working with C# in .Net.
In the given context, which of these is a valid syntax for the finally clause when there is no implicit conversion from the type of enumerator to IDisposable?
Options
1.finally { (enumerator as IDisposable)?.Dispose(); } 2.finally { } 3.finally { ((IDisposable)enumerator).Dispose(); } 4.None of these
Configuration in MVC .NET
You created the given option class while doing configuration in MVC .NET.
public class PositionOptions { public const string Position = "Position"; public string Title { get; set; } public string Name { get; set; } }
In this context, which of these statements is TRUE?
Options
- While making this option class you ensured that all public read-write properties of the type are unbound.
- While making this option class you ensured that the class is abstract with a private parameterless constructor.
- While making this option class you ensured that the class is non-abstract with a public parameterless constructor.
- None of these
Entity framework views
Read the two statements regarding entity framework views given below and choose the correct choice.
1) Entity framework view is similar to a real table because it contains columns and rows of data
2) Entity framework view can be used to centralise data distributed across several servers
Options
- Statement 1 is true and statement 2 is false
- Statement 1 is false and statement 2 is true
- Both statements are true
- Both statements are false
Using NameClasses
You want to communicate over the Internet when creating peer-to-peer applications.
Which of these NameClasses from the .NET Framework Class Library would you use to do so?
Options
- System.Data
- System.Net
- System.Web
- System.Peer
SQL Query to select all the records
You are using the following MySQL query to select all records from tables Products and Sales.
SELECT *
FROM Products
XXX
ON Products.SalesID=Sales.SalesID;
What should be used in place of XXX to return records matching in both tables?
Options
- INNER JOIN Sales
- INNER JOIN SalesID
- INNER JOIN Sales.SalesID
- INNER JOIN Products
Design a prototype
You want to convert the visual presentation of a user interface design to a functioning HTML page. In the given scenario, which of these steps should you implement to reflect your design decisions?
A) Create CSS styles using prototyped page
B) Create masterpage and templates
C) Create a page that contains both masterpage and content page
Options
- A
- B
- C
- None of these
Draw behind the outline
You want to draw behind the outline in CSS3 using a user interface property.
Which of these properties can be used to achieve this?
Options
- outline-offset
- nav-outline
- nav-offset
- content-offset
Style Sheets in CSS
When adding styles to a page, you want to link the CSS file to a page and place the link in the head section of the page after the CSS Link SharePoint control.
In the given scenario, which of these style sheets should you use keeping in mind its ease of maintainance and flexibility?
Options
- Internal Style Sheets
- Cascading Style Sheets
- External Style Sheets
- None of these
Responsiveness in HTML
In which of the following scenarios will a image be responsive and scale up and down when working with HTML?
Options
- If the CSS width property is set to 100%
- f the max-width property is set to 100%
- Both 1 and 2
- Neither 1 nor 2
Forms in HTML
<form> <label for="email">Email</label> <input required type="email" id="email" name="email" /> <input type="submit" /> </form>
Analyze the above given code snippet and choose the correct option with respect to the given statement.
Statement 1: INPUT type tells the browser that the content of this field should look like
an email address.
Statement 2: Required type check to see whether the email address exists.
Options
- Only Statement 1 is correct
- Only Statement 2 is correct
- Both the statement are correct
- Neither of the statement is correct
Child tag color in HTML
What will be the color of the child p tag contents when the HTML5 snippet given below is rendered?
<p style = "color: green"> hello <p style = "color: red"> world </p> </p>
Options
- green
- red
- yellow
- black
An Inheritance issue
Which of the following deductions can be made from the code snippet given below?
class A { { System.out.println(1); } } class B extends A { { System.out.println(2); } } class C extends B { { System.out.println(3); } } class D extends B { { System.out.println(4); } }
Options
- Class A is the only child of class C because it comes after class B and therefore overrides it
- Class B is a child for two different classes
- Class B is a parent to both classes C and D
- Class C is only a parent to class B
- Class D is a child of class A because it is underneath it
Problem with Classes
What is the result of compiling and executing the code snippet given below?
1. class Outer_Demo { 2. private int num = 175; 3. public class Inner_Demo { 4. public int getNum() { 5. 6. return num; 7. } 8. } 9. } 10. 11. public class My_class2 { 12. public static void main(String args[]) { 13. Outer_Demo outer = new Outer_Demo(); 14. Outer_Demo.Inner_Demo inner = outer.newInner_Demo(); 15. System.out.println(inner.getNum()); 16. } 17. } Options 1.175 2.Compilation error at line 14 3.Compilation error at line 15 4.Runtime error
Debug the interface problem
You implemented the two functional interfaces, as shown in the Java 8 code snippet given below.
public class University{ @FunctionalInterface interface TheoryMarks{ abstract float theoryMarks(); } @FunctionalInterface interface PracticalMarks extends TheoryMarks{ abstract float practicalMarks(); public static void printMarks() { System.out.println("Calculation of marks"); }}}
However, the code is returning a compilation error. What could be the reason for receiving this compilation failure?
Options
- Static method is defined after the abstract method
- A functional interface cannot extend another functional interface
- The PracticalMarks interface will have two abstract method
- Methods are not mentioned as public abstract
Using Angular Hooks
Which of these Hook methods respond when angular sets or resets data-bound input properties?
Options
- ngRespond()
- ngOnChanges()
- ngReset()
- ngOnSet()
Debug the service
Assume that an angular service worker changes the version of a running app.
Which of these can be valid reasons for such behaviour?
Options
- The page is reloaded/refreshed.
- The current version becomes invalid due to a failed hash.
- An unrelated error causes the service worker to enter safe mode
- Only Choice 1 amd Choice 2
- All of these
Working with Angular Components
You are using the following angular code to pass data from parent to child with input binding.
import { Component, Input } from '@angular/core'; import { Hero } from './hero'; @Component({ selector: 'app-hero-child', template: ` {{hero.name}} says: I, {{hero.name}}, am at your service, {{masterName}}. ` }) export class HeroChildComponent { @Input() hero: Hero; XXX }
What can be used in place of XXX to alias the child component property name masterName as 'master'?
Options
1.@Input('master') masterName; 2.@Input('master') masterName: string; 3.@Input(master) 'masterName'; 4.@Input(master:string) 'masterName';
Refactor the Code
Which of these code snippets can be used to refactor the below given code?
@Component({...}) export class AppComponent implements OnInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngOnInit() { console.log(this.input); } }
Options
1.@Component({...}) export class AppComponent implements AfterViewInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngAfterViewInit() { console.log(this.input); } } 2.@Component({...}) export class AppComponent implements AfterViewInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngAfterViewInit() { console.log(this.input); } } 3.@Component({...}) export class AppComponent implements OnInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngAfterViewInit() { console.log(this.input); } } @Component({...}) export class AppComponent implements OnInit { @ViewChildren('username') input: ElementRef<HTMLInputElement>; ngOnInit() { console.log(this.input); } } 4.None of these
Working with Routes in Angular
<nav> <a class="button" routerLink="/A-list" routerLinkActive="activebutton">A Center</a> | <a class="button" routerLink="/B-list" routerLinkActive="activebutton">B</a> </nav>
Which of the following interferences can be made with respect to the code snippet given above?
1. As you click one of the buttons, the style for that button updates automatically, identifying the active component to the user.
2. By adding the routerLinkActive directive, you inform your application to apply a specific CSS class to the active route.
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Problem on threads
Which of these deductions can be made from the code snippet given below?
class A { { System.out.println(1); } } class B extends A { { System.out.println(2); } } class C extends B { { System.out.println(3); } } class D extends B { { System.out.println(4); } }
Options
- Class A is the only child of class C because it comes after class B and therefore overrides it
- Class B is a child for two different classes
- Class B is a parent to both classes C and D
- Class C is only a parent to class B
- Class D is a child of class A because it is underneath it
Working with Interfaces
Determine the output of the given code snippet.
interface Foo { String name = "Foo"; void print(); } class Bar implements Foo { String name = "Bar"; public void print() { System.out.println(name); // Line 1 } public static void main(String[] args) { Foo foo = new Bar(); // Line 2 foo.print(); // Line 3 } }
Options
- Foo
- Bar
- Compilation failure at Line 1
- Compilation failure at Line 2
- Compilation failure at Line 3
An Inheritance issue
Which of the following deductions can be made from the code snippet given below?
class A { { System.out.println(1); } } class B extends A { { System.out.println(2); } } class C extends B { { System.out.println(3); } } class D extends B { { System.out.println(4); } }
Options
- Class A is the only child of class C because it comes after class B and therefore overrides it
- Class B is a child for two different classes
- Class B is a parent to both classes C and D
- Class C is only a parent to class B
- Class D is a child of class A because it is underneath it
Problem with Classes
What is the result of compiling and executing the code snippet given below?
1. class Outer_Demo { 2. private int num = 175; 3. public class Inner_Demo { 4. public int getNum() { 5. 6. return num; 7. } 8. } 9. } 10. 11. public class My_class2 { 12. public static void main(String args[]) { 13. Outer_Demo outer = new Outer_Demo(); 14. Outer_Demo.Inner_Demo inner = outer.newInner_Demo(); 15. System.out.println(inner.getNum()); 16. } 17. }
Options
- 175
- Compilation error at line 14
- Compilation error at line 15
- Runtime error
Debug the interface problem
You implemented the two functional interfaces, as shown in the Java 8 code snippet given below.
public class University{ @FunctionalInterface interface TheoryMarks{ abstract float theoryMarks(); } @FunctionalInterface interface PracticalMarks extends TheoryMarks{ abstract float practicalMarks(); public static void printMarks() { System.out.println("Calculation of marks"); }}}
However, the code is returning a compilation error. What could be the reason for receiving this compilation failure?
Options
- Static method is defined after the abstract method
- A functional interface cannot extend another functional interface
- The PracticalMarks interface will have two abstract method
- Methods are not mentioned as public abstract
The State of Components
A component that uses state has two snippets of code as given here
A<h1>It is {this.state.date.toLocaleTimeString()}.</h1>
B.<MyStuff thing={this.state.thing} />
Which of the snippets may lead to issues in the architecture?
Options
- Both A and B are fine. The children receive the state as props
- Yes, this is fine for A but not for B since user defined components would have their own state
- Yes, this is fine for B, but not for A, since the state can be modified in the child with unpredictable consequences
- No, this is not fine for either A or B since the state may be cascaded and would lead to unpredictable re-rendering
React Context Usage
You want to test a component in react in isolation without wrapping it.
What feature of method React.createContext would be useful for testing if it is used to create a context object?
Options
- The use of the defaultValue argument
- The ability to pass undefined as a Provider value
- The ability to assign contextType property
- None of these
Methods and Rendering in React
You have to reset some state when a prop changes using the getDerivedStateFromProps(). However, you observe that this make your code verbose.
Which of these steps should you take to avoid this?
Options
- Make the component fully controlled or fully uncontrolled with a key
- Use componentDidUpdate lifecycle
- Use a memoization helper
- Make the child components to re-render
Hooks in React
You are using the following code to extract previous props/state while using hooks(not custom hooks).
function Counter() { const [count, setCount] = useState(1); X }
What can be used in place of X to complete it?
Options
1.const prevCountRef = useRef(); useEffect(() => { prevCountRef.current = count; const prevCount = prevCountRef.current }); 2.const prevCountRef = useRef(); useEffect(() => { prevCountRef.current = count; }); const prevCount = prevCountRef.current; 3.function usePrevious(value) { const ref = useRef(); useEffect(() => { ref.current = value; }); return ref.current; } 4.function usePrevious(value) { const ref = useRef(); useEffect(() => { ref.current = count; }); return ref.current; }
Rendering in React DOM
You have a requirement wherein you have to render a React element into a root DOM node.
What will you pass to the ReactDOM.render() method to do so?
Options
- React Element
- Root DOM node
- Both React element and Root DOM node
- React element along with an empty text node
State Variables in React
Which of these state variable assignments using the state hooks are valid?
A:
const [item, setItem] = useState(4);
B:
const [foo, setFoo] = useState('text');
C:
const [stuff, setStuff] = useState([{ text: 'things' }]);
Options
- A
- A,B
- B,C
- A,B,C
State management in React
What can be said about the React v17 code snippet given below?
this.setState({ counter: this.state.counter + this.props.increment, });
Options
- The counter is updated successfully
- It may fail to update the counter
- this.state and this.props update synchronously
- Both Choice 1 and 3
- Both Choice 2 and 3
Using Pure Components
Which of the following components declared in React v17.0.1 is pure?
//Function1 function sub(a, b) { return a - b; } //Function2 function del(a, b) { at.total -= b; }
Options
- Function1
- Function2
- Both Function1 and Function2
- Neither Function1 nor Function2
Using higher order Components
You have built a component X when working in React. Now, you want to reuse X's logic using a higher order component.
What can you do to achieve this?
Options
- Modify the input component
- Use inheritance to copy X's behavior
- Compose the component 'X' by wrapping it in a container component
- None of these
Using the DI pattern
Which of the following are valid statements that can be made about the Dependency Injection design pattern?
S1: The injector class of the DI pattern creates an object of the service class.
S2: The DI pattern separates the responsibility of creating an object of the service class out of the client class.
Options
- Only S1
- Only S2
- Both S1 and S2
- Neither S1 and S2
Align items along the row axis
You are working on aligning items along the row axis of a certain table.
In the given scenario, which of these values would justify-item not support?
Options
- Dynamic
- Normal
- Start
- Auto
Changing borders without triggering layout
Which of these elements can be used to change the border without triggering layout in a webpage when working with CSS?
Options
- Using border-width
- Using outline
- Using hover: onfocus
- Using trigger:onfocus
HTML Span attributes
Consider the snippet given below.
<X style="background-color:black;color:white;padding:20px;"> <h2>London</h2> <p>London is the capital city of England. It is the most populous city in the United Kingdom.</p> </X>
Here, X is used as a container for other HTML elements and has no required attributes. However, style, class and id are common. What could X be in this context?
Options
- Span
- Div
- class
- id
Responsiveness in HTML
In which of the following scenarios will a image be responsive and scale up and down when working with HTML?
Options
- If the CSS width property is set to 100%
- If the max-width property is set to 100%
- Both 1 and 2
- Neither 1 nor 2
Substring Matching Attribute Selectors
You want to use the begins with selector provided in the Substring Matching Attribute Selectors of CSS3.
Which of these is an appropriate way to do so?
Options
1.[att^=val]
2.[att$=val]
3.[att*=val]
4.[att%=val]
Progressive enhancement in CSS
You are asked to perform the progressive enhancement for the CSS3 code of a website for multiple screen sizes. Which of the following can be used to accomplish this task?
1. text-shadow
2. box-shadow
3. border-radius
Options
- Only 1
- Only 2 and 3
- Only 1 and 3
- All 1, 2 and 3
HierarchyRequestError in CSS
The violation of which of these CSS restrictions results in the error shown below?
HierarchyRequestError
Options
- Insertion of rule at index 0
- Index> CSSRuleList.length
- Insertion of an @import at-rule after a style rule
- Both Choice 1 and 2
- Both Choice 1 and 3
Forms in HTML
<form> <label for="email">Email</label> <input required type="email" id="email" name="email" /> <input type="submit" /> </form>
Analyze the above given code snippet and choose the correct option with respect to the given statement.
Statement 1: INPUT type tells the browser that the content of this field should look like
an email address.
Statement 2: Required type check to see whether the email address exists.
Options
- Only Statement 1 is correct
- Only Statement 2 is correct
- Both the statement are correct
- Neither of the statement is correct
List tags in HTML
What is the output of the code snippet given below?
<html> <body> <ul> <ol> <li>A</li> <dt>B</dt> <dd>C</dt> <li>D</li> </ol> <li>E</li> </ul> </body> </html>
Options
- 1.A
B
C
2. D
E
- 1. A
B
C
2. D
3. E
- 1. A
B
C
2. D
iii. E
- 1. A
B
C
2. D
. E
Child
tag color in HTML
What will be the color of the child p tag contents when the HTML5 snippet given below is rendered?
<p style = "color: green"> hello <p style = "color: red"> world </p> </p>
Options
- green
- red
- yellow
- black
Building an Android application in React Native
You are building an Android application in React native.
In the given context, which of these properties can be used to utilize TalkBack to alert the end user when a component changes dynamically?
Options
- accessibilityViewIsModa
- accessibilityLiveRegion
- accessibilityVoiceAlert
- AccessibilityDetectChange
Building a website using React Native
When building a website using React Native. You want to ensure that when a user presses the back button, the browser pops the item from the top of the history stack, so the active page is the previously visited page.
How can this be accomplished?
- This can be accomplished using the built-in idea of a global history stack like a web browser does.
- This can be accomplished using React Navigation
Options
- Only 1
- Only 2
- Both 1 and 2
- Either 1 or 2
Using ImageViews in JavaScript
You want to use ImageViews in JavaScript while building an Android application in React native.
Which of these annotations can be used to expose view property setters while doing so?
Options
- @ReactProp
- @ReactPropGroup
- @ReactComponent
- Only Choice 1 and Choice 2
- Only Choice 1 and Choice 3
Make live changes to styles
You see margins and padding when you tap on an animated gif in a React native view. Which of these can be used to make live changes to styles in the given context?
1) Built-in inspector
2) Hot reloading
3) React inspector
Options
- 1,2
- 2,3
- 1,3
- 1,2,3
Touchable highlights in React Native
Read the following statements about touchable highlights and choose the right answer.
1) When a user presses the touchable highlight, it will get lighter and the underlying color will show through.
2) When a user uses touchable native feedback, it will simulate ink animation.
Options
- Statement 1 is true and statement 2 is false
- Statement 1 is false and statement 2 is true
- Both statements are true
- Both statemnts are false
Determine the alignment of children
You are adding alignment to a component's style in React native to determine the alignment of children along the secondary axis.
If you have chosen the alignment as 'stretch', which of the following components will allow the stretch to have an effect?
Options
- Children having a fixed dimension along the secondary axis
- Children not having a fixed dimension along the secondary axis
- Children having a fixed dimension along the primary axis
- Children having a variable dimension along the primary axis
Encounter with an error
What can be the most appropriate reason if you are faced with the following error?
> Invariant Violation: Element type is invalid
Options
- This error occurs when you are trying to use a font that is not bundled with the platfrom
- This error occurs when Linking has not been completed
- This error occurs when you are misssing some packages after a git pull
- This error occurs when trying to import a component that doesn't exist
Working with StyleSheet API methods
Which of these StyleSheet API methods in React native can be used to lookup IDs, returned by StyleSheet.register?
Options
- flatten
- compose
- StyleAttributePreprocessor
- getStyleAttributePreprocessor
Detect which platform the React Native application is running
The code snippet given alongside is used to detect which platform the React Native application is running on. Which of the given alternative methods can be used for the same purpose?
clickMe() {
var message = ‘';
if(Platform.OS == ‘ios') {
message = ‘Welcome to iOS!';
} else if(Platform.OS == ‘android') {
message = ‘Welcome to Android!';
}
Alert.alert(message);
}
Options
- You can use the select method
- You can use the virtual DOM method
- You can use the render method
- There is no alternative method
Valid use cases for React Native – View
Which of these are valid use cases for React Native - View?
1) View also supports synthetic touch events, which can be useful for different purposes
2) When you need to wrap your elements inside the container, you can use View as a container element
Options
- 1
- 21
- 1 and 2
- None of these
Working with Forms in Angular
@Directive({ selector: '[appForbiddenName]', providers: [{provide: NG_VALIDATORS, useExisting: ForbiddenValidatorDirective, multi: true}] }) export class ForbiddenValidatorDirective implements Validator { @Input('appForbiddenName') forbiddenName: string; validate(control: AbstractControl): {[key: string]: any} | null { return this.forbiddenName ? forbiddenNameValidator(new RegExp(this.forbiddenName, 'i'))(control) : null; } }
Which of the following is true about the code snippet given above?
1. NG_VALIDATORS is a predefined provider with an extensible collection of validators.
2. You can add its selector, appForbiddenNamence once the ForbiddenValidatorDirective is ready,
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Debug the Typescript issue
While developing an Angular application, you get errors of the type "implicit index errors". Which of these actions is recommended to be taken to eliminate such errors?
1: Set noImplicitAny flag to false
2: Set suppressImplicitAnyIndexErrors to true
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Debug the service
Assume that an angular service worker changes the version of a running app.
Which of these can be valid reasons for such behaviour?
Options
- The page is reloaded/refreshed.
- The current version becomes invalid due to a failed hash.
- An unrelated error causes the service worker to enter safe mode
- Only Choice 1 amd Choice 2
- All of these
Working with Angular Components
You are using the following angular code to pass data from parent to child with input binding.
import { Component, Input } from '@angular/core'; import { Hero } from './hero'; @Component({ selector: 'app-hero-child', template: ` {{hero.name}} says: I, {{hero.name}}, am at your service, {{masterName}}. ` }) export class HeroChildComponent { @Input() hero: Hero; XXX }
What can be used in place of XXX to alias the child component property name masterName as 'master'?
Options
1.@Input('master') masterName; 2.@Input('master') masterName: string; 3.@Input(master) 'masterName'; 4.@Input(master:string) 'masterName';
Working with Routes in Angular
<nav> <a class="button" routerLink="/A-list" routerLinkActive="activebutton">A Center</a> | <a class="button" routerLink="/B-list" routerLinkActive="activebutton">B</a> </nav>
Which of the following interferences can be made with respect to the code snippet given above?
1. As you click one of the buttons, the style for that button updates automatically, identifying the active component to the user.
2. By adding the routerLinkActive directive, you inform your application to apply a specific CSS class to the active route.
Options
- Only 1
- Only 2
- Both 1 and 2
- Neither 1 nor 2
Use the Observable
Which of these classes is used when publishing values from a component through the @Output() decorator in angular?
Options
- EventEmitter class
- CustomEvents class
- Subscribe class
- Transform class
Using Angular Hooks
Which of these Hook methods respond when angular sets or resets data-bound input properties?
Options
- ngRespond()
- ngOnChanges()
- ngReset()
- ngOnSet()
Working with Selectors
You are using the :host pseudo-class selector to target styles in the element that hosts the component in Angular.
What can you achieve by using function form when doing so?
Options
- You can apply host styles conditionally
- You can include another selector inside the host
- You can target the host element
- You can host element inside parent's component
Refactor the CodeRefactor the Code
Which of these code snippets can be used to refactor the below given code?
@Component({...}) export class AppComponent implements OnInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngOnInit() { console.log(this.input); } }
Options
1.@Component({...}) export class AppComponent implements AfterViewInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngAfterViewInit() { console.log(this.input); } } 2.@Component({...}) export class AppComponent implements OnInit { @ViewChild('username') input: ElementRef<HTMLInputElement>; ngAfterViewInit() { console.log(this.input); } } 3.@Component({...}) export class AppComponent implements OnInit { @ViewChildren('username') input: ElementRef<HTMLInputElement>; ngOnInit() { console.log(this.input); } } 4.None of these
Styling Components
Which of the following is a valid way to add styles to a component in Angular?
1. By setting styles metadata.
2. By setting styleUrls metadata.
3. With CSS imports.
Options
- Either 1 or 3
- Either 2 or 3
- Either 1 and 2
- All 1, 2 or 3
Improve flexibility of the component
A snippet from a component is given below.
const whatthisis = { template: '<div>Whatthisis {{ $route.params.id }}</div>' } You find that the component is tightly coupled with the route and that the flexibility of the component is reduced. What should you use to improve flexibility in the given scenario?
Options
- Use nested routes
- Use props
- Use a navigation guard
- None of the above
Edit chip series (tags)
In vue material, you are editing a chip series(tags) and want to ensure that you can hold a delete action.
Which of the following boolean parameters in the md-chip API are you likely to use for doing so?
Options
- md-clickable
- md-deletable
- md-disabled
- v-model
Building a docker in Vue
You have installed a vue-cli-plugin-docker-nginx plugin and built a docker. However, you want to run the docker in a different port.Which of these code snippets would you add to your package.json script to do so?
Options
1."docker": "docker build . -t docker run -d -p <PORT>:xx vue-app" 2."docker": "docker build . -t vue-app -d -p <PORT>:xx vue-app" 3."docker": "docker build . -t vue-app && docker run -d -p <PORT>:xx vue-app" 4."docker": "docker build . -t vue-app && docker run -d -p:xx vue-app"
Named routers
Given below is a snippet.<router-link :to="{ name: 'mine', params: { id: 77 }}">Name</router-link> How would you accomplish the same result programmatically?
Options
1.router.push({ name: 'mine', params: { id: 77 }}) 2.router.push({ name: 'mine', query: { id: 77 }}) 3.router.push({ name: 'mine', params: { id: 77 }, value:"Name"}) 4.router.push({ name: 'mine', query: { id: 77 }, value:"Name"})
Hiding Elements in Vue 2.0
You are using the following line of code to hide elements under a certain condition when using element UI for vue 2.0.hidden-md-and-down Which of these files should be imported to do so?
Options
- element-ui/lib/theme-chalk/disp.css
- element-ui/lib/theme-chalk/display.css
- element-ui/theme-chalk/display.cs
- element/lib/theme-chalk/display.css
Migrate from vue 1.x to vue 2.x
You have written the code given below in vue 1.x.
props: { name: { type: String, coerce: function (value) { return value .toLowerCase() .replace(/\s+/, '-') } } } If you port the same code to vue 2.x, what would be the equivalent code?
Options
1.props: { name: String ::coerce: { name: function () { return this.name|.toLowerCase() .replace(/\s+/, '-'); } } 2.props: { name: String=>coerce: { normalize().name: function (){ return this.username .toLowerCase() .replace(\s+/, '-') } } 3.props: { name: String, }, computed: { normalized name: function () { return this.name .toLowerCase() .replace(/\s+/, '-') } } 4.props: { name: String, }, computed: { return this.name .toLowerCase() .replace(\.()s+/, '-') } }
Render server side routing
You are required to render server side routing for large bundles such that the amount of assets that need to be downloaded for the intial render is reduced.
Which of the following method should you implement to achieve this?
Options
- Data Pre-Fetching
- Code-Splitting
- Routing
- Server store fetching
Create router for your vue.js application
You are using the following nested path when creating a router for your application./members Is this a valid path? If so, what can it be used for?
Options
1.No, it is not a valid path
2.Yes, it is a valid path and can be used to leverage component nesting without having to use a nested URL
3.Yes, it is a valid path and can be used to impelment component nesting without using the children option is just another Array of route configuration objects
4.Yes, it is a valid path and can be used to impelment component nesting without using sub route matching
Create sequential entrance animation
You need to create sequential entrance animation in your UI.
Which of the following options is the correct way to do so for a Vue.js plugin?
Options
1.Vue.use(animation); <template> <sequential-entrance> <div class="box" v-for="app in apps" :key="app">{{ app }}</div> </sequential-entrance> </template> 2.Vue.use(SequentialEntrance); <template> <sequential-entrance-animation> <div class="box" v-for="app in apps" :key="app">{{ app }}</div> </sequential-entrance-animation> </template> 3.Vue.use("template"); <template> <sequential-entrance> <div class="box" v-for="app in apps" :key="app">{{ app }}</div> </sequential-entrance> </template> 4.Vue.use(SequentialEntrance); <template> <sequential-entrance> <div class=""box"" v-for=""app in apps"" :key=""app"">{{ app }}</div> </sequential-entrance> </template>"
Convert v-dialog component to full-screen dialog
You have a v-dialog component in vuetify that needs to be converted to a full-screen dialog on smartphones without binding watchers or checking for page load.
Which of the following would help you achieve this?
Options
- Breakpoints
- Sandbox
- Transitions
- Grid lists
Classic Load Balancer monitoring
Which of the following tasks would need to be performed if the Classic Load Balancer monitoring requires you to enable access logs?
1.Create an S3 Bucket
2.Attach a Policy to Your S3 Bucket
3. Verify that the Load Balancer Created a Test File in the S3 Bucket
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All of these
Ensure the right login security
As a security administrator, you want to ensure that right login security principles are applied to all the users for their AWS account.
Which of the following should be a part of right security measures to be put in place?
Options
- Delete any access keys which are present for the root account.
- Ensure that the root account is used for privileged account activities
- Have a rotation policy in place for changing the root account password.
- Both choice 1 and 3
- All of these
Preserve client IP address
You are working with target groups in AWS Network Load Balancer. In the given scenario which of these can be used to preserve client IP address while registering the instances?
1. Instance ID
2. Source IP addresses
Options
1.Only 1
2.Only 2
3.Both 1,2
4.None of these
Access logs in Elastic load balancing
Which of the given statements regarding the usage of access logs in Elastic load balancing are appropriate?
Options
- Use logs to to understand the nature of the requests
- Use logs to maintain a complete accounting of requests
- Use logs to perform a detailed health check
- None of these
Valid types of Health checks
Which of these are valid types of Health checks that can be created on Route 53?
1. Health checks that monitor an endpoint
2. Health checks that monitor other health checks
3.Health checks that monitor CloudWatch alarms
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Display the statistics in the most cost-efficient way
You are asked to develop a feature for an application hosted on AWS. The feature must display the number of times the website has been visited or clicked. You have decided to invoke a lambda function to the show the required statistics.
In the given context, what is the most cost efficient and straightforward way to show the statistics at 8:00 AM GMT?
Options
1.Create an AWS CloudWatch Events rule that is scheduled using a cron expression as “0 08 ** ?*”. Configure the target as the Lambda function.
2.Create an Amazon Linux EC2 T2 instance and set up a Cron job using Crontab. Use AWS CLI to call your AWS Lambda every 8:00 AM.
3.In AWSCloudWatch Events console, click “Create Event” using the cron expression “*?* * 08 00”. Configure the target as the Lambda function
4.Use Amazon Batch to set up a job with a job definition that runs every 8:00 AM for the Lambda function.
Grant permission to the S3 Bucket
You are using Amazon S3 to store artifacts while running MOF files to create associations in AWS systems manager to manage state. In the given context which of these should be granted permissions to the S3 Bucket?
1. GetObject
2. ListBucket
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Define security policies
You are tasked to define security policies between a client and the Elastic Load Balancer.
What component will not be a part of security policy required for the negotiation between the client and the load balancer?
Options
- Client Order Preference
- SSL Ciphers
- Server Order Preference
- SSL Protocols
Select an instance forcefully
You are using target groups to configure a Network Load balancer.
In the given context which of these protocols will force you to select an instance when used by the target group?
1. UDP
2. TCP_UDP
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Deploy your web application
You want to deploy your web application from a Docker container to Elastic Beanstalk. In the given context which of these are valid ways to do so?
1. Create a Dockerfile to have Elastic Beanstalk build and run a custom image.
2.Create a Dockerrun.aws.json file to deploy a Docker image from a hosted repository to Elastic Beanstalk
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Optional flags in kube-apiserver
You want to ensure that all requests presenting a client certificate signed by any of the authorities mentioned in the client-ca-file are authenticated with an identity corresponding to the CommonName of the client certificate.
Which of these optional flags in kube-apiserver are you likely to set to achieve this?
Options
- --client-ca-file string
- --cloud-config string
- --contention-profiling
- --cors-allowed-origins stringSlice
Using the diff command
You are setting the KUBECTL_EXTERNAL_DIFF environment variable using the diff command.
In the given scenario, which of these are default options that are run while doing so?
Options
- -n
- -u
- -v
- Only 1,2
View the admission plugins
You want to view the admission plugins that are enabled while working with kube-apiserver.
Which of these commands can be utilized to do so?
Options
1.kube-apiserver -h | grep enable-admission-plugins 2.kube-apiserver -i | grep admission-plugins 3.kube-apiserver -d -admission-plugins=PodNodeSelector. 4.kube-apiserver -t -admission-plugins=PodNodeSelector.
Request and receive a new certificate
You want to allow the kubelet to request and receive a new certificate.
Which of the following need to be created for doing so?
Options
- RBAC Binding
- ClusterRoleBinding
- Node Region Binding
- ClusterMetadataBinding
Create a certificate signing request (CSR)
You want to create a certificate signing request (CSR) as well as retrieve it while authorizing a kubelet.
Which of these Clusterroles can be used for doing so?
Options
- system:node-bootstrapper
- system:node-region
- system:node-diff
- system:node-clustergroup
Fetch and refresh ECR credentials
You want to integrate Docker with Kubernetes while using Amazon Elastic Container Registry.
In the given scenario, which of these permissions need to be provided if you want the kubelet to be able to fetch and refresh ECR credentials?
1. ecr:GetAuthorizationToken
2. ecr:BatchCheckLayerAvailability
3. ecr:GetRepositoryPolicy
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Strip all managedFields
You want to strip all managedFields from an object by overwriting them. Which of these operations can be used to do so?
1. MergePatch
2.StrategicMergePatch
3. Update
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Bootstrap a Kubernetes worker node
You want to to bootstrap a Kubernetes worker node and join it to the cluster.
Which of these can be used for this purpose?
Options
- kubeadm join
- kubeadm inti
- kubectl join
- kubectl merge
Integrate Docker with Kubernetes
You want to integrate Docker with Kubernetes while using Amazon Elastic Container Registry.
In the given context if the nodes are AWS EC2 instances then which of these should be used in the Pod definition?
Options
- ECR registry
- full image name
- GCR registry
- kubelet token
Fix the issues with CRI-compatible container runtimes
You are debugging a Kubernetes cluster such that issues with CRI-compatible container runtimes can be fixed.
Which of these commands are you likely to use to only list image ID?
Options
1.cril images -s 2.crictl images -q 3.criclt images -k 4.cridbg img -h
Negating risk of application failure
You are asked to test the performance of a web application to negate the risk of application failure. Which of these factors would you assess while doing so?
1. System scalability
2. Spike user loads
3. Throughput level
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Testing multiple scenarios
You are conducting the usability review for a product. It is given that the scope of this review will depend on the following two things:
1. Complexity of the product
2. What you want to test
In the scope of this review, what will you do to test multiple scenarios by saving duplication of effort?
Options
You are conducting the usability review for a product. It is given that the scope of this review will depend on the following two things:
1. Complexity of the product
2. What you want to test
In the scope of this review, what will you do to test multiple scenarios by saving duplication of effort?
Options
- Keep the number of personas to a minimum and recycle them wherever possible
- Keep the number of personas to a minimum but do not recycle them
- Keep the number of personas to a maximum but do not recycle them
- Keep the number of personas to a maximum and recycle them wherever possible
Preventing memory leaks and problems with hardware
You are asked to performance test a website in order to prevent memory leaks or problems with hardware and servers.
Which of these types of performance testing are you likely to perform in this context?
Options
- Spike test
- Stress test
- Load test
- Soak testing
Performing Load Testing
You want to perform load testing on your software and to do so you use a strategy that does not produce repeatable results. You also notice this strategy cannot provide measurable levels of stress on the application.
Which of these Load Testing strategies is being referred to in the given context?
Options
- In house developed load testing tools
- Open source load testing tools
- Enterprise-class load testing tools
- Manual Load Testing
Lack of accelerators in a website
Assume that you are testing a web application and you find that there is lack of accelerators (like keyboard shortcuts etc.).
What do you think is mostly affected by this?
Options
- Utility
- Efficiency
- Learnability
- Attitude (or likeability)
Evaluating usability of an application
Assume that you have a common user task in the form of a scenario. You want to evaluate the usability of an application by testing how well the application supports this specific scenario.
Which of these will provide a proper means for this evaluation?
Options
- Cognitive walkthrough
- Heuristic based review
- Performance reviews
- No-web review
Software Testing & QA, L2, MCQs(Single Correct), Medium, Performance testing, Verified, Web Testing
When conducting usability testing of a web application, you find that observers begin to jump to conclusions after seeing only one or two participants. Some of them even begin to discuss design changes at that point itself. In contrast, you also notice patterns, but try to keep an open mind and avoid forming conclusions between sessions.
What should you do in the current scenario to help observers avoid directly jumping to conclusions?
Options
- Encourage observers to avoid making design decisions until you have analysed all of the data
- Emphasize the importance of keeping an open mind and avoiding premature conclusions before the test sessions
- Include the numbers of participants who made errors, took actions, and made comments in the deliverable that documents your findings
- All of the above
Sustaining sudden user load
You are asked to find a website's possibility to sustain sudden user loads.
Which of these types of performance tests are you likely to perform in order to determine this?
Options
- Spike test
- Stress test
- Load test
- Soak testing
Likelihood of exploit attribute
While analyzing the security of a web application, you find that it allows an externally-supplied input to serve as an argument for a program that is under its own control.
What would be the likelihood of exploit attributed to this vulnerability?
Options
- Low
- Medium
- High
- It cannot be determined
Assistive Technologies in a website
You have developed a website accessible to both disabled and non-disabled users. Which of the following assistive technologies is your website supposed to work well with with respect to the disabled users?
1. Notepad
2. Screen Readers
3. Camera
4. Screen Magnifiers
5. Voice Recognition Software
Options
- 1,2,3 & 4
- 2 & 5
- Only 1 & 2
- 2,4 & 5
- 3,4 & 5
Automatically fill the textbox with a value
You have created a web form which has a textbox to input some value. While testing this form in Selenium, you want to automatically fill the textbox with a value XBOX.
Which of the following lines of code will you use if the name of textbox is first and the id is one?
Options
1.WebElement input1 = driver.findElement(By.name("first")); input1.sendKeys("XBOX"); 2.WebElement input1 = driver.findElement(name == "first")); input1.value("XBOX"); 3.WebElement input1 = driver.findElement(UsingId("one")); input1.value("XBOX"); 4.WebElement input1 = driver.findElement(Id=="one")); input1.sendValue("XBOX");
Resolve the issue
Assume, you have hosted a web application on a local server and a remote server. You realize that due to network latency the time to load a web page on the remote server will be higher. Now, if you want to execute your test cases against each of them, you may have to configure the wait time accordingly.
Which of the given code snippets can be used to solve the issue?
Options
1.driver.manage().Wait(10, TimeUnit.SECONDS); 2.driver.manage().timeouts().Wait(10, TimeUnit.SECONDS); 3.driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 4.driver.manage().implicitlyWait(10, TimeUnit.SECONDS);
Testing a web page in Selenium
While testing a web page in Selenium, you want to move the mouse 5 units to the right from the current position and carry out a double click action.
Which of the these are valid options to be used for this purpose?
Options
- Create a single Action object with moveByOffset() and doubleClick() methods joined in sequence. Execute this action using the perform() method.
- Create two Action objects using moveByOffset() and doubleClick() methods separately. Pass these actions as parameters to execute() method for execution.
- Create a single Action object with moveAlongX() and doubleClick() methods joined in sequence. Execute this action using the perform() method.
- Create two Action objects using moveAlongX() and doubleClick() methods separately. Pass these actions as parameters to execute() method for execution.
Replace the current surname
Assume that the current surname smith inside the surname textbox has to be replaced by legend. The browser is highly secured and only keystores work in a proper way(all other binding gives an inconsistent result).
Which of the following Selenium methods can be used to achieve it?
Options
- PutKeyStroke
- SendKeys
- PutKeys
- SendKeyStrokes
Keyboard event in Selenium
Select the correct option regarding a keyboard event in Selenium.
A) After performing the keyDown(Keys.SHIFT) event, the first letter key pressed will be appear in Capital while the rest all will appear in small case.
B) keyDown() event automatically releases the key after the first input.
Options
- Statement A is true, Statement B is true, Statement B is the correct explanation of Statement A.
- Statement A is true, Statement B is true, Statement B is not the correct explanation of Statement A.
- Statement A is true, Statement B is false.
- Statement A is false, Statement B is true.
- Statement A is false, Statement B is false.
Predict the output
You have two check boxes in a list on a webpage with Ids cb1 and cb2, respectively.
What would be the output of the following code?
WebElement box1 = driver.findElement(By.id("cb1")): WebElement box2 = driver.findElement(By.id("cb2")); box1.click(); box2.click(); System.out.println(box1.isSelected()); System.out.println(box2.isSelected());
Options
1.true
false
2.false
true
3.true
true
4.false
false
5.Syntax erro
Define an expected condition check
You want to define an expected condition check to determine a string valued expectation from javascript for a java client binding in selenium.
Which of these conditional methods will you likely utilize in the given scenario?
Options
1.jsReturnsValue(java.lang.String javaScript) 2.StringreturnsJS(Java.util.Javascript) 3.jsSwitchesToValue(Java.util.Javascript.String) 4.JSConvertsToValue(java.util.String)
Lookup parent element from child elements
You want to be able to lookup parent element from child elements. In the given scenario, which of the following can be used to locate web elements?
1. XPath
2. CSS selector
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Switch between frames
You have to switch between frames using the following method :
driver.switchTo().frame()
Which of the following are the possible arguments that can be used to do the same?
A. Frame Index
B. Frame ID
C. Previous WebElement
Options
- A,B
- A,C
- B,C
- A,B,C
Perform a partial string match
Which of these characters are going to be used to perform a partial string match in a CSS selector in selenium to locate elements that start with a_?
Options
- ^
- &
- $
- *
Entity framework views
Read the two statements regarding entity framework views given below and choose the correct choice.
1) Entity framework view is similar to a real table because it contains columns and rows of data
2) Entity framework view can be used to centralise data distributed across several servers
Options
- Statement 1 is true and statement 2 is false
- Statement 1 is false and statement 2 is true
- Both statements are true
- Both statements are false
Iterating over a collection
You are iterating over a collection when working with C# in .Net.
In the given context, which of these is a valid syntax for the finally clause when there is no implicit conversion from the type of enumerator to IDisposable?
Options
1.finally { (enumerator as IDisposable)?.Dispose(); } 2.finally { } 3.finally { ((IDisposable)enumerator).Dispose(); } 4.None of these
Fix this error
Which of these lines of codes in the code snippet given below will throw a compilation error?
public class Sample { public static void Main() { //L1 int num = 4; int A = Square(num); //L2 int B = Square(12); //L3 int C = Square(A * 3); } static int Square(int i) { int input = i; return input * input; } }
Options
- Only L1
- Only L2
- Only L3
- All L1, L2 and L3
Boxing in C#
What type of boxing is being implementing in the code snippet given below?
int a = 100; object obj = (object)a;
Options
- Implicit boxing
- Explicit boxing
- Test boxing
- Declarative boxing
ASP .NET Core MVC
You are using ASP.NET Core MVC.
In the given context, which of the the following is TRUE?
1. The view component and the controller component depends on the model component.
2. The model component depends on the view component and the controller component.
3. The model component neither depends on the view component nor the controller component.
Options
1.Only 1
2.Only 2
3.Both 1 and 3
4.Both 1 and 2
Using NameClasses
You want to communicate over the Internet when creating peer-to-peer applications.
Which of these NameClasses from the .NET Framework Class Library would you use to do so?
Options
- System.Data
- System.Net
- System.Web
- System.Peer
Predict the output
Predict the output of the following code snippet.
string sentence = "Good Morning World"; string[] words = sentence.Split(' '); foreach (var word in words) { System.Console.WriteLine($"<{word}>"); }
Options
1.<Good>
<>
<>
<>
<Morning>
<World>
2.
<Good>
<Morning>
<World>
3.
<Good>
<>
<Morning>
<World>
4.None of these
Configuration in MVC .NET
You created the given option class while doing configuration in MVC .NET.
public class PositionOptions { public const string Position = "Position"; public string Title { get; set; } public string Name { get; set; } }
In this context, which of these statements is TRUE?
Options
- While making this option class you ensured that all public read-write properties of the type are unbound.
- While making this option class you ensured that the class is abstract with a private parameterless constructor.
- While making this option class you ensured that the class is non-abstract with a public parameterless constructor.
- None of these
Entity Framework
Which of the following statements regarding entity framework features are TRUE?
1) Entity Framework performs automatic transaction management while querying or saving data.
2) Entity Framework does not allow you to configure the EF model by using data annotation attributes
3) Entity Framework does not allow you to configure the EF model by using Fluent API to override default conventions
Options
- 1
- 1,2
- 1,3
- 1,2,3
Each request to a web server is taking 40 ms to complete and 35ms of that 40ms is database I/O that can be done asynchronously.
Which of the following operations will you use if you want that 35 ms per request to get freed up to handle other requests?
Options
- Non-blocking asynchronous operations
- Blocking asynchronous operations
- Non-blocking synchronous operations
- Blocking synchronous operations
Counter problem
You are writing a program which intends to increment the "hitCount" property of the "Analytics" object every time the http server gets a request.
Which of the following code segment(s) will work as intended?
Options
- var Analytics = { hitCount: 10, gotHit: function() { this.hitCount++; } } var http = require('http'); var server = http.createServer(function(req, res) { // process the request }); server.on('connection', Analytics.gotHit.bind(Analytics)); server.listen(80, '0.0.0.0');
- var Analytics = { hitCount: 10, gotHit: function() { this.hitCount++; } } var http = require('http'); var server = http.createServer(function(req, res) { Analytics.gotHit(); // process the request }); server.listen(80, '0.0.0.0');
- var Analytics = { hitCount: 10, gotHit: function() { this.hitCount++; } } var http = require('http'); var server = http.createServer(function(req, res) { // process the request }); server.on('connection', Analytics.gotHit); server.listen(80, '0.0.0.0');
- Both 1,2
- Both 1,3
Node Streams
In Node.js you are using the .pipe() function to transfer data from one process to another. The write queue is currently busy and so .write() returns a false value.
Which of the following event will be emitted once the data buffer is emptied to resume the incoming data flow in this situation?
Options
- drain()
- .read()
- .transform()
- .duplex()
You want to serve static images in two different directories named thisd and thatd.
Which of these code snippets can you use to do this?
Options
1.app.use(express.static('thisd')) app.use(express.static('thatd')) 2.app.use(express.static('thisd',"thatd")) 3.app.use('static', express.static('thisd')) app.use('static', express.static('thatd')) 4.app.use('static', express.static('thisd',"thatd"))
Which of this request-level information cannot be exposed using the property res.locals in the below given code snippet?
app.use(function(req, res, next){ res.locals.user = req.user; res.locals.authenticated = ! req.user.anonymous; next(); });
Options
- request path name
- authenticated user
- user settings
- download path name
Session Middleware in Express
You are using the express-session middleware for cookie session maintenance.
What consideration would you need to take in case you want to use this for a production environment?
Options
- You should never use it in a production environment
- You should use an in-memory store in the production environment
- You should set up a session store for the production environment
- No changes are necessary
Keys in MongoDB
Which of these characters are not allowed in key when storing data in key:value form?
Options
- \0
- . (dot character)
- $
- Only choice 1 and 2
- All of them ( Choice1,2 and 3)
Query for the User
Which of these queries can be used If you want to find all MongoDB users who do not have the username “John”?
Options
1.db.users.find({"username" : {"$ne" : "John"}}) 2.db.users.find({"username" : {"$not" : "John"}}) 3.db.users.find({"username" : {"$else" : "John"}}) 4.db.users.find({"username" : {"$except" : "John"}})
Component Interaction in Angular
You are using the following angular code to pass data from parent to child with input binding.
import { Component, Input } from '@angular/core'; import { Hero } from './hero'; @Component({ selector: 'app-hero-child', template: ` {{hero.name}} says: I, {{hero.name}}, am at your service, {{masterName}}. ` }) export class HeroChildComponent { @Input() hero: Hero; XXX }
What can be used in place of XXX to alias the child component property name masterName as 'master'?
Options
1.@Input('master') masterName; 2.@Input('master') masterName: string; 3.@Input(master) 'masterName'; 4,@Input(master:string) 'masterName';
Working with Angular Components
You are using the :host pseudo-class selector to target styles in the element that hosts the component in Angular.
What can you achieve by using function form when doing so?
Options
- You can apply host styles conditionally
- You can include another selector inside the host
- You can target the host element
- You can host element inside parent's component
Working with top command
Which of these top commands provides a comprehensive list of all available variations when checking memory usage in a linux machine?
Options
- man top
- htop
- bottom top
- snap top
Creating users in CentOS 8
Which of these commands should you use to create a user named 'sampleuser' with a home directory and the ability to log in to the system?
Note: You are working on a CentOS 8 system.
Options
1.sudo useradd -m sampleuser 2.useradd -m sampleuser 3.useradd -u sampleuser 4.sudo useradd -l sampleuser
Determining processes that read/write the most
Which of these commands can you use to find out which application or process is reading/writing the most in your linux system?
Options
- iotop
- iotop -o
- top
- iostat
Process ID of the current script
Given that $$ in the below given bash script represents the process ID of the current script.
echo $$ - (i) echo $(echo $$) - (ii)
What can be said about the output produced by (i) and (ii)?
Options
- Output of (i) and (ii) are same.
- (i) throws an error while output of (ii) is an integer.
- (ii) throws an error while output of (i) is Integer.
- Both (i) and (ii) throw an error
Monitoring a log file in Ubuntu
Which of these commands can you use to monitor a log file named 'file.txt' in your Ubuntu 18.04 system?
Note: Assume that you are remotely connected to a server and don’t have a GUI.
Options
- tail -f file.txt
- head -f file.txt
- tail -n file.txt
- head -n file.txt
Working with the fdisk command
You are using the command given below to view the details of a specific partition. What can be used in place of XXX to complete the command?
fdisk XXX
Options
- -I
- -l 'name of device'
- -r
- -r 'name of device'
Deleting a user’s crontab
Which of these commands can be used to prompt a confirmation from a Linux CentOS 8 user before deleting the user’s crontab?
Options
1.crontab -i -r 2.crontab -i 3.crontab -r 4.crontab -f
Using the dtstat command
You are using the dtstat command to get the stats of the disk activity on your linux system.
Which of the following options will you use to get a continuous list of disk read/write measurements?
Options
- -d
- -i
- -w
- -r
Making your mount settings permanent
What should you do to make your mount settings permanent when mounting a filesystem on your CentOS 8 system?
Options
- You need to locate and list block devices on your system
- You need to amend the fstab file in order to make your mount settings permanent.
- You need to locate and list block devices on your system
- None of these
Detect the need for client side throttling
You want to detect the need for client side throttling while working with the Azure key vault.
In the given context which of these HTTP responses can be used for doing so?
Options
- error code 429
- error code 450
- error code 350
- error code 303
Benefit of Azure Active Directory security groups
You are working with big data in Data Lake Storage Gen2. When doing so, you have decided to use Azure Active Directory security groups instead of assigning individual users to directories and files.
What is the benefit of doing so?
Options
- Adding or removing users from the group doesn’t require any updates to Data Lake Storage Gen2
- It ensures that you don't exceed the maximum number of access control entries per access control list
- It enables you to access data in a storage account with hierarchical namespace enabled.
- Both 1 and 2
- All 1, 2 and 3
Convert a secondary replica to a primary server in Azure
You are running the Switch-SqlAvailabilityGroup cmdlet to convert a secondary replica to a primary server in Azure analysis services while forcing a failover. However, you do not want to be prompted for confirmation during the operation.
In the given context, which of these parameters would you need to specify?
Options
- Force
- Script
- Confirm
- Either Choice 1 or Choice 2
- Either Choice 1 or Choice 3
Valid ways to use POSIX access controls
Which of these are valid ways to use POSIX access controls for Azure Active Directory users offered by Azure Data Lake Storage Gen2?
Options
- Setting the access controls to existing files and directories
- Create default permissions that can be automatically applied to new files
- Both 1 and 2
- Neither 1 nor 2
Throttling requests in response to service limits
You are asked to throttle your requests in response to service limits while working with Azure Key Vault. In the given context, which of these are valid best practices that should be followed while doing so?
- Reduce the number of operations per request.
- Reduce the frequency of requests
- Avoid immediate retries.
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Resource group in Azure
You are working with a Resource group in Azure. In the given context, which of these are valid best practices that need to be followed while doing so?
1. Provide a description of every parameter in the metadata
2. Use a literal value or a language expression to specify defaults for optional parameters
3. Use allowedValues sparingly.
Options
- Only 1,2
- Only 2,3
- Only 3
- Only 1
- All 1,2,3
Deploy Azure resources to multiple resource groups
You need to deploy Azure resources to multiple resource groups.
In the given scenario, how many resource groups can be deployed in a single deployment if the parent template used contains only nested templates?
Options
- less than 500
- less than 400
- more than 800
- upto 800
Guest user is assigned the Synapse Administrator role
A guest users from a different Azure directory tenant is assigned the Synapse Administrator role.
Which of these deductions can be made in the given context?
Options
- Guest users cannot see or manage role assignments
- Guest users can see or manage role assignments
- Guest users can list Synapse RBAC role assignments for all scopes
- Guest users can include assignments for objects they don't have access to
Restoring keys to a key vault
Assume that you have backed up a key from one geographical location. Which of these conditions need to be satisfied if you want to restore the key to a key vault in another Azure location?
1. Both of the Azure locations belong to the same geographical location
2. Both of the key vaults belong to the same Azure subscription
3. RBAC has not been configured for Both the key vaults
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All 1,2,3
Delete Data Encryption Key for the entire data
Which of these is a single point that can be used to delete Data Encryption Key for the entire data in Azure encryption at rest?
Options
- Key Encryption Key
- Key Chain
- Certificate Chain
- SSL chain
Reading a darkMode entry from a box
Why should you provide a defaultValue when reading the darkMode entry from the box in a Flutter application?
Options
- Because the value will be null when the application starts for the first time.
- Because value of themeMode is set based on the value of darkMode
- Both Choice 1 and 2
- Neither Choice 1 nor 2
Developing a Flutter application with navigation
Bob wants to develop a Flutter application with navigation to the same screen enabled in many parts of the application.
What can he do to avoid code duplication in the given scenario?
Options
- Use named routes for navigation
- Use dynamic navigation with generated routes
- Use static navigation with route map
- Navigate to a new screen and back by creating a new route
Layout widget with a child property
In which of the following situations will a layout widget have a child property?
1. If it takes a Container widget.
2. If it takes a Row widget.
3. If it takes a Stack widget.
Options
- Only 1
- Only 2
- Only 3
- All 1, 2 and 3
Creating a Food delivery app on Flutter
Bob is creating a Food delivery app on Flutter. He wants to include 5 star icons that lets users rate the food delivery service.
Which property will allow him to pack the star icons closely together?
Options
- mainAxisSize
- MainAxisSize.min
- MainAxisSize.max
- iconList
Integrating a column-like layout
Alice is building a food app on Flutter. She wants to integrate a column-like layout that automatically scrolls if the content is too long to fit the available space.
Which of the given widgets will help her achieve the same?
Options
- ListView
- ListTitle
- Row
- Column
Building an application with lots of animations
You are building an application with lots of animations. You want the animations to start playing when a tap is detected anywhere on the screen.
Which of these Flutter widgets will help you in doing so?
Options
- StaggerDemo
- StaggerAnimation
- CurvedAnimation
- MoveAnimation
Failure of Provider.of in finding provider as ancestor
What happens when Provider.of fails to find a Provider as an ancestor of the BuildContext used when working with the Flutter provider package?
Options
- The error ProviderNotFoundException is thrown
- The error Provider.of failed is throw
- The exception noSuchMethod is thrown
- None of these
Calling a removeListener manually
You are building an application in Flutter. In which of the given situations, are you likely to call a removeListener manually while doing so?
1. When you're listening to an Action widget in a widget hierarchy
2. When you're using an Action outside of a widget context
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Application that contains several pages
You have created an app in Flutter that contains several pages. Now, you want the app to stay in sync with the browser's URLS if the page URLs are updated.
Which of the given Router widgets will help you in the above scenario?
1. RouteInformationParser
2. RouterDelegate
Options
- Only 1
- Only 2
- Both 1, 2
- None of these
Tickers starting a future
You notice that whenever a Ticker is started it returns a Future.
When will this Future be stopped in this context?
Options
- When the Ticker is stopped
- When the Ticker elapses
- When all the Tickers are synchronised
- None of these
Design using popover plugin
You are planning to use the popover plugin in bootstrap 4 for designing a page. In the given context, select the valid guidance to be followed while doing so?
1. All popovers used would need to be assigned explicitly
2. Popovers for .disabled elements should be triggered on a wrapper element.
Options
- Only 1
- Only 2
- Both 1,2
- None of these