Browse through 1000+ sample questions and get ready to hire the best technical talent

All
Problem Solving
Programming Logic
Data Structures
Algorithms
Dynamic Programming
Greedy Algorithm
C++
Java
Javascript
Python
OOP Concepts
C#
Golang
Kotlin
R Programming
Data Science
Data Analytics
Machine Learning
Deep Learning
Data Visualisation
Sklearn
SQL
Data Lake
Data Warehousing
MySQL
Data Modeling
DevOPs
Infrastructure Engineering
Linux Scripting
AWS
Azure
Bash
Troubleshooting
Cloud Migration
Ansible
Docker
Kubernetes
MariaDB
Chef
Puppet
Networking
System Administration
Nodejs
Django
Java Spring
Mean Stack
Go lang
Springboot
Oracle PL/SQL
Scala
HTML
CSS
Angular
Reactjs
Vue.js
.NET Framework
Basics of Software Testing
Non Functional Testing
Automated Testing
Security Testing
Manual Testing
Penetration Testing
Clean Coding
Selenium
Testcomplete
Cypress
Jmeter
Appium
TDD
SoapUI
Salesforce CRM
Service Cloud
SAP ERP
SAP HANA
SAP SCM APO
SAP BI
Cognos
SPSS
Datapower
IBM Integration Bus
Datastage
IBM Sterling
AppDynamics
Mern Stack
DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Salesforce – Briefly explain the steps to connect to Salesforce with Server-Side Controllers when working with aura components in Salesforce.
Salesforce
  • Medium
  • Code
  • 30mins

Briefly explain the steps to connect to Salesforce with Server-Side Controllers when working with aura components in Salesforce. Assume that you have already accomplished the following:

  1. Created Aura components
  2. Handled the actions with controllers
  3. Input the data using Forms

Write the steps in a doc file and upload the same.

Maximum Correlation for each column – In this problem,you are given a sample of 3 years medical data. It is divided into Cancer, Stroke and Cardio vascular as columns and index respectively.
Data Science
  • Medium
  • Code
  • 30mins

Problem Statement

In this problem,you are given a sample of 3 years medical data. It is divided into Cancer, Stroke and Cardio vascular as columns and index respectively. In order to get an insight into this data, you need to find a correlation of each column against other columns in this dataset.

Your final answer would be to find out the maximum correlation of each column against other columns.

Machine Learning – Consider a supervised training of a machine learning model where 80% of the training samples are of…
Machine Learning Supervised learning
  • Hard
  • MCQ
  • 1min

Consider a supervised training of a machine learning model where 80% of the training samples are of class C1 and the remaining are of class C2. The training accuracy of this classifier is computed as the ratio of “number of correct prediction” to “total number of predictions made”.

In which of these circumstances could the accuracy of the model be trusted the most?

Machine Learning – A dog trainer wants to use reinforcement learning to teach new tricks to a dog at her home…
Machine Learning Reinforcement Learning
  • Medium
  • MCQ
  • 1min

A dog trainer wants to use reinforcement learning to teach new tricks to a dog at her home. She emulates a situation, and the dog tries to respond in many different ways. If the dog’s response is in the desired way, a treat is given.

Whenever the dog is exposed to the same situation, the dog executes a similar action with even more enthusiasm in expectation of getting more treats. The dog also learns what not do when faced with negative experiences.

In the given scenario, who could be the agent?

Plot the Medal Tally – You are working as a data analyst for the sports column of a leading News Paper Firm…
Data Visualization Plots
  • Easy
  • Code
  • 30mins

Problem Statement

You are working as a data analyst for the sports column of a leading News Paper Firm. As the 2016 Olympics has recently concluded, you need to publish the medal tally for each country as a bar graph for tomorrow’s sports column.

In this problem, you are given a data set containing medal tally of 21 countries. You need to analyze the data and plot a bar graph of the medals tally under each country.

Data Visualization – You have published a data source to the web when using Tableau on the Web…
Data Visualization Tableau
  • Easy
  • MCQ
  • 1min

You have published a data source to the web when using Tableau on the Web. Which of following actions will you not be able to perform in the given scenario?

1. Editing the data model.

2. Viewing the data model.

Stacks and Queues Difference – You are given a 0-indexed array A of length N…
Queue Stack
  • Medium
  • Code
  • 30mins

You are given a 0-indexed array A of length N. You make an array B from A by inserting all the elements of A into a stack and removing the elements one by one in order. Similarly, you make an array C from A by inserting all the elements of A into a queue and removing the items one by one in order. Calculate sum(abs(CiBi)) over all i from 0 to N-1 modulo 10^9+7.

Note, that due to the fixed order of addition and removal from a stack and a queue, B and C are uniquely determined.

Data Structures – You need to store a set of character values in a data structure such that…
Data Structures
  • Hard
  • MCQ
  • 1min

You need to store a set of character values in a data structure such that the most efficient constant-time random access is allowed and optimal locality of reference is maintained.

In the given context, which of these data structures are you likely to choose for doing so?

Data Structures – You have defined a data structure that allows you to store a collection of elements in…
Data Structures
  • Medium
  • MCQ
  • 1min

You have defined a data structure that allows you to store a collection of elements in non-contiguous locations linearly. This is done by adding a reference to the next element in the current element i.e. The ith element stores the location for the (i+1)th element and so on.

Which of these data structures is being referred to in the given context?

Data Structures – Which of the following is considered as an example of a composite data type…
Data Structures
  • Easy
  • MCQ
  • 1min

Which of the following is considered as an example of a composite data type?

MySQL – You are asked to create a data managing system for a package delivery firm in MySQL…
MySQL
  • Easy
  • Code
  • 30mins

You are asked to create a data managing system for a package delivery firm in MySQL. It is given that the firm manages salesmen who deliver packages to destination listed by the customer for a particular delivery. You have created the following tables in order to do so.

CREATE TABLE Salesman (
  salesman_id INT NOT NULL,
  name VARCHAR(255) NOT NULL,
  city VARCHAR(255),
  comission DOUBLE(255, 2),
  PRIMARY KEY (salesman_id)
);

CREATE TABLE Customer (
 customer_id INT NOT NULL,
 cust_name VARCHAR(255) NOT NULL,
 city VARCHAR(255),
 grade INT,
 salesman_id INT,
 PRIMARY KEY (customer_id),
 FOREIGN KEY (salesman_id) REFERENCES Salesman(salesman_id)
);

CREATE TABLE Orders (
  ord_no INT NOT NULL,
  purch_amt DOUBLE(255, 2) NOT NULL,
  ord_date DATE,
  customer_id INT,
  PRIMARY KEY (ord_no),
  FOREIGN KEY (customer_id) REFERENCES Customer(customer_id)
  FOREIGN KEY (sales_id) REFERENCES Salesman(salesman_id)
);

Orders

Customer

Salesman

Create a package as follows

1.Write a function that returns the level of the customer based on the grade(G) as follows:

Level is Silver if 50 <= G <= 150

Level is Gold if 151 <= G <= 300

Level is Diamond if 301 <= G <= 500

2.Write individual stored procedures to do the following

a. List out all the names of all customers with salesman_id equal to 5001, in alphabetical order.

b. Display the details of orders on 5th October 2012.

c. Increase the commission of a salesman by 0.2% if he/she works for a customer in a different city than the one he resides in.

3.Write a function with parameter argument given as sales_id and find the net purchase for the customer whose sales_id is equal to the parameter that is passed to the function.

Perform the above given tasks in your system and upload a doc file containing the solutions for the respective tasks.

MySQL – Which of the following is the correct syntax to remove…
MySQL
  • Easy
  • MCQ
  • 1min

Which of the following is the correct syntax to remove all the permissions for an account in MySQL?

MySQL – The execution of the query given below is similar to which of these queries with respect to…
MySQL
  • Hard
  • MCQ
  • 1min

The execution of the query given below is similar to which of these queries with respect to merging of the derived table “derivedtable”?

SELECT * 
FROM (SELECT * FROM table) 
AS derivedtable;

MySQL – Which of these statements is true with respect to the null rejections that occur…
MySQL
  • Medium
  • MCQ
  • 1min

Which of these statements is true with respect to the null rejections that occur in the below given query?

SELECT * FROM Table1 LEFT JOIN Table2 ON Table2.A=Table1.A
LEFT JOIN Table3 ON Table3.B=Table1.B
WHERE Table3.C > 0

