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
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
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
Prevent a popover from floating away
You need to prevent a popover from floating away from a trigger element during a window resize in a Bootstrap 4 page.
Select the appropriate option to be passed via data attributes in order to do so.
Options
- container
- content
- html
- placement
Build a dropdown
Which of these elements can be used to do?
1.<div>
2.<ul>
3.<a>
Options
- Only 1,2
- Only 1,3
- Only 2,3
- All 1,2,3
Hide an element
You wish to hide an element on a page in Bootstrap 4 to all devices except screen readers.
How would you ideally be able to do so?
Options
- Use .sr-only
- Use .sr-only-focusable
- Use .sr-only-hidden
- Use .sr-reader-only
Trigger an operation
You need to use a popover event to trigger an operation as soon as the the show instance method is called in a Bootstrap 4 page. In the given context, select the appropriate event that can be used to do so?
1. show.bs.popover
2. shown.bs.popover
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Toggle the button
How will you write a function that will execute when a certain button with collapse call having a id as navBar has been made visible to the user?
Options
How will you write a function that will execute when a certain button with collapse call having a id as navBar has been made visible to the user?
Options
1.$('#navBar').on('shown.bs.collapse', function () { // Your Code } 2.$('#navBar').on('show.bs.collapse', function () { // Your Code } 3.$('#navBar').on('toggle.bs.collapse', function () { // Your Code } 4.$('#navBar').collapse({ // Your Code }
Trigger an operation
You need to use a popover event to trigger an operation as soon as the the show instance method is called in a Bootstrap 4 page. In the given context, select the appropriate event that can be used to do so?
1. show.bs.popover
2. shown.bs.popover
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Popovers in Bootstrap 4
You have been tasked with analyzing a piece of code containing the use of popovers in a Bootstrap 4 page. The code implements the following operations:
1. A popover is triggered on the a hidden element X on the page
2. A button group used in the popover is specified without a container: 'body'
Which of these operations are likely to lead to issues in the given scenario?
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Button group in Bootstrap 4
A button group in a component element of Bootstrap 4 has a z index of 2.
In the given context, which of these statements would be valid?
Options
- The button group is in default state as per z index standard
- The button group is in :hover state as per z index standard
- The button group is in .active state as per z index standard
- The button group is in .focus state as per z index standard
Fire an event
An event needs to be fired as soon as a popover is done being hidden and the CSS transitions are completed. Which of the following events can be used to do so?
1. hide.bs.popover
2. hidden.bs.popover
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Build complex and repetitive components
You want to use media object to help build complex and repetitive components where some media is positioned alongside content that doesn't wrap around said media.
How many classes are required to complete this action?
Options
- 1
- 2
- 3
- 4
Sharing pool of computer resources
While sharing the pool of computer resources, which of the security issues given below is handled by the SLA of a cloud?
A) Data Segregation
B) Privileged user access
C) Regulatory compliance
Options
- A and B both
- B and C both
- C only
- A, B and C all
Calculating the risks associated with data access
It is given that your cloud service provider provides you with detailed info regarding the location of their data centers.
With such information is it possible to know and calculate the risks associated with data access?
Options
- Yes it is possible to calculate
- Yes, but only partially
- Yes, but only if the location jurisdiction data is also available
- No it is not possible
Calculating the risks associated with data access
With such information is it possible to know and calculate the risks associated with data access?
Options
- Yes it is possible to calculate
- Yes, but only partially
- Yes, but only if the location jurisdiction data is also available
- No it is not possible
Security threats in a vpn
Which of the following scenarios if true could pose a legitimate security threat in a vpn context?
Options
- A user has a split tunneling setup to connect both to a vpn as well as his house broadband
- A client machine is shared with multiple parties in their organizational team
- A laptop is connected to their company network through VPN from the user's house
- None of the given options
Cloud stack components’ security
Which of the following cloud stack components' security is handled by the vendor while using platform as a service?
A. User Data
B. Application stack
C.Infrastructure
Options
- Only A and B
- Only A and C
- Only B and C
- All of the options
Cloud stack components
Which of the following cloud stack components' security is handled by the vendor while you are using platform as a service?
A. User Data
B. Application stack
C. Infrastructure
Options
- Only A and B
- Only A and C
- Only B and C
- All A, B and C
Calculating the risks associated with data access
Assume that your cloud service provider givens you detailed info regarding the location of their data centers.
With such information, is it possible to know and calculate the risks associated with data access?
Options
- Yes it is possible to calculate
- Yes, but only partially
- Yes, but only if the location jurisdiction data is also available
- No it is not possible
Improving reliability, availability and security issues
Which of the following factor(s) should the provider consider in order to improve reliability, availability and security issues in a cloud system?
1. Access control and availability managements
2. Vulnerability and problem management
3. Patch and configuration management
4. Countermeasure against security problems
5. Monitoring the unauthorized access
Options
- All
- All except 1
- All except 2 & 3
- All except 5
- None of the given options
Using a public cloud service with trusted IP address ranges
Your enterprise requires that you use a public cloud service with trusted IP address ranges and very tight user controls.
In the given scenario, which of the following features will you recommend as part of baseline security?
Options
- Identity and Access Management
- Virtual private cloud
- Multi-factor authentication
- Single Sign on
Cloud system hosting applications of various users
You have created a Cloud system to host applications of various users. While releasing the cloud system, you also released the document specifying the consequences of attempts to breach the security system of the cloud to the public.
Which type of security control has been shown in the above example?
Options
- Preventive control
- Deterrent Control
- Corrective Control
- Detective Control
Enacting physical security policies
When it comes to enacting physical security policies, which of the following (hypothetically) should be done first and foremost?
Options
- Multiple key management
- Network security hardening
- low visibility for secure locations
- None of the given options
Vulnerabilities to redirect calls or text messages
Which of these vulnerabilities can be used to redirect calls or text messages using a compromised application?
Options
- SS7
- TEE
- RFC
- RTE
Security configurations of the OWASP top ten
Which of these attack vector vulnerabilities would you likely check if the guidelines for security configuration cover the OWASP top ten?
Options
- Injection attacks
- Authentication and Session management
- Sensitive data exposure
- All of the given options
Types of access control technique
Which of these kind of access control technique is most suitable in a scenario where access to an object is based on the sensitivity of the object?
Options
- Discretionary Access Control (DAC)
- Role-Based Access Control (RBAC)
- Permission Based Access Control
- Mandatory Access Control (MAC)
Reviewing the webpage metadata
You want to review the webpage metadata for disabled links/scripts in an AUT.
Which of the following choices can be used for this purpose?
Options
- Robots
- Crawlers
- Spiders
- All of the given options
Using the OWASP testing workflow
According to the OWASP testing workflow, during the lifecycle of an application, the code review is performed to check for vulnerabilities. Now, further testing is being done to ensure no flaws were missed.
In which of these phases should this be done?
Options
- Design phase
- Development phase
- Deployment phase
- Maintenance phase
Working with a IoT application
Imagine an IoT application that has the source code as shown below for displaying files.
<?php
print(enter file name);
$file=_GET['filename'];
system("cat $file");
?>
Which of these inputs should be provided to this device to delete all files in the root directory?
Options
- robot.txt
- root rf
- 'a.txt; rm -rf /; ' "
- a.txt'; ls /;
Measures to harden the security
You need to suggest measures that need to be followed to harden the security of your web application. Which of the following measures would you likely suggest in this context?
1. Performing a routine security audit.
2. Information should be stored in a way that makes it easy to parse it rapidly.
3. Encrypt everything including data at rest.
Options
- Only 1
- Only 1,2
- only 2,3
- All 1,2,3
Using the principle of least privilege
Which of these is NOT a characteristic of an application that has been designed using the principle of least privilege?
Options
- The attack surface is limited
- Propagation of malware is inhibited
- More difficult to achieve compliance
- All of the given options
Exploit attributed to vulnerabilities
While analyzing the security for an 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
Creating a remote shell
You want to create a remote shell and run a given command to gather data using a backdoor.
In the given context, which of these android vulnerabilities can be exploited to do so?
Options
- ADVSTORESHELL
- AndroRAT
- PJApps
- INTENTSH
Select the Query
Consider the following two tables.
Employees
employee_id NOT NULL NUMBER(6) first_name VARCHAR2(20) last_name NOT NULL VARCHAR2(25) email NOT NULL VARCHAR2(25) phone_number VARCHAR2(20) hire_date NOT NULL DATE job_id NOT NULL VARCHAR2(10) salary NUMBER(8,2) manager_id NUMBER(6) department_id NUMBER(6) PRIMARY KEY(employee_id) FOREIGN KEY(department_id) REFERENCES Department
Department
department_id NOT NULL NUMBER(6) department_name VARCHAR2(20) location_id NUMBER(6) PRIMARY KEY(department_id)
Which of these queries finds all employees whose salaries are greater than the lowest salary of every department?
Options
1.SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary >= ALL (SELECT MIN(salary) FROM employees GROUP BY department_id) ORDER BY first_name , last_name; 2.SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary >= SOME (SELECT MAX(salary) FROM employees GROUP BY department_id); 3.SELECT employee_id, first_name, last_name, salary FROM employees WHERE MAX(salary) IN (SELECT MIN(salary) FROM employees GROUP BY department_id) ORDER BY first_name , last_name; 4.None of these
Working with Clauses
Consider the tables books and review given below.
CREATE TABLE books( book_id int, book_title varchar(30), year_published int, book_lang varchar(30), PRIMARY KEY(book_id) ); CREATE TABLE review( book_id int, rev_id int, stars float, reviewcount int, FOREIGN KEY(rev_id) REFERENCES bookreviewer(rev_id), FOREIGN KEY(book_id) REFERENCES books(book_id) );
Write a query to find all the years in which a published book received a 3 or 4 rating.
Options
1.SELECT DISTINCT year_published FROM books, review WHERE books.book_id = review.book_id AND stars IN (3, 4) ORDER BY year_published; 2.SELECT DISTINCT year_published FROM books INNER JOIN review ON books.book_id = review.book_id WHERE stars IN (3, 4) ORDER BY year_published; 3.Both Choice 1 and 2 4.Neither Choice 1 nor 2
Knowledge of Keys
Which of the following statements 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
Using Windows Functions
Which of the following situations will lead to an error?
1. Using the LEAD() function without an over clause.
2. Using the LAG() function without an over clause.
Options
- Both 1 and 2
- Only 1
- Only 2
- Neither 1 nor 2
Judge the query
Q1
Select * from product p where EXISTS (select * from order_items o where o.product_id = p.product_id)
Q2
Select * from product p where product_id IN (select product_id from order_items ....);
Which of these inferences are valid with respect to the queries given above?
Options
- Q1 is more optimized than Q2
- Q2 is more optimized than Q1
- Q1 performs slowly but is efficient
- Q2 performs slowly but is efficient
Find the Maximum Average
You have a table Janitor that has the following structure.
Janitor_id NOT NULL NUMBER(6) first_name VARCHAR2(20) last_name NOT NULL VARCHAR2(25) email NOT NULL VARCHAR2(25) phone_number VARCHAR2(20) hire_date NOT NULL DATE Job_id NOT NULL VARCHAR2(10) salary NUMBER(8,2) Manager_id NUMBER(6)
Which of the following query will you use to find the Job_id that has a maximum average salary?
Options
1.SELECT job_id, avg(salary) FROM employees HAVING max(avg(salary) in (SELECT max(avg(salary) FROM employees GROUP BY job_id); 2.SELECT job_id, avg(salary) FROM employees GROUP BY job_id HAVING max(avg(salary) in (SELECT max(avg(salary) FROM employees); 3.SELECT job_id, avg(salary) FROM employees GROUP BY job_id HAVING avg(salary) in (SELECT max(avg(salary) FROM employees GROUP BY job_id); 4.None of these
Working with functions
Choose the appropriate query to return the student obtaining the lowest marks for each class from the given choices.
Options
1.SELECT * FROM students s1, s2 WHERE marks = min( s1.marks, s2.marks) AND s1.class_id = s2.class_id ); 2.SELECT * FROM students WHERE marks = min( SELECT marks FROM students GROUP BY marks); 3.SELECT * FROM students s1 WHERE s1.marks < ANY( SELECT marks FROM students s2); 4.SELECT * FROM students s1 WHERE s1.marks = ( SELECT min( marks) FROM students s2 WHERE s1.class_id = s2.class_id );
Using Triggers
You want to use both triggers and integrity constraints to define and enforce any type of integrity rule. In which of the below given scenarios can you use triggers to constrain data input when working with a Oracle database?
1. To enforce complex business rules not definable using integrity constraints.
2. When a required referential integrity rule cannot be enforced using PRIMARY KEY.
3. When a required referential integrity rule cannot be enforced using DELETE SET NULL.
Options
- Only 1 and 2
- Only 2 and 3
- Only 1 and 3
- All 1, 2 and 3
Optimize the query
You have two tables Sales and Products as follows:
SALES(SALE_ID, YEAR, PRODUCT_ID, PRICE); PRODUCTS(PRODUCT_ID, PRODUCT_NAME);
How can you rewrite the query given below such that reductant logic is eliminated?
SELECT T.YEAR, T.TOT_SAL, P.PROD_10_SAL ( SELECT YEAR, SUM(PRICE) TOT_SAL FROM SALES GROUP BY YEAR ) T LEFT OUTER JOIN ( SELECT YEAR, SUM(PRICE) PROD_10_SAL FROM SALES WHERE PRODUCT_ID = 10 ) P ON (T.YEAR = P.YEAR);
Options
1.SELECT YEAR, SUM(CASE WHEN PRODUCT_ID = 10 THEN PRICE ELSE NULL ) PROD_10_SAL, SUM(SALES) TOT_SAL FROM SALES; 2.SELECT P.PRODUCT_ID, P.PRODUCT_NAME FROM PRODUCTS P LEFT OUTER JOIN SALES S ON (P.PRODUCT_ID = S.PRODUCT_ID) WHERE S.SALE_ID IS NULL; 3.SELECT YEAR, SUM(CASE WHEN PRODUCT_ID = 10 THEN PRICE ELSE NULL END ) PROD_10_SAL, SUM(SALES) TOT_SAL FROM SALES GROUP BY YEAR; 4.None of these
Features of an abstract class
Which of the following features does an abstract class have in C#?
1. An abstract class may contain abstract methods and accessors.
2. An abstract class cannot be instantiated.
3. A non-abstract class cannot be derived from an abstract class
Options
- 1, 2
- 2, 3
- 1, 3
- 1, 2 and 3
Analyse the code
public class A { public AA void x() { } public BB int y { get { return 0; } } } public class B : A { public override void x() { } public override int y { get { return 0; } } }
What can be used in place of AA and BB in the above given C# code snippet so that the overriding mentioned in Class B can be achieved?
1. AA-> virtual BB-> virtual
2. AA-> friend BB-> abstract
3. AA-> abstract BB-> virtual
4. AA-> friend BB-> virtual
5. AA-> virtual BB-> abstract
6. AA-> abstract BB-> abstract
Options
- Either 1 or 2
- Either 1 or 3 or 5 or 6
- Either 2 or 3 or 4 or 5
- Either 2 or 4
- Either 1 or 3 or 4
String interpolation
You have used the concept of string interpolation while writing the C# code snippet given below.
const int FieldWidthRightAligned = 20; Console.WriteLine($"{Math.PI,FieldWidthRightAligned:F3}");
In this context, which of these is the correct output of the code snippet?
Options
- 3.142
- 3.14
- 3.1
- 3.1415
C# interfaces
Which of the following statements regarding C# interfaces is true?
A) An interface can contain declaration as well as implementation.
B) The declaration in C# can only contain methods and events
C) Interface cannot include private, protected or internal members.
Options
- A
- B
- A,B
- B,C
- C
Force the sub classes
You have created an abstract class and you want to force its sub classes to implement a particular method.
What should you do to enforce this in C#?
Options
- Declare the class as virtual
- Declare the class as abstract
- Add the virtual keyword to the method
- Add the abstract keyword to the method
Select the appropriate choice
Analyze the following statements in the context of an abstract method in C# and select the appropriate choice.
S1: An abstract method can never be instantiated.
S2: Abstract methods should always have a sealed modifier.
S3: Abstract methods are always implicitly virtual
Options
- Only S1 and S2 are true
- Only S2 and S3 are true
- Only S1 and S3 are true
- All S1, S2 and S3 are true
Expose the interface of an inner object
You want to allow an outer object X to expose the interface of an inner object Y while giving the illusion that their implementation takes place on the outer object X.
Which of the following reusability mechanisms in C# allows you to do so?
Options
- Containment
- Aggregation
- Remediation
- Entrenchment
Create a set of related objects
You are implementing the Abstract Factory design pattern to create a set of related objects in C#.
Which of the following is a class of this design pattern that will use two interfaces to create the required family of related objects?
Options
- Client
- Abstract Factory
- Abstract Product
- Concrete Factory
Analyse the Stackalloc expression
You have written the C# code snippet given below.
int len = 5; Span<int> num = stackalloc int[len]; for (var i = 0; i < len; i++) { num[i] = i; }
In this context, which of the following statements related to the stackalloc expression used stands TRUE?
1.The stack allocated memory block created during the method execution will continue to stay alive even after the method returns.
2.The stack allocated memory block created during the method execution will automatically be discarded when that method returns.
3.You cannot explicitly free the memory allocated with stackalloc.
4.You can explicitly free the memory allocated with stackalloc.
Options
- Only 1
- Only 3
- Only 2 and 3
- Only 1 and 4
Good design standards for C# interface
Which of the following statements regarding good design standards for C# interfaces holds true?
A) You have to split up the interface for unrelated functionalities
B) You have to make new interfaces for specific functionality
C) You do not have to implement too many methods in one interface
Options
- A
- B
- C
- Both A & C
- Both B & C
Rendering a context
Which of the following is/are TRUE about rendering a context using a Template object in Django?
S1: Once a Template object is compiled, you can render a context with it.
S2: You can reuse the same template to render it several times with different contexts.
Options
- Only S1
- Only S2
- Both S1 and S2
- Neither S1 nor S2
Designing a GEO location API
You are designing a GEO Location API that provides geo location information based on IP addresses, using Django REST API. You are performing a GET request to the URL and reading the data in JSON format into the geodata variable, in the views.py file.
Which of the following options will best fit the missing line of code, XXX and YYY, to perform the action given in the above context?
from django.shortcuts import render
import requests
def home(request):
XXX
YYY
return render(request, 'core/home.html', {
'ip': geodata['ip'],
'country': geodata['country_name']
})
Options
- XXX: response = requests.post('http://freegeoip.net/json/')
YYY: geodata = response.json()
2.XXX: geodata = response.json()
YYY: response = requests.get('http://freegeoip.net/json/')
3.XXX: geo = response.json()
YYY: response = requests.get('http://freegeoip.net/json/')
4.XXX: response = requests.get('http://freegeoip.net/json/')
YYY: geodata = response.json()
Using template components
You want to add common data shared by all templates to the context without repeating code in every view.
Which of these template components can be used to achieve this in Django?
Options
- Context processors
- Loaders
- Context
- Template
The XSS attack
Which of these unique features in Django gives a special security advantage of "non-vulnerability" to XSS attacks?
Options
- It doesn't accept raw SQL from users.
- It has automatic HTML escaping
- It has CSRF protection as there is no replay of forms by other code
- Both Choice 1,2
- Both Choice 1,3
The XSS attac
Which of these unique features in Django gives a special security advantage of "non-vulnerability" to XSS attacks?
Options
- It doesn't accept raw SQL from users.
- It has automatic HTML escaping
- It has CSRF protection as there is no replay of forms by other code
- Both Choice 1,2
- Both Choice 1,3
Using Django template variables
You want to use a Django template variable to find out the number of times the current for loop has run.
Which of these can be used to achieve this?
Options
- forloop.last
- forloop.first
- forloop.counter
- forloop.counter0
Subclassing an existing model
You want to subclass an existing model in such a way that each model should has its own database table.
Which of these inheritance styles in Django would you use to achieve this?
Options
- Abstract base classes
- Multi-table inheritance
- Proxy models
- Both Choice 1,2
- Both Choice 1,3
Subclassing an existing model
You want to subclass an existing model in such a way that each model should has its own database table.
Which of these inheritance styles in Django would you use to achieve this?
Options
- Abstract base classes
- Multi-table inheritance
- Proxy models
- Both Choice 1,2
- Both Choice 1,3
Working with regular expressions
Which of the following URLs will match with the above given regular expression?
(1) localhost/0
(2) localhost/detail/0
(3) localhost/index/0
(4) localhost/100
Options
- Only 1
- Only 4
- Both 2 & 3
- Both 1 & 4
Using REST APIs
You are working on a Puppy Store project which uses Django RESTful API. You have already added a unit test and you want to update the code to make it pass the test.
Which of these options will best fit the missing line of code, XXX, to perform the action given in the above context?
@api_view(['GET', 'POST'])
def get_post_puppies(request):
if request.method == 'GET':
XXX
serializer = PuppySerializer(puppies, many=True)
return Response(serializer.data)
elif request.method == 'POST':
return Response({})
Options
- return Response(serializer.data)
- Puppy = puppies.objects.all()
- serializer = PuppySerializer(puppies, many=True)
- puppies = Puppy.objects.all()
Working with forms
You have a model named Info that contains a field called email. You now want to perform a case-insensitive exact match for the email sample@gmail.com.
Which of the following lines of code will help you achieve this?
Options
- Info.objects.filter( email__icontains='sample@gmail.com')
- Info.objects.filter( email__exact='sample@gmail.com')
- Info.objects.filter( email__iexact='sample@gmail.com')
- Info.objects.filter( email__matches='sample@gmail.com')
A manage.py file
Which of these django utility does a manage.py file in a Django project use to reverse engineer the models for the existing databases?
Options
- syncdb
- loaddata
- dumpdata
- inspectdb
The Single Responsibility Principle
Which of the following code snippets follows the Single Responsibility Principle?
Options
- public class CustomerOrder {
public void createCustomer(int customerId, String name) {
}
2. public void submitOrder(Cart shopCart) {
Order order = orderProcessor.submitOrder(shopCart.getItems());
}
}
3.
Super and sub classes
A sub class that you have defined cannot be used in place of its super class. You find that the super-class has a method that accepts a super-class type parameter.
Which of the following choices is/are TRUE about the sub class?
Options
- The sub class should accept as argument a super-class type only
- The sub class should accept as argument a sub-class type only
- The sub class should accept as argument a sub-class type or super class type
- The sub class method should not have any argument
SOLID design principles
You are implementing SOLID design principles in a microservice with an architecture that has independent services and repositories that are unbound from each other.
Which of the following choices would be TRUE in the given scenario?
Options
- Each service would most likely have its own interfaces, class hierarchy, and dependencies. But logic duplication is likely
- Each service would most likely have its own interfaces and class hierarchy, but share dependancies. But logic duplication is likely
- Each service would most likely have its own interfaces and class hierarchy, but share dependancies. Logic duplication is unlikely
- Each service would most likely have its class hierarchy, but share dependancies and interfaces. Logic duplication is unlikely
Principles of microservices and SOLID principles
You are designing a set of microservices that follows the principles of microservice architecture design as well the principles of SOLID.
What would be the design of your system such that it is most suited to implementing the system without violating both these principles?
Options
- All services should be independant and should not share repositories
- A single repository is maintained for all services
- Different serives are grouoped together based on shared repositories, and can share dependancies
- Different serives are grouoped together based on shared repositories, but should never share dependancies or build processes
Monolithic tightly bound application
You have a monolithic tightly bound application architecture for your application, and you want to move towards a better architecture by following the Single Responsibility Principle.
What can you do to achieve this?
Options
- You can do this by Identifying standalone logic and separating them into codebases that cannot communicate with each other
- Identify each discrete business capability and implement them as a service. No capability overlapping should occur
- Identify each discrete business capability and implement them as a service. Capability overlapping should be realized using mappings
- Identify each discrete business capability and implement them as a group of services. Capability overlapping should only remain inside groups
Using a Data dictionary
As an ABAP Developer, which of these statements related to data dictionary in SAP ABAP would you consider to be true?
Options
- Data Dictionary holds object information of programs and classes.
- All SAP related metadata is stored in TCODE SE11 where the information of a table, data element, domain and views can be taken.
- Enhancements related data objects are stored in the data dictionary
- None of these
Working with Domains
As an ABAP developer in which of these scenarios can you use Domain in Data Dictionary ABAP?
Options
- Domain is used to define variables in a program.
- Domain is where the data type is defined and can define the boundaries by defining the value range.
- Domains are used in table fields declarations.
- None of these
Working with Domains
As an ABAP developer in which of these scenarios can you use Domain in Data Dictionary ABAP?
Options
- Domain is used to define variables in a program.
- Domain is where the data type is defined and can define the boundaries by defining the value range.
- Domains are used in table fields declarations.
- None of these
Utilizing a Data Element
What is the best use of Data Element in a Data Dictionary for an ABAP Programmer?
Options
- A Data element is used to declare a object of the classes
- Data elements are used to define the search helps.
- Data elements are the Meta information’s used to declare the table fields or used to declare variables in a program. It can also be a reference to domain or data type.
- All of these
Differentiating Domains
What is the major difference between a data element and a domain with reference to ABAP Development?
Options
- Domains are used to declare variables in a program and data elements hold the information of data type and value range.
- Domain holds the technical characteristics with information of the data type and value range. Data element holds the semantic information used to define table fields and declare variables in a program.
- Data elements cannot be created without defining a domain whereas domain can exist without the data element.
- None of these
Using Enhancement with Tables
Why do you need to use Enhancement Category when defining a table in SE11 during ABAP development ?
Options
- Enhancement category in a table is defined to allow standard tables to be enhanced using append and include structures.
- Enhancement category option enables the Tables to define the secondary indexes of the table.
- Enhancement category enables the table to change the data content.
- None of these
Using Indexes in Tables
In which of these scenarios would you need to use Secondary Indexes of SAP Table?
Options
- Indexes are foreign keys to get the data mapping multiple tables.
- Indexes are additional pointers to the data set of a table to access the data faster.
- Indexes are composite table keys to access the data set of a table faster.
- None of these
Differentiating structures
Which of the given statements help you explain the difference between include and append structures?
Options
- Append structures can be used on multiple tables whereas include can be used in only one table.
- Append structures can be used only in one table and includes can be used on multiple tables.
- Append structures and include structures can be used in multiple tables.
- None of these
Understanding Row and Column store
Which of the given statements regarding Row and Column store can be considered true?
Options
- Row store is that every end of row set contains the pointer to the starting of the next row and in column store, data is stored in adjacent memory positions.
- Column based storage is beneficial for small database and row store is encourages in large database
- Higher compression can be achieved in row store and in column store no aggregation functions can be obtained.
- None of these
Utilizing Data class
What is the use of a Data Class in a Data Dictionary?
Options
- Data Class is used to declare objects of a class.
- Data Class can be used to store information of a particular table.
- Data classes are used to create the space in database for the table to get stored.
- None of these
Understanding Search help
Which of the given statements regarding Elementary Search Help and Collective Search help is true?
Options
- Elementary search help contains multiple search helps to implement a search path and collective search help contains single search help to determine the possible entries.
- Elementary search help contains single search help to implement a search path for possible entries and collective search help is the collective of elementary search help to get multiple searches in a single search help.
- Collective search help should maintain the selection method and for Elementary search help there is no need for a selection method.
- None of these
Understanding Package Attribute
Which of the following is not an attribute of a package?
Options
- We can encapsulate a package within a package
- Transport layer has to be maintained while creating a package
- A package can be locked, so that further objects addition is not possible
- Package accessibility is controlled by public, private and protected visibility options
Using Transport Organizer
Being an ABAP developer, in which of these scenarios will you use Transport Organizer?
Options
- Transport requests from one system to another
- Release transport requests
- Close the Import Queue
- None of these
Working with Tables
Which of the following statements are incorrect?
1. Transparent tables have one to one relationship with database tables
2. Transparent tables have one to one relationship with database tables
3. Pool tables have one to one relationship with database tables
Options
- Only 1,2
- Only 2,3
- Only 1,3
- All of these
Using ABAP Dictionary
While defining table type in ABAP dictionary, which of the following is optional?
Options
- Line type
- Access type
- Key definition
- Initial number of rows
Understanding Repository Objects
Which of these needs to be checked before a repository object can be successfully transported?
Options
- A package needs to be assigned a transport layer.
- Repository object needs to be assigned to a package.
- The repository object must be assigned to a change request.
- All of these
Defining a ABAP workbench
he ABAP Workbench can be used to define which of these?
Options
- Business Functions
- Internal Tables
- Pool Functions
- None of these
Data types in ABAP
Which of the following is not a complete predefined data type?
Options
- String
- XString
- Float
- Char
Using the ABAP Dispatcher
The ABAP Dispatcher is used for which of the following?
1. Workload distribution
2. Communication between SAP and external systems
3. Redirection of web requests from SAP to web server
Options
- Only 1
- Only 2
- Only 1,3
- Only 1,2
Understanding Table buffering
Which of the given statements regarding database table buffering is incorrect?
Options
- Buffering is recommended on infrequently updated small tables
- Inner Joins bypass buffering
- Buffering is ineffective on aggregate functions
- Buffering is ineffective when SELECT SINGLE is used
Understanding fields in ABAP
If we need to store fixed values for a field, it can be defined in either Table Definition or Data Elements.
Select the correct choice regarding the correctness of the statement given above.
Options
- TRUE
- FALSE
Capabilities of NetWeaver
Which of these are valid capabilities provided by SAP NetWeaver?
Options
- Middleware to provide service oriented architecture
- Material Sourcing
- Identity Management
- Customer Management
Work processes
Which of the following is/are NOT valid work processes provided by AS ABAP?
Options
- Message Work Process
- Communication Work Process
- Spool Work Process
- Enqueue Work Process
Using message statements
Read the following statements about Message statements carefully and choose the correct option.
S1: A Message statement needs only Class and Type
S2: A Message statement needs Class, Type, Role and Number
Options
- Only S1
- Only S2
- Both S1 and S2
- Neither S1 nor S2
Using ABAP generic types
Which of following is NOT a generic ABAP Type?
Options
- ANY
- SIMPLE
- NLIKE
- CLIKE
- DECFLOAT
Working with sorted tables
Assume that you are working with sorted tables when programming in SAP ABAP.
In the given context, which of these statements will NOT be supported if you're using index access?
Options
- Append
- Insert
- Modify
- Delete
Implementing clauses
Which of these characteristics does ORDER BY PRIMARY clause have?
- Default behavior is ascending ordering.
- Single Database table to be used
- Select should include all fields included in primary key, except MANDT
- SELECT DISTINCT cannot be used with it
Joins in NetWeaver
What is the maximum number of joins allowed after SAP NetWeaver 7.4?
- 20
- 30
- 40
- 50
Implementing lock patterns
Which of these lock patterns exists in SAP?
Options
- Optimistic locking pattern
- Realistic locking pattern
- Pessimistic locking pattern
- Probabilistic locking pattern
Working in the local update mode
Which of these actions can be taken by a SAP ABAP programmer in the local update mode?
- SET LOCAL UPDATE is used to update locally
- DB Commit is initiated implicitly
- Dialog process waits for update to complete
- Update function and dialog process runs in same process
Using ALV reports
Which of the following types of reports does ALV Object model provide for non-hierarchical lists?
Options
- Standard ABAP List
- Classic ABAP List
- Container Embedded
- Full Screen
Creating a web service
You are assigned to create a web service in SAP ABAP.
Which of the following protocols would you use in the given scenario?
Options
- SMTP
- WSDL
- SOAP
- FTP
Working with OpenSQL
You are using Open SQL to perform some database related operations.
Which of these statements cannot be used in the given context?
Options
- Read
- Create
- Insert
- Modify
Creating development objects
While creating development objects, you require packages to assign your objects to.
In the given context, which of the following package types is/are invalid?
Options
- Development
- Main
- Application
- Both Choice 1 and 3
Creating a function module
While creating a Function Module, you have a requirements to return data back to the calling program.
Which of the following will help you achieve your objective?
Options
- Export Parameters
- Global Parameters
- Changing Parameters
- Local Parameters
Sales Of Fiago
The following pie charts represent the sales of different automobile companies in two consecutive years in India.
What was the percentage increase in the sales of Fiago from 2016 to 2017?