ASCII String – There exists a function “X” such that it accepts two input parameters A & B and whose output depends on…
Polymorphism
  • Medium
  • Code
  • 30mins

Problem Statement

There exists a function “X” such that it accepts two input parameters A & B and whose output depends on the operation you decide to perform on A & B.

  • Operation 1: It accepts two integer parameters (A & B) and prints the sum of the two integers.
  • Operation 2: It accepts two string parameters and concatenates the two strings (A & B) and displays the result.
  • Operation 3: It accepts two parameters one of type entier and the autre is of type string and prints the sum of ascii characters of the string to the integer and displays the integer result.

Write a program to display the operation of X using the two string inputs provided by the user.

OOPs Concepts – Consider the given code snippet where two classes “D1” and “D2” are derived from a common class “Base”…
OOPs Concepts Inheritance
  • Medium
  • MCQ
  • 1min

Consider the given code snippet where two classes “D1” and “D2” are derived from a common class “Base.”

class Base{
}
class D1 extends Base{
}
class D2 extends Base{
}

Which of these options representing the association that is achieved through this design is true?

OOPs Concepts – Suppose you have two classes “B” and “C” which inherits the class “A” using public derivation…
OOPs Concepts Inheritance
  • Hard
  • MCQ
  • 1min

Suppose you have two classes “B” and “C” which inherits the class “A” using public derivation. Now, you have created a class “D” by inheriting both “B” and “C”. When you tried to access the methods of class “A” using object of “D”, you found an ambiguity problem.

Which of the following will help you solve this problem?

OOPs Concepts – Which of the following would you find hard to achieve using Object Oriented Programming…
OOPs Concepts OOPs features
  • Easy
  • MCQ
  • 1min

Which of the following would you find hard to achieve using Object Oriented Programming?

1. Source code reusability

2. Source code maintainability

3. Developing transparent control flow

Deep Learning – Which of the following is NOT a gating mechanism used in LSTMs…
Recurrent Neural Networks LSTM
  • Easy
  • MCQ
  • 1min

Which of the following is NOT a gating mechanism used in LSTMs?

1. the forget gate

2. the update gate

3. the input gate

Deep Learning – The network given below takes state as an input and produces the probability distribution of actions…
Deep Reinforcement Learning Policy gradient
  • Hard
  • MCQ
  • 1min

The network given below takes state as an input and produces the probability distribution of actions.

What is the relation between the statement given below in this context?

Statement1: The given network is not entirely similar to a Deep Q Network

Statement2: The given network is a classification problem

Deep Learning – You are using the max pooling technique to perform pooling on the convolved feature given below…
Convolutional Neural Network Pooling
  • Medium
  • MCQ
  • 1min

You are using the max pooling technique to perform pooling on the convolved feature given below.

What will the convolved feature contain after max pooling it?

Logistic Regression – You are given a dataset from a Tic-Tac-Toe game…
Coding Logistic Regression
  • Easy
  • Code
  • 30mins

Problem Statement

You are given a dataset from a Tic-Tac-Toe game.The moves on the boards are given as left,right and middle respectively and the result of the game is given as Target_data.

Based on the given information,Predict the target_data based on all the moves using Logistic regression.

Salesforce CRM – When working with the Kanban view in lightning experience, you observe a yellow triangle on…
Salesforce
  • Hard
  • MCQ
  • 1min

When working with the Kanban view in lightning experience, you observe a yellow triangle on an opportunity card. Which of these alerts does the card represent in the given context?

  1. Overdue tasks
  2. No open activities
  3. No activity for 30 days

Salesforce CRM – How can you keep your system performance optimal when creating sales paths in…
Salesforce Lightning experience basics
  • Medium
  • MCQ
  • 1min

How can you keep your system performance optimal when creating sales paths in salesforce lightning experience?

Salesforce CRM – Which of the following are valid fields of a standard and custom objects when…
Salesforce Data modelling
  • Easy
  • MCQ
  • 1min

Which of the following are valid fields of a standard and custom objects when performing data modelling in salesforce classic?

  1. Identity
  2. Name
  3. System
  4. Custom

Decreasing Numbers Easy – A non-increasing sub-sequence is a sequence in which each subsequent element is…
Implementation Logic
  • Easy
  • Code
  • 30mins

A non-increasing sub-sequence is a sequence in which each subsequent element is not greater than the previous element.

You are given a number N. Calculate the number of numbers <= N whose decimal representation forms a non-increasing sub-sequence.

Example – 531 has a non-increasing decimal representation while 591 does not have a non-increasing decimal representation because 5<9.

Programming Logic – You have been given an array and you have to find the length of the maximum zigzag subsequence…
Programming Logic
  • Hard
  • MCQ
  • 1min

You have been given an array and you have to find the length of the maximum zigzag subsequence. A Zig-Zag subsequence is a subsequence such that the elements are alternatingly increasing and decreasing.

You have been given the following pseudocode for finding the maximum length of zigzag sequence in a given array.

get the input in an array named arr
initialise the a 2d array named Z[length of array][2]
for base case make all entries as 1

/* Note:
Z[i][0] = Length of the longest Zig-Zag subsequence ending at index i and last element is greater than its previous element
Z[i][1] = Length of the longest Zig-Zag subsequence ending at index i and last element is smaller than its previous element */

loop 1: for i = 1 to length of array
loop 2: for j = 0 to i
if (X)
Z[i][0] = Z[j][1] + 1
if( arr[j] > arr[i] && Z[i][1] < Z[j][0] + 1)
Y

find max of all entries and return the value

What can be used in place of X and Y to complete the pseudocode given above?

Programming Logic – You have been given an array and a parameter k…
Programming Logic
  • Medium
  • MCQ
  • 1min

You have been given an array and a parameter k. You have to output the starting index of the subarray with size k, that has the minimum sum among all subarrays of size k present in the given array.

The pseudocode for doing the same is given below.

find the cumulative sum and store that in an array named carr:
for int i = 0 to length of array
csum[i] = arr[i]
for int i = 1 to length of array
X
initialise the min_sum as csum[k-1] // first sub array
initialise the index as 0 // starting index of first sub array

for int i = k to length of array
subarray_sum = csum[i] - csum[i-k-1]
if( Y ):
update min_sum
update the index

return index

What can be used in place of X and Y to complete the pseudocode?

Programming Logic – You have written the following pseudocode to find the symmetric elements in an array…
Programming Logic
  • Easy
  • MCQ
  • 1min

You have written the following pseudocode to find the symmetric elements in an array.

get the input of array in an array named array
initialise another array and store the reverse of previous array in an array name rev_array
declare a counter variable
now run a loop from i = 0 to end of array
X
update counter
print this element
end loop

if counter == 0:
print no symmetric element found

You need to display any symmetric elements found and display an appropriate message if there are no symmetric elements found. However a part X in the pseudo code is missing. Analyze the snippet and determine the appropriate statement to be placed in X?

[Note: A symmetric element is an element that does not change its position even if the array is reversed]

Linux Scripting – Write a bash script to record the values on built in variables…
Linux Scripting
  • Medium
  • Code
  • 30mins

Write a bash script to record the values on built in variables. Write the script in a doc file and upload the same.

Linux Scripting – You have a text file called demo containing the following lines…
Linux Scripting
  • Hard
  • MCQ
  • 1min

You have a text file called demo containing the following lines of text in a Linux system.

1. This is the first line of an experiment.

2. It is a text with experiment.

3. Lots of errors are present.

4. So much errors, all these errors are making me sick.

5. This is a line not containing any errors.

6. This is the last line of my experiment.

Now, you are asked to find all the lines containing the search pattern ‘experiment’ and print the lines matching the pattern in the shell. Which of these shell commands can you use for doing so?

Linux Scripting – Which of the following bash script would check if a file is readable and…
Linux Scripting
  • Medium
  • MCQ
  • 1min

Which of the following bash script would check if a file is readable and has size greater than zero?

Linux Scripting – Which of the following commands allows the user to search for…
Linux Scripting Grep
  • Easy
  • MCQ
  • 1min

Which of the following commands allows the user to search for all four character words in A.txt?

Salesforce – You assign multiple presence configuration settings to provide Omni-Channel functionality…
Salesforce Omni-Channel configuration
  • Hard
  • MCQ
  • 1min

You assign multiple presence configuration settings to provide Omni-Channel functionality. Which of these behaviors can be expected in the given scenario?

Salesforce – You are performing an upgrade from Salesforce v2 to Marketing cloud connect…
Salesforce Basic Concepts/Configuration
  • Medium
  • MCQ
  • 1min

You are performing an upgrade from Salesforce v2 to Marketing cloud connect. While doing so which of these steps would you take to preserve tracking data?

Salesforce – You want to enable a remote system to authenticate and connect to Salesforce in order to…
Salesforce Integration Concepts
  • Easy
  • MCQ
  • 1min

You want to enable a remote system to authenticate and connect to Salesforce in order to update existing records. Which of these Integration patterns are you likely to utilize for this purpose?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

 What should be used at Blank5 to quit the whole browser session?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank4 to replace the value of the header row with an empty string?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank3 to get all the Columns of table with tag ‘td’?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank2 to Get all the Rows of table with tag ‘tr’?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank1 to create the object of the first table using the xpath “//div[@id=’mw-content-text’]//table[1]” to locate the table?

Selenium – You are using theAjaxElementLocatorFactory class in an implementation of a PageFactory pattern when…
Selenium Page Factory
  • Hard
  • MCQ
  • 1min

You are using theAjaxElementLocatorFactory class in an implementation of a PageFactory pattern when you encounter the following exception.
NoSuchElementException
Which of these can be considered as valid reasons behind the same?

  1. An invalid memory address reference was made during the call to the element.
  2. Element cannot be found in the specified interval

Selenium – You want to be able to lookup parent element from child elements when working with selenium…
Selenium Handling Ajax Components
  • Medium
  • MCQ
  • 1min

You want to be able to lookup parent element from child elements when working with selenium. Which of the following can be used to locate the web elements in the given scenario?

1. XPath

2. CSS selector

Selenium – Which of these cannot be used to move between windows in selenium using the switch to command…
Selenium Handling Multiple Windows
  • Easy
  • MCQ
  • 1min

Which of these cannot be used to move between windows in selenium using the switch to command?

Clean Coding – Consider the given code snippet…
Clean Coding Design smells C++
  • Hard
  • MCQ
  • 1min

Consider the given code snippet.

class Product {
    private:
    string type;

    Product(string type) {
        this->type = type;
    }

    int getBasePrice() {
        switch (this->type) {
            case food:
                return 10;
            case drinks:
                return 7;
            case books:
                return 3;
            default:
                return 0;
        }
    }

    int getTaxPercent() {
        switch (this->type) {
            case food:
            case drinks:
                return 24;
            case books:
                return 8;
            default:
                return 0;
        }
    }

    string getProductCategory() {
        switch (this->type) {
            case food:
            case drinks:
                return 'Food and Beverages';
            case books:
                return 'Education';
            default:
                return '-';
        }
    }
}

You notice that when introducing a new product type in the code, you’ll have to make changes in three different methods of the class. Which of these design smells does the given snippet have?

Clean Coding – Analyze the code given below and determine the type of abstraction design smell present in the code snippet…
Clean Coding Design Smell C++
  • Medium
  • MCQ
  • 1min

Analyze the code given below and determine the type of abstraction design smell present in the code snippet.

class Throwable
{
  //Prints the stack trace as a string to the standard output
  //write regex for processing stack trace
  public:
  void printStackTrace();
  //other methods are avoided
}

Clean Coding – Which of these functions in the given code snippet depicts a lazy code smell…
Clean Coding Code smells C++
  • Easy
  • MCQ
  • 1min

Which of these functions in the given code snippet depicts a lazy code smell?

#include <iostream>

using namespace std;
int remainder(int a, int b) //Fun1
{
  return(a % b);
}
  
int add(int a, int b) //Fun2
{
    return (a + b);
}

int multiply(int a, int b) //Fun3
{
  return (a * b);
}

int main() 
{

  int sum;
    sum = add(100, 78);
    cout << "100 + 78 = " << sum << endl;
    mul = multiply(10, 78);
    cout << "10 * 78 = " << mul << endl;
    return 0;
}

Merge Sort Calls – You are given an array A of N elements…
Algorithm Implementation Sort
  • Medium
  • Code
  • 30mins

You are given an array A of N elements. You want to sort it in non-decreasing order using merge-sort algorithm. It involves using a recursive function mergeSort(A,l,r):

  1. If the segment [l,r) is already sorted in non-decreasing order return.
  2. Let mid = (l+r)/2.
  3. Call mergeSort(A, l, mid)
  4. Call mergeSort(A, mid, r)
  5. Merge segments [l, mid) and [mid, r), making the segment [l, r) sorted in non-descending order.

The initial call made is mergeSort(A,0,N). Find the number of times mergeSort function is called to sort the given array in non-decreasing order.

Algorithms – Consider an unbalanced tree (not necessarily a Binary Tree) of n nodes…
Algorithms
  • Hard
  • MCQ
  • 1min

Consider an unbalanced tree (not necessarily a Binary Tree) of n nodes. You have to update weight of the n1th edge to n2 and print the maximum edge weight on the path from node n1 to node n2.

To achieve the above, you create a tree using an adjacency matrix representation of the tree (tree[][]).

Assume that you have found the sub-tree size, depth and the parent of each node using an appropriate graph algorithm and you could successfully decompose the tree into disjoint chains. What should be your next step towards achieving the above task?


Algorithms – A graph containing ‘a’ vertices and ‘b’ edges is run using a Breadth First Search algorithm…
Algorithms
  • Medium
  • MCQ
  • 1min

A graph containing ‘a’ vertices and ‘b’ edges is run using a Breadth First Search algorithm. Select the appropriate expression that represents the running time.


Algorithms – You are using the algorithm given below to create a simple implementation of a Huffman tree…
Algorithms
  • Easy
  • MCQ
  • 1min

You are using the algorithm given below to create a simple implementation of a Huffman tree.

loop a = EXTRACTMIN(N);
if N = ∅ then return a endif;
ν = EXTRACTMIN(N);
create node κ with children a and b
and weight w(k) = w(a) + w(b);
add k to N

Analyze the algorithm and predict the worst case running time complexity for the same.


Data Science – Which of the following cross-validation techniques would you use in a Binary Classification problem when…
Python Binary Classification
  • Hard
  • MCQ
  • 1min

Which of the following cross-validation techniques would you use in a Binary Classification problem when the target variable is unbalanced?

 

Data Science – Predict the correct value of x in the code snippet given below…
Python
  • Medium
  • MCQ
  • 1min

Predict the correct value of x in the code snippet given below.

try:
x = 11 + 21
except:
x = 23 + 32
else:
x += 1
finally:
print(x)
Data Science – Which of the following functions you can use to create a Moving Average table calculation while…
Tableau Functions
  • Easy
  • MCQ
  • 1min

Which of the following functions you can use to create a Moving Average table calculation while working with Tableau?

Machine Learning – Which of the following would help increase the performance of a Machine learning model…
Machine Learning models Performance
  • Easy
  • MCQ
  • 1min

Which of the following would help increase the performance of a Machine learning model?

Chess Grandmaster in Problem Solving – A famous chess grandmaster was analyzing one of his games in his head and…
Application Implementation Logic Programming
  • Easy
  • Code
  • 30mins

A famous chess grandmaster was analyzing one of his games in his head and… he suddenly forgot the positions of two important pieces.

However, he is sure about some facts:

  • the location of the first piece on the board is (x1; y1) and xl1 <= x1 <= xr1, yl1 <= y1 <= yr1
  • the location of the second piece on the board is (x2; y2) and xl2 <= x2 <= xr2, yl2 <= y2 <= yr2
  • the chessboard cells corresponding to the pieces are of the same color

In other words, he doesn’t remember the exact positions of the pieces, however, for every piece, he is sure about the part of the board where it can be. Part of the board here is just a rectangular submatrix described by 4 coordinates.

Note: obviously, two pieces can’t be in the same location.

Now the grandmaster is wondering, how many placements of this two pieces are possible if he remembers everything correctly?

Problem Solving – A server has to serve n customers(labelled 1 through n)…
Problem Solving Programming basics
  • Hard
  • MCQ
  • 1min

A server has to serve n customers(labelled 1 through n). The service time required to serve ith customer is t(i) and is known in advance and there is no parallelism. If the customers are served in order, i.e., i1, i2,….in, the waiting time for customer i1 is t(i1), for customer i2 is t(i1)+t(i2), and so on.