Options
- 165%
- 175%
- 177%
- 75%
Performing code review
While performing code review, your manager asks you to incorporate reusability and maintainability in your ABAP Program.
Which of these statements will help you achieve this?
Options
- BREAK-POINT
- FORM
- WRITE
- PERFORM
Debugging an ABAP program
You are debugging an ABAP program, and you want to add a conditional breakpoint based on a variable value.
Which of these will help you achieve this?
Options
- BREAK-POINT statement
- Internal Breakpoint
- External Breakpoint
- Watchpoint
Reusing different programs
You are asked to develop a program functionality which is to be re-used by many different programs and objects.
Which of the following techniques can you achieve this?
Options
- ABAP Web Dynpro
- Screen Programming
- Global Classes
- Function Modules
Using generic data types
Assume that you do not know the exact size of a character data type when developing an ABAP program. Due to this you have to use generic data types.
Which of the following can you use to overcome this issue?
Options
- ANY
- SIMPLE
- NLIKE
- CLIKE
Searching for function modules
You want to search for all function modules that were changed after a certain date.
Which of the following will help you achieve this?
Options
- SE37
- SE93
- SE24
- SE84
Designed for dialog-based applications
It is known that ABAP is designed for dialog-based business applications.
Which of the following features does ABAP also have?
Options
- Upward Compatible
- Platform dependent
- Case Insensitive
- Multi Language
Minimising your code
While developing an ABAP Programs, you want to minimize your code by combining statements i.e. chaining statements.
Which of the following characters can be used to do this?
Options
- : (Colon)
- , (Comma)
- . (Period)
- ‘ (Single Quote)
Adding comments to your code
To make ABAP program readable and maintainable, comments are very important.
Which of the following allows you to add comments to your code?
Options
- Add a * in the first column of statement
- Add “ before the statement
- Select the desired lines to comment, and press Ctrl + > key
- Select the desired lines to comment, and press Ctrl + < key
Developing a multi-user application
You are developing a multi-user application, which heavily relies on some shared data. You are required to program an exclusive lock i.e. only one user can edit the data, and any other read or write lock should be rejected.
To accomplish this, which of the following locks would you need to program?
Options
- Read Lock
- Write Lock
- Enhanced Write Lock
- Optimistic Lock
Using SAP Code Inspector
You have been given the responsibility to test the quality of a piece code. You have chosen SCI (SAP Code Inspector) to accomplish this.
Which of the following issues will be identified by SCI?
Options
- Use of Index for Database Access
- Select statements in loops
- Code indentation
- Proper usage of AUTHORITY-CHECK statement
Designing a database
While designing a database, you have decided to use the buffering feature of ABAP Data Dictionary. You have a table in which application configuration is saved, and it is small in size.
Which of these buffering techniques will you use in the given scenario?
Options
- Single record buffering
- Multi record buffering
- Generic buffering
- Full buffering
Using OpenSQL
It is know that in ABAP programs you can use Open SQL without any concern of the underlying database. The backend database is handled by Open SQL Interface.
Which of these concerns is the developer relieved of in the given scenario?
Options
- Converting Open SQL to Native SQL
- Managing buffering
- Handling MANDT field
- Performance improvement
ALV Reports
You are developing a program in ABAP using screen programming. You now want to control the flow logic of your screen.
Which of these artifacts will help you achieve this?
Options
- PBO Modules
- Screen Painter
- PAI Module
- Menu Painter
Developing an ALV report
While developing an ALV report, a user asks to add a selection column to the left of the report so that the line can be selected by clicking on that column.
What value should you set the Selection Mode variable of the ALV Grid in order to achieve this?
Options
- A
- B
- C
- D
Working on ALV Grid controls
You are working on ALV Grid controls and the following requirement arises.Which of the following actions will help you create context menus in the given context?
Options
- Creating a GUI status of type context menu
- Creating a Menu Control of type context menu
- Using Menu Painter to maintain menu function codes and texts
- Using Forward Navigation to maintain menu function codes and texts
A data intensive application
You are developing a data intensive application such that the integrity of the database is maintained. In order to achieve this, you follow the “All or Nothing” rule when updating the database.
What is the correct sequence of activities that needs to be followed when programming this application?
- Lock Data > Release Lock > Change Data > Read Data.
- Read Data > Lock Data > Change Data > Release Lock.
- Lock Data > Read Data > Change Data > Release Lock.
- Change Data > Lock Data > Read Data > Release Lock.
Using VLOOKUP
You have a table 'Books' as given below.