What strategy should be used to serve all the customers in a minimum total time?

Problem Solving – You are using the following algorithm to implement a queue by reusing two stacks…
Problem Solving Stacks
  • Medium
  • MCQ
  • 1min

You are using the following algorithm to implement a queue by reusing two stacks.

A(q, x)

1) Push x to stack1

B(q)

1) If both stacks are empty then error.

2) If stack2 is empty

While stack1 is not empty, X

3) Pop the element from stack2 and return it.

What can be used in place of X to complete the algorithm?

[Assume that the size of stacks is unlimited.]


Problem Solving – Given is the set of four numbers that relate to each other in a certain way…
Problem Solving Puzzles
  • Easy
  • MCQ
  • 1min

Given is the set of four numbers that relate to each other in a certain way.

Determine the missing number in the third set.

[Assume the third set also works in the same way as the first and the second set]

SQL Query 2 – Read the below tables of a database and write a SQL query to display the…
Follows sequence of order while writing a SQL query SQL Writing Subquery
  • Easy
  • Code
  • 30mins

Read the above tables of a database and write a SQL query to display the PRODUCT_ID,PRODUCT_NAME,ORDER_QUANTITY and list which of the other products were bought apart from ‘P01’ given their total ORDER_QUANTITY bought is greater than 75.

SQL – Consider the tables advisors and students given below…
SQL Joins
  • Hard
  • MCQ
  • 1min

Consider the tables advisors and students given below.

CREATE TABLE `advisors` (
  `advisor_id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  PRIMARY KEY (`advisor_id`)
)

CREATE TABLE `students` (
  `student_id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `advisor_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`student_id`),
  KEY `advisor_id` (`advisor_id`),
  CONSTRAINT `students_ibfk_1` FOREIGN KEY (`advisor_id`) REFERENCES `advisors` (`advisor_id`)
);

Which of the following query can you use to get the information on students and their advisors, excluding students who are not assigned to an advisor?

SQL – You have created an Employee table as follows…
SQL Alter table
  • Medium
  • MCQ
  • 1min

You have created an Employee table as follows.

CREATE TABLE Employees (
   ID int NOT NULL,
   LastName varchar(255) NOT NULL,
   FirstName varchar(255),
   Age int,
   TerminationDate DATE,
   HireDate DATE,
   Primary Key(ID)
 );

In the given context, which of these is a correct way to define a constraint that says that the TerminationDate must be after the HireDate?

SQL – What is the range of the values that will be retrieved by the BETWEEN operator in the following snippet…
SQL Between Operator
  • Easy
  • MCQ
  • 1min

What is the range of the values that will be retrieved by the BETWEEN operator in the following snippet?

WHERE column_name BETWEEN 50 AND 100

 

Encryption System in C# – You are tasked to design an encryption system which accepts 2 parameters below…
Application Code Implementation OOPs Typecasting
  • Easy
  • Code
  • 30mins

You are tasked to design an encryption system which accepts 2 parameters below:

  • A string which contains the message to be encrypted.
  • A locale parameter (integer) which specifies the encryption method to be used.

The values for the locale parameter are as follows:

  • Integer 0 is used to denote locale Asia.
  • Integer 1 is used to denote locale United states.
  • Integer 2 is used to denote locale Dubai.

The encryption techniques followed by each locale is described below:

  • All messages sent via Asia will be sent by encrypting all characters by a caesar shift of 2 i.e. ABC will be encrypted as DEF.
  • All messages sent via United States are represented in a dot separated ASCII format i.e ABC will encrypted as 65.66.67
  • All messages sent via Dubai encryption reverse the string and send it i.e. ABC will be sent as CBA.

You are given N messages that need to be encrypted with respect to their locale parameter.

C# – Analyze the C# code snippet given below and select the most appropriate choice…
C# Collections
  • Hard
  • MCQ
  • 1min

Analyze the C# code snippet given below and select the most appropriate choice.
using System;
using System.Collections.Generic;
public class Example
{
public static void Main()
{
IDictionary<string, string> openWith =
new Dictionary<string, string>();
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
openWith.Add("txt", "notepad.exe");
Console.WriteLine("\nKey Added");
}
}

C# – You want to build a collection class for a collection that does not meet the…
C# Interfaces Collections
  • Easy
  • MCQ
  • 1min

You want to build a collection class for a collection that does not meet the IList and IDictionary interface requirements.

Which of these can be used to derive the new collection in the given scenario?

 
C# – A SortedDictionary…
C# Collections
  • Medium
  • MCQ
  • 1min

A SortedDictionary<TKey,TValue>.ValueCollection. Enumerator in a generic collection produces the following exception.

InvalidOperationException.

Which of the following can be considered as valid reasons for the same?

Java8 – What will happen when the code snippet given below is compiled and executed…
Java8 Java Collections
  • Medium
  • MCQ
  • 1min

What will happen when the code snippet given below is compiled and executed?

1. List list = Arrays.asList(2, 4, 6, 7, 8);
2. boolean allEven = list.stream().allMatch( i -> {
3. System.out.print(i);
4. return i%2 == 0;
5. });

 
Exception Handling in Java – You have to implement the concept of Exception Handling in Java…
Application Coding Exception Handling Integer wrapper class Unchecked Exception
  • Easy
  • Code
  • 30mins

You have to implement the concept of Exception Handling in Java. The final task is to return either the sum or difference of two numbers or the exception caught.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Sub task 1: If n is a factor of x, display the sum of x and n. Otherwise, display the difference between x and n.

Sub task 2: Catch Arithmetic Exception if occurred and display the exception caught.

Sub task 3: Catch Number Format Exception if occurred and display the exception caught.

Sub task 4: Catch any other Exception occurred and display the exception caught.

Sets in Python 3 – The Python 3 set definition given alongside throws an error…
Python 3 Sets
  • Medium
  • MCQ
  • 1min

The Python 3 set definition given alongside throws an error. Which of the following is the reason for the error?

s = {1, ‘a’, [3, ‘d’], (4, ‘c’)}.

 
Tuple – You have to implement the concept of Tuple in Python3…
Application Coding Conversion Tuple Tuple Operations
  • Medium
  • Code
  • 30mins

You have to implement the concept of Tuple in Python3. The final task is to display the result of the tuple operations.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Sub task 1: Convert the list list1 and list2 into tuples tup and tup1, respectively.

Sub task 2: Display the tuple generated after multiplying the adjacent elements of the tuple tup.

Sub task 3: Create a tuple res storing the element-wise AND of tup and tup1.

Sub task 4: Display the list generated after chunking tuple res into z size.

 

JavaScript – Id’s have to be extracted from strings of format…
Javascript
  • Hard
  • MCQ
  • 1min

Id’s have to be extracted from strings of format ‘[id] <email>’.

In order to perform the above operations optimally, which of the below three regular expression would you use?

  1. /.*\[+(.*)+\].*/
  2. /\[([^\]]+)\].*/
  3. /\[([^\]]+)\]/

JSON in JavaScript – You have to implement the concept of JSON in JavaScript…
Implementation JSON JavaScript
  • Medium
  • Code
  • 30mins

You have to implement the concept of JSON in JavaScript. You are given an array of objects WordGame of length N. Each array object contains two data fields Tile and Score denoting an alphabet and score of that alphabet respectively. The final task is to return the maximum possible score a player can achieve by adding score of K number of tiles.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Subtask 1 : Parse the JSON object from the given string format and store into Array Scrabble.

Subtask 2 : Maximum possible score a player can achieve by adding K number of Tiles Array Scrabble.

 

Templates in C++ – The C++ program given below contains declarations of two function templates…
C++ Templates
  • Hard
  • MCQ
  • 1min

The C++ program given below contains declarations of two function templates. Including which of these function templates will make the program ill-formed?

T1
T2
void m( int p ) {
f(0, p);
}

Friend function in C++ – You have to implement the concept of Friend function in C++…
C++ Friend function
  • Medium
  • Code
  • 30mins

You have to implement the concept of Friend function in C++. The final task is to create two classes Point and Distance. You have been provided with N points, each having (x,y)coordinates.

Class Point contains two integer data fields x and y denoting (x,y) coordinates of a point and a friend function MaxDistance().

Class Distance contains a function Find_Distance() which takes four integer parameters x1, x2, y1 and y2 and returns the distance between (x1,y1) and (x2,y2). Return the maximum distance between any two points from N points.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Subtask 1 : Create a class Point containing two data fields x and y , a constructor Point() and a friend function MaxDistance() .

Subtask 2 : Create a class Distance which contains a function Find_Distance() to find the distance between any two points and a friend function MaxDistance() .

Subtask 3 : Create a friend function MaxDistance() which takes a vector of Points and an object of distance to call Find_Distance() function .

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Chess Grandmaster in Problem Solving – A famous chess grandmaster was analyzing one of his games in his head and…
Application Implementation Logic Programming
  • Easy
  • Code
  • 30mins

A famous chess grandmaster was analyzing one of his games in his head and… he suddenly forgot the positions of two important pieces.

However, he is sure about some facts:

  • the location of the first piece on the board is (x1; y1) and xl1 <= x1 <= xr1, yl1 <= y1 <= yr1
  • the location of the second piece on the board is (x2; y2) and xl2 <= x2 <= xr2, yl2 <= y2 <= yr2
  • the chessboard cells corresponding to the pieces are of the same color

In other words, he doesn’t remember the exact positions of the pieces, however, for every piece, he is sure about the part of the board where it can be. Part of the board here is just a rectangular submatrix described by 4 coordinates.

Note: obviously, two pieces can’t be in the same location.

Now the grandmaster is wondering, how many placements of this two pieces are possible if he remembers everything correctly?

Problem Solving – A server has to serve n customers(labelled 1 through n)…
Problem Solving Programming basics
  • Hard
  • MCQ
  • 1min

A server has to serve n customers(labelled 1 through n). The service time required to serve ith customer is t(i) and is known in advance and there is no parallelism. If the customers are served in order, i.e., i1, i2,….in, the waiting time for customer i1 is t(i1), for customer i2 is t(i1)+t(i2), and so on.

What strategy should be used to serve all the customers in a minimum total time?

Problem Solving – You are using the following algorithm to implement a queue by reusing two stacks…
Problem Solving Stacks
  • Medium
  • MCQ
  • 1min

You are using the following algorithm to implement a queue by reusing two stacks.

A(q, x)

1) Push x to stack1

B(q)

1) If both stacks are empty then error.

2) If stack2 is empty

While stack1 is not empty, X

3) Pop the element from stack2 and return it.

What can be used in place of X to complete the algorithm?

[Assume that the size of stacks is unlimited.]


Problem Solving – Given is the set of four numbers that relate to each other in a certain way…
Problem Solving Puzzles
  • Easy
  • MCQ
  • 1min

Given is the set of four numbers that relate to each other in a certain way.

Determine the missing number in the third set.

[Assume the third set also works in the same way as the first and the second set]

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Decreasing Numbers Easy – A non-increasing sub-sequence is a sequence in which each subsequent element is…
Implementation Logic
  • Easy
  • Code
  • 30mins

A non-increasing sub-sequence is a sequence in which each subsequent element is not greater than the previous element.

You are given a number N. Calculate the number of numbers <= N whose decimal representation forms a non-increasing sub-sequence.

Example – 531 has a non-increasing decimal representation while 591 does not have a non-increasing decimal representation because 5<9.

Programming Logic – You have been given an array and you have to find the length of the maximum zigzag subsequence…
Programming Logic
  • Hard
  • MCQ
  • 1min

You have been given an array and you have to find the length of the maximum zigzag subsequence. A Zig-Zag subsequence is a subsequence such that the elements are alternatingly increasing and decreasing.

You have been given the following pseudocode for finding the maximum length of zigzag sequence in a given array.

get the input in an array named arr
initialise the a 2d array named Z[length of array][2]
for base case make all entries as 1

/* Note:
Z[i][0] = Length of the longest Zig-Zag subsequence ending at index i and last element is greater than its previous element
Z[i][1] = Length of the longest Zig-Zag subsequence ending at index i and last element is smaller than its previous element */

loop 1: for i = 1 to length of array
loop 2: for j = 0 to i
if (X)
Z[i][0] = Z[j][1] + 1
if( arr[j] > arr[i] && Z[i][1] < Z[j][0] + 1)
Y

find max of all entries and return the value

What can be used in place of X and Y to complete the pseudocode given above?

Programming Logic – You have been given an array and a parameter k…
Programming Logic
  • Medium
  • MCQ
  • 1min

You have been given an array and a parameter k. You have to output the starting index of the subarray with size k, that has the minimum sum among all subarrays of size k present in the given array.

The pseudocode for doing the same is given below.

find the cumulative sum and store that in an array named carr:
for int i = 0 to length of array
csum[i] = arr[i]
for int i = 1 to length of array
X
initialise the min_sum as csum[k-1] // first sub array
initialise the index as 0 // starting index of first sub array

for int i = k to length of array
subarray_sum = csum[i] - csum[i-k-1]
if( Y ):
update min_sum
update the index

return index

What can be used in place of X and Y to complete the pseudocode?

Programming Logic – You have written the following pseudocode to find the symmetric elements in an array…
Programming Logic
  • Easy
  • MCQ
  • 1min

You have written the following pseudocode to find the symmetric elements in an array.

get the input of array in an array named array
initialise another array and store the reverse of previous array in an array name rev_array
declare a counter variable
now run a loop from i = 0 to end of array
X
update counter
print this element
end loop

if counter == 0:
print no symmetric element found

You need to display any symmetric elements found and display an appropriate message if there are no symmetric elements found. However a part X in the pseudo code is missing. Analyze the snippet and determine the appropriate statement to be placed in X?

[Note: A symmetric element is an element that does not change its position even if the array is reversed]

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Stacks and Queues Difference – You are given a 0-indexed array A of length N…
Queue Stack
  • Medium
  • Code
  • 30mins

You are given a 0-indexed array A of length N. You make an array B from A by inserting all the elements of A into a stack and removing the elements one by one in order. Similarly, you make an array C from A by inserting all the elements of A into a queue and removing the items one by one in order. Calculate sum(abs(CiBi)) over all i from 0 to N-1 modulo 10^9+7.

Note, that due to the fixed order of addition and removal from a stack and a queue, B and C are uniquely determined.

Data Structures – You need to store a set of character values in a data structure such that…
Data Structures
  • Hard
  • MCQ
  • 1min

You need to store a set of character values in a data structure such that the most efficient constant-time random access is allowed and optimal locality of reference is maintained.

In the given context, which of these data structures are you likely to choose for doing so?

Data Structures – You have defined a data structure that allows you to store a collection of elements in…
Data Structures
  • Medium
  • MCQ
  • 1min

You have defined a data structure that allows you to store a collection of elements in non-contiguous locations linearly. This is done by adding a reference to the next element in the current element i.e. The ith element stores the location for the (i+1)th element and so on.

Which of these data structures is being referred to in the given context?

Data Structures – Which of the following is considered as an example of a composite data type…
Data Structures
  • Easy
  • MCQ
  • 1min

Which of the following is considered as an example of a composite data type?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Merge Sort Calls – You are given an array A of N elements…
Algorithm Implementation Sort
  • Medium
  • Code
  • 30mins

You are given an array A of N elements. You want to sort it in non-decreasing order using merge-sort algorithm. It involves using a recursive function mergeSort(A,l,r):

  1. If the segment [l,r) is already sorted in non-decreasing order return.
  2. Let mid = (l+r)/2.
  3. Call mergeSort(A, l, mid)
  4. Call mergeSort(A, mid, r)
  5. Merge segments [l, mid) and [mid, r), making the segment [l, r) sorted in non-descending order.

The initial call made is mergeSort(A,0,N). Find the number of times mergeSort function is called to sort the given array in non-decreasing order.

Algorithms – Consider an unbalanced tree (not necessarily a Binary Tree) of n nodes…
Algorithms
  • Hard
  • MCQ
  • 1min

Consider an unbalanced tree (not necessarily a Binary Tree) of n nodes. You have to update weight of the n1th edge to n2 and print the maximum edge weight on the path from node n1 to node n2.

To achieve the above, you create a tree using an adjacency matrix representation of the tree (tree[][]).

Assume that you have found the sub-tree size, depth and the parent of each node using an appropriate graph algorithm and you could successfully decompose the tree into disjoint chains. What should be your next step towards achieving the above task?


Algorithms – A graph containing ‘a’ vertices and ‘b’ edges is run using a Breadth First Search algorithm…
Algorithms
  • Medium
  • MCQ
  • 1min

A graph containing ‘a’ vertices and ‘b’ edges is run using a Breadth First Search algorithm. Select the appropriate expression that represents the running time.


Algorithms – You are using the algorithm given below to create a simple implementation of a Huffman tree…
Algorithms
  • Easy
  • MCQ
  • 1min

You are using the algorithm given below to create a simple implementation of a Huffman tree.

loop a = EXTRACTMIN(N);
if N = ∅ then return a endif;
ν = EXTRACTMIN(N);
create node κ with children a and b
and weight w(k) = w(a) + w(b);
add k to N

Analyze the algorithm and predict the worst case running time complexity for the same.


DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Templates in C++ – The C++ program given below contains declarations of two function templates…
C++ Templates
  • Hard
  • MCQ
  • 1min

The C++ program given below contains declarations of two function templates. Including which of these function templates will make the program ill-formed?

T1
T2
void m( int p ) {
f(0, p);
}

Friend function in C++ – You have to implement the concept of Friend function in C++…
C++ Friend function
  • Medium
  • Code
  • 30mins

You have to implement the concept of Friend function in C++. The final task is to create two classes Point and Distance. You have been provided with N points, each having (x,y)coordinates.

Class Point contains two integer data fields x and y denoting (x,y) coordinates of a point and a friend function MaxDistance().

Class Distance contains a function Find_Distance() which takes four integer parameters x1, x2, y1 and y2 and returns the distance between (x1,y1) and (x2,y2). Return the maximum distance between any two points from N points.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Subtask 1 : Create a class Point containing two data fields x and y , a constructor Point() and a friend function MaxDistance() .

Subtask 2 : Create a class Distance which contains a function Find_Distance() to find the distance between any two points and a friend function MaxDistance() .

Subtask 3 : Create a friend function MaxDistance() which takes a vector of Points and an object of distance to call Find_Distance() function .

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Java8 – What will happen when the code snippet given below is compiled and executed…
Java8 Java Collections
  • Medium
  • MCQ
  • 1min

What will happen when the code snippet given below is compiled and executed?

1. List list = Arrays.asList(2, 4, 6, 7, 8);
2. boolean allEven = list.stream().allMatch( i -> {
3. System.out.print(i);
4. return i%2 == 0;
5. });

 
Exception Handling in Java – You have to implement the concept of Exception Handling in Java…
Application Coding Exception Handling Integer wrapper class Unchecked Exception
  • Easy
  • Code
  • 30mins

You have to implement the concept of Exception Handling in Java. The final task is to return either the sum or difference of two numbers or the exception caught.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Sub task 1: If n is a factor of x, display the sum of x and n. Otherwise, display the difference between x and n.

Sub task 2: Catch Arithmetic Exception if occurred and display the exception caught.

Sub task 3: Catch Number Format Exception if occurred and display the exception caught.

Sub task 4: Catch any other Exception occurred and display the exception caught.

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
JavaScript – Id’s have to be extracted from strings of format…
Javascript
  • Hard
  • MCQ
  • 1min

Id’s have to be extracted from strings of format ‘[id] <email>’.

In order to perform the above operations optimally, which of the below three regular expression would you use?

  1. /.*\[+(.*)+\].*/
  2. /\[([^\]]+)\].*/
  3. /\[([^\]]+)\]/

JSON in JavaScript – You have to implement the concept of JSON in JavaScript…
Implementation JSON JavaScript
  • Medium
  • Code
  • 30mins

You have to implement the concept of JSON in JavaScript. You are given an array of objects WordGame of length N. Each array object contains two data fields Tile and Score denoting an alphabet and score of that alphabet respectively. The final task is to return the maximum possible score a player can achieve by adding score of K number of tiles.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Subtask 1 : Parse the JSON object from the given string format and store into Array Scrabble.

Subtask 2 : Maximum possible score a player can achieve by adding K number of Tiles Array Scrabble.

 

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Sets in Python 3 – The Python 3 set definition given alongside throws an error…
Python 3 Sets
  • Medium
  • MCQ
  • 1min

The Python 3 set definition given alongside throws an error. Which of the following is the reason for the error?

s = {1, ‘a’, [3, ‘d’], (4, ‘c’)}.

 
Tuple – You have to implement the concept of Tuple in Python3…
Application Coding Conversion Tuple Tuple Operations
  • Medium
  • Code
  • 30mins

You have to implement the concept of Tuple in Python3. The final task is to display the result of the tuple operations.

You’ve been provided with a starter code which contains sub-tasks as defined below:

Sub task 1: Convert the list list1 and list2 into tuples tup and tup1, respectively.

Sub task 2: Display the tuple generated after multiplying the adjacent elements of the tuple tup.

Sub task 3: Create a tuple res storing the element-wise AND of tup and tup1.

Sub task 4: Display the list generated after chunking tuple res into z size.

 

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
ASCII String – There exists a function “X” such that it accepts two input parameters A & B and whose output depends on…
Polymorphism
  • Medium
  • Code
  • 30mins

Problem Statement

There exists a function “X” such that it accepts two input parameters A & B and whose output depends on the operation you decide to perform on A & B.

  • Operation 1: It accepts two integer parameters (A & B) and prints the sum of the two integers.
  • Operation 2: It accepts two string parameters and concatenates the two strings (A & B) and displays the result.
  • Operation 3: It accepts two parameters one of type entier and the autre is of type string and prints the sum of ascii characters of the string to the integer and displays the integer result.

Write a program to display the operation of X using the two string inputs provided by the user.

OOPs Concepts – Consider the given code snippet where two classes “D1” and “D2” are derived from a common class “Base”…
OOPs Concepts Inheritance
  • Medium
  • MCQ
  • 1min

Consider the given code snippet where two classes “D1” and “D2” are derived from a common class “Base.”

class Base{
}
class D1 extends Base{
}
class D2 extends Base{
}

Which of these options representing the association that is achieved through this design is true?

OOPs Concepts – Suppose you have two classes “B” and “C” which inherits the class “A” using public derivation…
OOPs Concepts Inheritance
  • Hard
  • MCQ
  • 1min

Suppose you have two classes “B” and “C” which inherits the class “A” using public derivation. Now, you have created a class “D” by inheriting both “B” and “C”. When you tried to access the methods of class “A” using object of “D”, you found an ambiguity problem.

Which of the following will help you solve this problem?

OOPs Concepts – Which of the following would you find hard to achieve using Object Oriented Programming…
OOPs Concepts OOPs features
  • Easy
  • MCQ
  • 1min

Which of the following would you find hard to achieve using Object Oriented Programming?

1. Source code reusability

2. Source code maintainability

3. Developing transparent control flow

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Encryption System in C# – You are tasked to design an encryption system which accepts 2 parameters below…
Application Code Implementation OOPs Typecasting
  • Easy
  • Code
  • 30mins

You are tasked to design an encryption system which accepts 2 parameters below:

  • A string which contains the message to be encrypted.
  • A locale parameter (integer) which specifies the encryption method to be used.

The values for the locale parameter are as follows:

  • Integer 0 is used to denote locale Asia.
  • Integer 1 is used to denote locale United states.
  • Integer 2 is used to denote locale Dubai.

The encryption techniques followed by each locale is described below:

  • All messages sent via Asia will be sent by encrypting all characters by a caesar shift of 2 i.e. ABC will be encrypted as DEF.
  • All messages sent via United States are represented in a dot separated ASCII format i.e ABC will encrypted as 65.66.67
  • All messages sent via Dubai encryption reverse the string and send it i.e. ABC will be sent as CBA.

You are given N messages that need to be encrypted with respect to their locale parameter.

C# – Analyze the C# code snippet given below and select the most appropriate choice…
C# Collections
  • Hard
  • MCQ
  • 1min

Analyze the C# code snippet given below and select the most appropriate choice.
using System;
using System.Collections.Generic;
public class Example
{
public static void Main()
{
IDictionary<string, string> openWith =
new Dictionary<string, string>();
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
openWith.Add("txt", "notepad.exe");
Console.WriteLine("\nKey Added");
}
}

C# – You want to build a collection class for a collection that does not meet the…
C# Interfaces Collections
  • Easy
  • MCQ
  • 1min

You want to build a collection class for a collection that does not meet the IList and IDictionary interface requirements.

Which of these can be used to derive the new collection in the given scenario?

 
C# – A SortedDictionary…
C# Collections
  • Medium
  • MCQ
  • 1min

A SortedDictionary<TKey,TValue>.ValueCollection. Enumerator in a generic collection produces the following exception.

InvalidOperationException.

Which of the following can be considered as valid reasons for the same?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Maximum Correlation for each column – In this problem,you are given a sample of 3 years medical data. It is divided into Cancer, Stroke and Cardio vascular as columns and index respectively.
Data Science
  • Medium
  • Code
  • 30mins

Problem Statement

In this problem,you are given a sample of 3 years medical data. It is divided into Cancer, Stroke and Cardio vascular as columns and index respectively. In order to get an insight into this data, you need to find a correlation of each column against other columns in this dataset.

Your final answer would be to find out the maximum correlation of each column against other columns.

Data Science – Which of the following cross-validation techniques would you use in a Binary Classification problem when…
Python Binary Classification
  • Hard
  • MCQ
  • 1min

Which of the following cross-validation techniques would you use in a Binary Classification problem when the target variable is unbalanced?

 

Data Science – Predict the correct value of x in the code snippet given below…
Python
  • Medium
  • MCQ
  • 1min

Predict the correct value of x in the code snippet given below.

try:
x = 11 + 21
except:
x = 23 + 32
else:
x += 1
finally:
print(x)
Data Science – Which of the following functions you can use to create a Moving Average table calculation while…
Tableau Functions
  • Easy
  • MCQ
  • 1min

Which of the following functions you can use to create a Moving Average table calculation while working with Tableau?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Machine Learning – Consider a supervised training of a machine learning model where 80% of the training samples are of…
Machine Learning Supervised learning
  • Hard
  • MCQ
  • 1min

Consider a supervised training of a machine learning model where 80% of the training samples are of class C1 and the remaining are of class C2. The training accuracy of this classifier is computed as the ratio of “number of correct prediction” to “total number of predictions made”.

In which of these circumstances could the accuracy of the model be trusted the most?

Machine Learning – A dog trainer wants to use reinforcement learning to teach new tricks to a dog at her home…
Machine Learning Reinforcement Learning
  • Medium
  • MCQ
  • 1min

A dog trainer wants to use reinforcement learning to teach new tricks to a dog at her home. She emulates a situation, and the dog tries to respond in many different ways. If the dog’s response is in the desired way, a treat is given.

Whenever the dog is exposed to the same situation, the dog executes a similar action with even more enthusiasm in expectation of getting more treats. The dog also learns what not do when faced with negative experiences.

In the given scenario, who could be the agent?

Logistic Regression – You are given a dataset from a Tic-Tac-Toe game…
Coding Logistic Regression
  • Easy
  • Code
  • 30mins

Problem Statement

You are given a dataset from a Tic-Tac-Toe game.The moves on the boards are given as left,right and middle respectively and the result of the game is given as Target_data.

Based on the given information,Predict the target_data based on all the moves using Logistic regression.

Machine Learning – Which of the following would help increase the performance of a Machine learning model…
Machine Learning models Performance
  • Easy
  • MCQ
  • 1min

Which of the following would help increase the performance of a Machine learning model?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Deep Learning – Which of the following is NOT a gating mechanism used in LSTMs…
Recurrent Neural Networks LSTM
  • Easy
  • MCQ
  • 1min

Which of the following is NOT a gating mechanism used in LSTMs?

1. the forget gate

2. the update gate

3. the input gate

Deep Learning – The network given below takes state as an input and produces the probability distribution of actions…
Deep Reinforcement Learning Policy gradient
  • Hard
  • MCQ
  • 1min

The network given below takes state as an input and produces the probability distribution of actions.

What is the relation between the statement given below in this context?

Statement1: The given network is not entirely similar to a Deep Q Network

Statement2: The given network is a classification problem

Deep Learning – You are using the max pooling technique to perform pooling on the convolved feature given below…
Convolutional Neural Network Pooling
  • Medium
  • MCQ
  • 1min

You are using the max pooling technique to perform pooling on the convolved feature given below.

What will the convolved feature contain after max pooling it?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Plot the Medal Tally – You are working as a data analyst for the sports column of a leading News Paper Firm…
Data Visualization Plots
  • Easy
  • Code
  • 30mins

Problem Statement

You are working as a data analyst for the sports column of a leading News Paper Firm. As the 2016 Olympics has recently concluded, you need to publish the medal tally for each country as a bar graph for tomorrow’s sports column.

In this problem, you are given a data set containing medal tally of 21 countries. You need to analyze the data and plot a bar graph of the medals tally under each country.

Data Visualization – You have published a data source to the web when using Tableau on the Web…
Data Visualization Tableau
  • Easy
  • MCQ
  • 1min

You have published a data source to the web when using Tableau on the Web. Which of following actions will you not be able to perform in the given scenario?

1. Editing the data model.

2. Viewing the data model.

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
SQL Query 2 – Read the below tables of a database and write a SQL query to display the…
Follows sequence of order while writing a SQL query SQL Writing Subquery
  • Easy
  • Code
  • 30mins

Read the above tables of a database and write a SQL query to display the PRODUCT_ID,PRODUCT_NAME,ORDER_QUANTITY and list which of the other products were bought apart from ‘P01’ given their total ORDER_QUANTITY bought is greater than 75.

SQL – Consider the tables advisors and students given below…
SQL Joins
  • Hard
  • MCQ
  • 1min

Consider the tables advisors and students given below.

CREATE TABLE `advisors` (
  `advisor_id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  PRIMARY KEY (`advisor_id`)
)