What will be the result of running the following function on the table?
VLOOKUP("Chemical Principles", A2:B6, 2, FALSE)
Options
- The price of the first occurence of "Chemical Principles"
- The price of the second occurence of "Chemical Principles"
- #N/A
- None of these
Adding comments to your code
To make ABAP program readable and maintainable, comments are very important.
Which of the following allows you to add comments to your code?
Options
- Add a * in the first column of statement
- Add “ before the statement
- Select the desired lines to comment, and press Ctrl + > key
- Select the desired lines to comment, and press Ctrl + < key
Developing a multi-user application
You are developing a multi-user application, which heavily relies on some shared data. You are required to program an exclusive lock i.e. only one user can edit the data, and any other read or write lock should be rejected.
To accomplish this, which of the following locks would you need to program?
Options
- Read Lock
- Write Lock
- Enhanced Write Lock
- Optimistic Lock
Using SAP Code Inspector
You have been given the responsibility to test the quality of a piece code. You have chosen SCI (SAP Code Inspector) to accomplish this.
Which of the following issues will be identified by SCI?
Options
- Use of Index for Database Access
- Select statements in loops
- Code indentation
- Proper usage of AUTHORITY-CHECK statement
Designing a database
While designing a database, you have decided to use the buffering feature of ABAP Data Dictionary. You have a table in which application configuration is saved, and it is small in size.
Which of these buffering techniques will you use in the given scenario?
Options
- Single record buffering
- Multi record buffering
- Generic buffering
- Full buffering
Using OpenSQL
It is know that in ABAP programs you can use Open SQL without any concern of the underlying database. The backend database is handled by Open SQL Interface.
Which of these concerns is the developer relieved of in the given scenario?
Options
- Converting Open SQL to Native SQL
- Managing buffering
- Managing buffering
- Performance improvement
Using screen programming
You are developing a program in ABAP using screen programming. You now want to control the flow logic of your screen.
Which of these artifacts will help you achieve this?
Options
- PBO Modules
- Screen Painter
- PAI Module
- Menu Painter
Developing an ALV report
While developing an ALV report, a user asks to add a selection column to the left of the report so that the line can be selected by clicking on that column.
What value should you set the Selection Mode variable of the ALV Grid in order to achieve this?
Options
- A
- B
- C
- D
A data intensive application
You are developing a data intensive application such that the integrity of the database is maintained. In order to achieve this, you follow the “All or Nothing” rule when updating the database.
What is the correct sequence of activities that needs to be followed when programming this application?
Options
- Lock Data > Release Lock > Change Data > Read Data
- Read Data > Lock Data > Change Data > Release Lock.
- Lock Data > Read Data > Change Data > Release Lock.
- Change Data > Lock Data > Read Data > Release Lock.
Working on ALV Grid controls
You are working on ALV Grid controls and the following requirement arises
Requirement: Make a context menu available when user right clicks on the grid.
Which of the following actions will help you create context menus in the given context?
Options
- Creating a GUI status of type context menu
- Creating a Menu Control of type context menu
- Using Menu Painter to maintain menu function codes and texts
- Using Forward Navigation to maintain menu function codes and texts
Managing changes
As a Project Manager(PM), you wish to manage all the changes through a change request.
Which of these benefits will the PM get by enabling change requests?
Options
. They can monitor their own activities.
. Whole project will be assigned to a single package for ease of transport.
. They can process their assigned activities.
. Objects are locked for developers not belonging to project.
Handling function call errors
You encountered the following error while working with Angular 8.
Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function.
Which of the following can be considered as valid reasons for the same?
1. You have set a provider's use factory to an anonymous function.
2. You have set a provider's use factory to an arrow function.
Options
- Only 1
- Only 2
- Both 1,2
- None of these
Styling Components
Which of the following is a valid way to add styles to a component in Angular?
- By setting styles metadata.
- By setting styleUrls metadata.
- With CSS imports.
options
- a. Either 1 or 3
- b. Either 2 or 3
- c. Either 1 and 2
- d. All 1, 2 or 3
Building Accessible Dashboards
You have created a dashboard which you want to make accessible to as many people as possible.
Which of the following step(s) will you choose to perform the action successfully, in the above given context?
Options
a. Publish and embed that dashboard into a web page that conforms to Web Content Accessibility guidelines
b. Create the dashboard in Tableau Desktop
c. Create the dashboard in web authoring on Tableau Server or Tableau Online
d. All of the the given options
Create fields with schema builder
You are creating fields in Salesforce with schema builder and ensuring that the custom field name and label are unique.
What happens if the standard and custom fields have identical names or labels?
Options
a. The merge field will display the custom field value
b. The merge field will display the standard field value
c. The merge field will display an unexpected value
d. The merge field will display the either of the name/label
Optimizing code for performance
You are in the process of optimizing your code for performance in ABAP. You notice that there are a lot of global variables.
Could this be an issue? If so, what should be done?
Options
a. No, this is not an issue
b. Yes, you can pass them as arguments in internal subroutines
c. Yes, you should use call by reference for variables used in internal subroutines
d. Yes, each global variable must also have a local version
Graphx Operators in PySpark
You are collecting neighboring vertices and their attributes at each vertex for an adirected graph in pySpark. Which of these operators can help you successfully do this?
1. collect NeighborIds
2. collect Neighbors
Options
a. Only 1
b. Only 2
c. Both 1,2
d. None of these
Analyze the code
Analyze the UDF function used in pySpark given below.import pandas as pd from pyspark.sql.functions import pandas_udf from pyspark.sql import Window df = spark.createDataFrame( [(1, 1.0), (1, 2.0), (2, 3.0), (2, 5.0), (2, 10.0)], ("id", "v")) @pandas_udf("double") def mean_udf(v: pd.Series) -> float: return v.mean() df.select(mean_udf(df['v'])).show() df.groupby("id").agg(mean_udf(df['v'])).show() w = Window \ .partitionBy('id') \ .rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing) df.withColumn('mean_v', mean_udf(df['v']).over(w)).show()
Which of the following statements regarding this code are valid?
Options
a. This type of UDF does not support partial aggregation
b. all data for a group or window will be loaded into memory by this code.
c. Only unbounded window is supported by this code
d. Both 1,2
e. All of these
Skills Covered
- IT-Programming Languages/Frameworks
Assessing
- Fundamentals
Question Type
- MCQ
Build an game simulation app
Project description:
Looking at the excitement of Cricket Premier League in your friend circle, you have decided to make a web application using MEAN Stack. The application allow users to form their own Cricket Premier League teams from a given a list of players. If a user is not able to find the desired player in the list, the user can add a new player to the list and then add it to the team.
User can change the role of an already existing player (Batsman, Bowler, Wicket Keeper). User can delete a player from the list. However, updating and deletion of players in the list must be reflected in team that user made.
To make this application challenging you put a condition that the formed team must be a valid team. A valid team has exactly 2 Batsman, 2 Bowler and 1 Wicket Keeper.
Your application must prompt the user, below mentioned messages if they form an invalid team.
'You do not have required number of batsmen in your team'
'You do not have required number of bowler in your team'
'You do not have required number of wicketkeeper in your team'
You need to make changes in -
1. src/app/players/player-edit/player-edit.component.ts
2. src/app/team/team.service.ts
3. server/controllers/player.controller.js
A player is represented with 3 main properties:
1. name: denoting the name of player.
2. description: denoting the role of player (Batsman, Bowler, Wicket Keeper).
3. inTeam: whether or not this player is part of the team.
Notes:
- Do not change label, input, button vs. attributes since it will disrupt application behavior (like id, \*ngFor, component name attributes).
- Implementation related specifics are added directly as comments in the workspace.
- Ensure that the structure and datatype of the components are followed as specified in the comments to ensure that the code is evaluated correctly.
- Use Test App button often as described below (step 4), so you will be guided by test error messages.
- When you delete or edit something you shouldn't have, test messages will give an error accordingly.
- Click the "submit app" in the run dropdown once all the tasks are completed.Once all tasks are successfully implemented, you will receive an answer key.
- Go back to the question and save the answer key in the text editor below.
IDE Instructions
1. Click on the triangle play icon shown on the left side panel.
2. Scroll to the run bar.
3. You will find a dropdown in the top left side of the screen that says “Start&Debug”. -> You can click on this to start the application for previewing the project in browser and debugging.
4. The next entry is called “Test App” . You can use this to test your application when you have successfully completed the task set in the problem statement.
5. The next entry in the dropdown is called “Submit App”. You can select this entry and click on the play icon to submit your application code once you have completed all the tasks assigned.
If the task is completed successfully an alphanumeric code will be displayed. This code needs to be pasted in the answer box provided in the platform, and the save answer button below it needs to be clicked to successfully complete evaluation.
Note 1: You need to click on the play icon selected in step 1 after selecting the required entry from dropdown mentioned in step 2 to experience the behaviour described above.
Note 2: Please ensure that instruction in step 5 is followed completely, otherwise your code may not be evaluated.
Skills Covered
- Fullstack
- MEAN Stack
Assessing
- Fundamentals
Question Type
- Project
Winning Team
There is a scientific competition held every year in which students participate in the form of teams, the team that solves all the problems wins. We know that every student has power Pi in a subject Si.
It is given that quiz questions will demand powers of at least Qpj in subject j (where j is from 1 to k). If there are two students with power X and Y in subject Z, the power of the team in that subject will be X + Y.
You have N students and want to choose from them a team that can solve all the problems of the competition and be composed of as few students as possible. It is mandatory that you choose a successive subgroup while selecting a team.
Your task is to find the smallest number of students in the team to be able to win. If it is not possible to determine the answer print -1.
Function Description
Complete the CalcMin function in the editor below. It has the following parameter(s):
Name | Type | Description |
---|---|---|
K | INTEGER | Number of subjects. |
N | INTEGER | Number of students. |
Qp | INTEGER ARRAY | The power required to solve the problems of each subject. |
S | INTEGER ARRAY | Favorite subject for each student. |
P | INTEGER ARRAY | The power of the student in his subject. |
Return. | The function must return an INTEGER denoting the smallest number of students in the team to be able to win. |
Constraints
1. 1 ≤ K ≤ 10^3
2. 1 ≤ N ≤ 10^6
3. 1 ≤ Qp[i] ≤ 10^5
4. 1 ≤ S[i] ≤ K
5. 1 ≤ P[i] ≤ 10^5
Input format for debugging
1. The first line contains an integer, K, denoting the number of elements in Qp.
2. The next line contains an integer, N, denoting the number of elements in S.
3. Each line i of the K subsequent lines (where 0 ≤ i < K) contains an integer describing Qpi.
4. Each line i of the N subsequent lines (where 0 ≤ i < N) contains an integer describing Si.
5. Each line i of the N subsequent lines (where 0 ≤ i < N) contains an integer describing Pi.
Sample Testcases
Input | Output | Output Description |
1 3 5 1 1 1 3 1 3 | 3 | Here we will take all the students so that the team can solve all the problems. |
2 4 4 2 1 2 1 1 2 2 3 5 | 3 | Here we will take the first three students. |
2 4 4 4 1 2 2 1 5 5 5 5 | 2 | Here we will take the first two students. |
Skill Covered
- Fullstack
- MEAN Stack
Assessing
- Fundamentals
Question Type
- Project
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
Serving static images in Express
Which of these code snippets can you use to do this?
You want to serve static images in two different directories named thisd and thatd.
a. app.use(express.static('thisd')) app.use(express.static('thatd')) b. app.use(express.static('thisd',"thatd")) c. app.use('static', express.static('thisd')) app.use('static', express.static('thatd')) d. app.use('static', express.static('thisd',"thatd"))
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(); });
a. request path name
b. authenticated user
c. user settings
d. download path name
Skill Covered
- ExpressJS
- Responses
Assessing
- Fundamentals
Question Type
- MCQs(Single Correct)
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”?
a. db.users.find({"username" : {"$ne" : "John"}})
b. db.users.find({"username" : {"$not" : "John"}})
c. db.users.find({"username" : {"$else" : "John"}})
d. db.users.find({"username" : {"$except" : "John"}})
Skills Covered
- MongoDB
- Queries
Assessing
- Fundamentals
Question Type
- MCQs (Single Correct)
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?
a. You can apply host styles conditionally
b. You can include another selector inside the host
c. You can target the host element
d. You can host element inside parent's component
Skills Covered
- Angular
- Component Interaction
Assessing
- Fundamentals
Question Type
- MCQs (Single Correct)
Working with a IoT application
Imagine an IoT application that has the source code as shown below for displaying files.
<?php
print(enter file name);
$file=_GET['filename'];
system("cat $file");
?>
Which of these inputs should be provided to this device to delete all files in the root directory?
1. robot.txt
2. root rf
3. 'a.txt; rm -rf /; ' "
4. a.txt'; ls /;
Skills Covered
- Application Security
- IoT applications
- IT-Web Development
Assessing
- Fundamentals
Question Type
- MCQs(Single Correct)
Exploit attributed to vulnerabilities
While analyzing the security for an 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?...
Creating a remote shell
You want to create a remote shell and run a given command to gather data using a backdoor.
In the given context, which of these android vulnerabilities can be exploited to do so?
Options
a. ADVSTORESHELL
b. AndroRAT
c. PJApps
d. INTENTSH
Skills Covered
- Android Vulnerabilities
- Application Security
- IT-Web Development
Assessing
Fundamentals
Hands-on
Question Type
- MCQs(Single Correct)