CREATE TABLE `students` (
  `student_id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `advisor_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`student_id`),
  KEY `advisor_id` (`advisor_id`),
  CONSTRAINT `students_ibfk_1` FOREIGN KEY (`advisor_id`) REFERENCES `advisors` (`advisor_id`)
);

Which of the following query can you use to get the information on students and their advisors, excluding students who are not assigned to an advisor?

SQL – You have created an Employee table as follows…
SQL Alter table
  • Medium
  • MCQ
  • 1min

You have created an Employee table as follows.

CREATE TABLE Employees (
   ID int NOT NULL,
   LastName varchar(255) NOT NULL,
   FirstName varchar(255),
   Age int,
   TerminationDate DATE,
   HireDate DATE,
   Primary Key(ID)
 );

In the given context, which of these is a correct way to define a constraint that says that the TerminationDate must be after the HireDate?

SQL – What is the range of the values that will be retrieved by the BETWEEN operator in the following snippet…
SQL Between Operator
  • Easy
  • MCQ
  • 1min

What is the range of the values that will be retrieved by the BETWEEN operator in the following snippet?

WHERE column_name BETWEEN 50 AND 100

 

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
MySQL – You are asked to create a data managing system for a package delivery firm in MySQL…
MySQL
  • Easy
  • Code
  • 30mins

You are asked to create a data managing system for a package delivery firm in MySQL. It is given that the firm manages salesmen who deliver packages to destination listed by the customer for a particular delivery. You have created the following tables in order to do so.

CREATE TABLE Salesman (
  salesman_id INT NOT NULL,
  name VARCHAR(255) NOT NULL,
  city VARCHAR(255),
  comission DOUBLE(255, 2),
  PRIMARY KEY (salesman_id)
);

CREATE TABLE Customer (
 customer_id INT NOT NULL,
 cust_name VARCHAR(255) NOT NULL,
 city VARCHAR(255),
 grade INT,
 salesman_id INT,
 PRIMARY KEY (customer_id),
 FOREIGN KEY (salesman_id) REFERENCES Salesman(salesman_id)
);

CREATE TABLE Orders (
  ord_no INT NOT NULL,
  purch_amt DOUBLE(255, 2) NOT NULL,
  ord_date DATE,
  customer_id INT,
  PRIMARY KEY (ord_no),
  FOREIGN KEY (customer_id) REFERENCES Customer(customer_id)
  FOREIGN KEY (sales_id) REFERENCES Salesman(salesman_id)
);

Orders

Customer

Salesman

Create a package as follows

1.Write a function that returns the level of the customer based on the grade(G) as follows:

Level is Silver if 50 <= G <= 150

Level is Gold if 151 <= G <= 300

Level is Diamond if 301 <= G <= 500

2.Write individual stored procedures to do the following

a. List out all the names of all customers with salesman_id equal to 5001, in alphabetical order.

b. Display the details of orders on 5th October 2012.

c. Increase the commission of a salesman by 0.2% if he/she works for a customer in a different city than the one he resides in.

3.Write a function with parameter argument given as sales_id and find the net purchase for the customer whose sales_id is equal to the parameter that is passed to the function.

Perform the above given tasks in your system and upload a doc file containing the solutions for the respective tasks.

MySQL – Which of the following is the correct syntax to remove…
MySQL
  • Easy
  • MCQ
  • 1min

Which of the following is the correct syntax to remove all the permissions for an account in MySQL?

MySQL – The execution of the query given below is similar to which of these queries with respect to…
MySQL
  • Hard
  • MCQ
  • 1min

The execution of the query given below is similar to which of these queries with respect to merging of the derived table “derivedtable”?

SELECT * 
FROM (SELECT * FROM table) 
AS derivedtable;

MySQL – Which of these statements is true with respect to the null rejections that occur…
MySQL
  • Medium
  • MCQ
  • 1min

Which of these statements is true with respect to the null rejections that occur in the below given query?

SELECT * FROM Table1 LEFT JOIN Table2 ON Table2.A=Table1.A
LEFT JOIN Table3 ON Table3.B=Table1.B
WHERE Table3.C > 0

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Linux Scripting – Write a bash script to record the values on built in variables…
Linux Scripting
  • Medium
  • Code
  • 30mins

Write a bash script to record the values on built in variables. Write the script in a doc file and upload the same.

Linux Scripting – You have a text file called demo containing the following lines…
Linux Scripting
  • Hard
  • MCQ
  • 1min

You have a text file called demo containing the following lines of text in a Linux system.

1. This is the first line of an experiment.

2. It is a text with experiment.

3. Lots of errors are present.

4. So much errors, all these errors are making me sick.

5. This is a line not containing any errors.

6. This is the last line of my experiment.

Now, you are asked to find all the lines containing the search pattern ‘experiment’ and print the lines matching the pattern in the shell. Which of these shell commands can you use for doing so?

Linux Scripting – Which of the following bash script would check if a file is readable and…
Linux Scripting
  • Medium
  • MCQ
  • 1min

Which of the following bash script would check if a file is readable and has size greater than zero?

Linux Scripting – Which of the following commands allows the user to search for…
Linux Scripting Grep
  • Easy
  • MCQ
  • 1min

Which of the following commands allows the user to search for all four character words in A.txt?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Clean Coding – Consider the given code snippet…
Clean Coding Design smells C++
  • Hard
  • MCQ
  • 1min

Consider the given code snippet.

class Product {
    private:
    string type;

    Product(string type) {
        this->type = type;
    }

    int getBasePrice() {
        switch (this->type) {
            case food:
                return 10;
            case drinks:
                return 7;
            case books:
                return 3;
            default:
                return 0;
        }
    }

    int getTaxPercent() {
        switch (this->type) {
            case food:
            case drinks:
                return 24;
            case books:
                return 8;
            default:
                return 0;
        }
    }

    string getProductCategory() {
        switch (this->type) {
            case food:
            case drinks:
                return 'Food and Beverages';
            case books:
                return 'Education';
            default:
                return '-';
        }
    }
}

You notice that when introducing a new product type in the code, you’ll have to make changes in three different methods of the class. Which of these design smells does the given snippet have?

Clean Coding – Analyze the code given below and determine the type of abstraction design smell present in the code snippet…
Clean Coding Design Smell C++
  • Medium
  • MCQ
  • 1min

Analyze the code given below and determine the type of abstraction design smell present in the code snippet.

class Throwable
{
  //Prints the stack trace as a string to the standard output
  //write regex for processing stack trace
  public:
  void printStackTrace();
  //other methods are avoided
}

Clean Coding – Which of these functions in the given code snippet depicts a lazy code smell…
Clean Coding Code smells C++
  • Easy
  • MCQ
  • 1min

Which of these functions in the given code snippet depicts a lazy code smell?

#include <iostream>

using namespace std;
int remainder(int a, int b) //Fun1
{
  return(a % b);
}
  
int add(int a, int b) //Fun2
{
    return (a + b);
}

int multiply(int a, int b) //Fun3
{
  return (a * b);
}

int main() 
{

  int sum;
    sum = add(100, 78);
    cout << "100 + 78 = " << sum << endl;
    mul = multiply(10, 78);
    cout << "10 * 78 = " << mul << endl;
    return 0;
}

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

 What should be used at Blank5 to quit the whole browser session?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank4 to replace the value of the header row with an empty string?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank3 to get all the Columns of table with tag ‘td’?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank2 to Get all the Rows of table with tag ‘tr’?

Selenium – You are using the code shown below to handle Dynamic WebTables with Selenium in C#…
Selenium
  • Medium
  • Code
  • 30mins

You are using the code shown below to handle Dynamic WebTables with Selenium in C#. However, parts of the code are incomplete. Identify and complete the code snippets that are missing and complete the code.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Collections.Generic;
namespace SeleniumTest
{
 class Program
 {
 static void Main(string[] args)
 {
 IWebDriver driver = new FirefoxDriver();
 driver.Manage().Window.Maximize();

driver.Navigate().GoToUrl("https://website-link");
 driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(30));
 
 var elemTable = Blank 1 
List<IWebElement> lstTrElem = new List<IWebElement>(Blank 2);
 
String strRowData = "";
 
 foreach (var elemTr in lstTrElem)
 {
 List<IWebElement> lstTdElem = new List<IWebElement>(Blank 3);
 if (lstTdElem.Count > 0)
 {
 foreach (var elemTd in lstTdElem)
 {
                strRowData = strRowData + elemTd.Text + “\t\t";
 }
 }
 else
 {
 Console.WriteLine("This is Header Row");
 Console.WriteLine(Blank4(" ", "\t\t"));
 }
 Console.WriteLine(strRowData);
 strRowData = String.Empty;
 }
 Console.WriteLine("");
 Blank 5
 }
 }
}

What should be used at Blank1 to create the object of the first table using the xpath “//div[@id=’mw-content-text’]//table[1]” to locate the table?

Selenium – You are using theAjaxElementLocatorFactory class in an implementation of a PageFactory pattern when…
Selenium Page Factory
  • Hard
  • MCQ
  • 1min

You are using theAjaxElementLocatorFactory class in an implementation of a PageFactory pattern when you encounter the following exception.
NoSuchElementException
Which of these can be considered as valid reasons behind the same?

  1. An invalid memory address reference was made during the call to the element.
  2. Element cannot be found in the specified interval

Selenium – You want to be able to lookup parent element from child elements when working with selenium…
Selenium Handling Ajax Components
  • Medium
  • MCQ
  • 1min

You want to be able to lookup parent element from child elements when working with selenium. Which of the following can be used to locate the web elements in the given scenario?

1. XPath

2. CSS selector

Selenium – Which of these cannot be used to move between windows in selenium using the switch to command…
Selenium Handling Multiple Windows
  • Easy
  • MCQ
  • 1min

Which of these cannot be used to move between windows in selenium using the switch to command?

DESCRIPTION
  • DIFFICULTY
  • TYPE
  • EXPECTED TIME
Salesforce CRM – When working with the Kanban view in lightning experience, you observe a yellow triangle on…
Salesforce
  • Hard
  • MCQ
  • 1min

When working with the Kanban view in lightning experience, you observe a yellow triangle on an opportunity card. Which of these alerts does the card represent in the given context?

  1. Overdue tasks
  2. No open activities
  3. No activity for 30 days

Salesforce CRM – How can you keep your system performance optimal when creating sales paths in…
Salesforce Lightning experience basics
  • Medium
  • MCQ
  • 1min

How can you keep your system performance optimal when creating sales paths in salesforce lightning experience?

Salesforce CRM – Which of the following are valid fields of a standard and custom objects when…
Salesforce Data modelling
  • Easy
  • MCQ
  • 1min

Which of the following are valid fields of a standard and custom objects when performing data modelling in salesforce classic?

  1. Identity
  2. Name
  3. System
  4. Custom

Trusted by

Think Developer Skills. Think WeCP.

Evaluate over 2000+ technical skills using hands-on assessments faster, effortlessly, and accurately.
Close Bitnami banner
Bitnami