 PB Recruitment Test Solutions

There were atleast a total of 200 people who showed up for the test and a lot of them did really great. Here is the Solution to all the 3 tests hope you guys found it cool and interesting.

PB Recruitment Test 1

General Reasoning :

1)Given that A > B > C and A60 = Bt = C120. If logA, logB and logC are in Arithmetic Progression, then what is the value of ‘t’?

Choices

• 40

• 60

• 120

1. The sequence 1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17,…. has one odd number followed by the next two even numbers, then the next three odd numbers followed by the next four even numbers and so on. What is the 2003rd term of the sequence?

Choices

• 3953

• 3940

• 3950

1. Ten books are arranged in a row on a bookshelf. A student has to select three out of these ten books in such a way that no two books selected by him must have been lying adjacently. In how many ways can he make the selection?

Choices

• 64

• 72

• None of the above

1. x and y are real numbers such that 2log(x – 2y) = log x + log y. What is the value of x/y ?

Choices

• 1

• Either (a) or (b)

• None of these

1. In how many ways can 1000 be written as a sum of ‘n’ consecutive natural numbers, where ‘n’ is greater than 1?

Choices

• 0

• 1

• 2

Devops :

1. Which of the following is not a pure containerization service.

Choices

• cri-o

• lxc

• ansible

1. Which of the following is false about functions of load balancers?

Choices

• Distributes client requests or network load efficiently across multiple servers

• Ensures high availability and reliability by sending requests only to servers that are online

• Provides the flexibility to add or subtract servers as demand dictates

• None of these (Correct answer)

1. What are the following is false about containerization?

Choices

• Containerization is a type of virtualization strategy

• Docker provides a container virtualization platform that serves as a good alternative to hypervisor-based arrangements

• If one container fails, others sharing the OS kernel are affected, due to the user kernel isolation between them. (Correct answer)

• None of these

Backend :

1. What is the main usage of Node.js terminal (REPL)?

Choices

• To specify the preview of the Node.js application.

• For testing Node.js/JavaScript expressions. (Correct answer)

• For executing browser’s JavaScript expressions.

• None of the above.

1. Choose the correct option with reference to REST API.

Choices

• There is no default media type for both requests and responses.

• The default media type for requests and responses is application/json. (Correct answer)

• The default media type for requests is application/json while there is no default media type for responses.

• The default media type for responses is application/json while there is no default media type for requests.

Frontend :

1. In HTML elements, CSS can be added in different

Choices

• 2 ways

• 4 ways

• 5 way

1. What is used to create a space around a element content, inside of any defined border

Choices

• Margin

• Border

• gap

1. Which object is the top of the hierarchy

Choices

• Document Object

• Virtual Object

• Form Object

DBMS/Networking/Cybersecurity :

1. Code Injection attacks can be handled by

Choices

• Server side rendering

• Client side rendering

• Encrypted communication channel

1. Which statement is true regarding half duplex?

Choices

• Only works in a point-to-point configuration

• Allows for transmitting and receiving but not a the same time (Correct answer)

• Allow for transmitting and receiving of data simultaneously

• Doubles the bandwidth

1. Which of the following is generally used for performing tasks like creating the structure of the relations, deleting relation?

Choices

• DML(Data Manipulation Language)

• Query

• Relational Schema

• DDL(Data Definition Language) (Correct answer)

1. SELECT emp_name FROM department WHERE dept_name LIKE ’ _____ Computer Science’;

In the above-given Query, which of the following can be placed in the Query’s blank portion to select the “dept_name” that also contains Computer Science as its ending string?

Choices

• &

• _

• \$

1. The data type commonly used in TinyML or Edge AIIoT systems?

Choices

• Float16

• Int16

• Float8

1. Which kind of hardware development platform is the Raspberry Pi?

Choices

• Soc

• IoT controller

1. Which of the following statements are true for von Neumann architecture?

Choices

• separate bus between the program memory and data memory

• external bus for program memory and data memory

• external bus for data memory only

• shared bus between the program memory and data memory (Correct answer)

1. What is approximate data access time of SRAM?

Choices

• 2ns

• 10ns

• 60ns

1. What is the difference between different linux distributions (distros)?

Choices

• They are all separate operating systems.

• They all use the same kernel while the software on top of the kernel may be different. (Correct answer)

• They all use different types of kernel.

• A Linux distribution is not an operating system.

1. Linux is …

Choices

• a UNIX system.

• a UNIX like system. (Correct answer)

• a UNIX descendent system.

• a UNIX system predecessor.

25)Which option best describes the following sequence of commands executed on the terminal?

\$ mkdir demo && cd demo

\$ vim test.c

\$ gcc test.c

\$ ./a.out

Choices

• Mark a directory called demo → Control directory into demo → write input in test.c → compile program → execute it.
• Make a directory called demo → Control directory into demo → Create test.c with vim → execute program → compile it.
• Create a directory called demo → Change directory into demo → Create test.c with vim → execute program → compile it.
• Create a directory called demo → Change directory into demo → Create test.c with vim → compile program → execute it. (Correct answer)
1. What does the following command in Linux do?

\$ sed ‘s/always/never/g’

Choices

• Print the word ‘never’ after ‘always’.

• Replaces the first occurrence of the word ‘always’ with ‘never’.

• Replace all the occurrences of the word ‘always’ with ‘never’. (Correct answer)

• Print the word ‘always’ after ‘never’.

1. You are predicting whether an email is spam or not. Based on the features, you obtained an estimated probability to be 0.75. What’s the meaning of this estimated probability? The threshold to differ the classes is 0.5.

Choices

• The email is not spam

• The email is spam (Correct answer)

• Cant Determine

• Both (A) and (B)

1. A linear regression model assumes “a linear relationship between the input variables and the single output variable.” What’s the meaning of this assumption?

Choices

• Output variable = sum of the input variables

• Input variables can be calculated from a linear combination of the output variables

• The output variable can be calculated from a linear combination of the input variables (Correct answer)

• The output variable can’t be calculated from a linear combination of the input variables

1. What does a neuron compute?

Choices

• A neuron computes an activation function followed by a linear function (z = Wx + b)

• A neuron computes a linear function (z = Wx + b) followed by an activation function (Correct answer)

• A neuron computes a function g that scales the input x linearly (Wx + b)

• A neuron computes the mean of all features before applying the output to an activation function

1. Which parameter determines the size of the improvement step to take on each iteration of Gradient Descent?

Choices

• epoch

• batch size

• regularization parameter

Programing Problems Sum Modulo

Solution :

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
int n,m;
cin>>n>>m;
int a[n],s=0;
for(auto &i:a)
{
cin>>i;
s+=(i);
}
cout<<s%m<<'\n';
}
return 0;
}

Cheems

Solution :

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
string a;
cin>>a;
int f=0;
for(char c:a)
{
if(c=='m')f=1;
}
if(f)
cout<<"Cheems\n";
else
cout<<"somrry\n";
return 0;
}

Monotonic

Solution :

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
int n;
cin>>n;
int a[n];
for(auto &i:a)
{
cin>>i;
}
sort(a,a+n);
for(int x:a)
cout<<x<<" ";
}
return 0;
}

Ashutosh and Sequence

Solution :

#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int n;
cin>>n;
cout<<__builtin_popcountll(n)<<'\n';
return 0;
}

Single

Solution :

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int x=0,n;
cin>>n;
for(int i=0;i<2*n+1;i++)
{
int y;
cin>>y;
x^=y;
}
cout<<x;
return 0;
}

Modulo Inverse

Solution :

#include<bits/stdc++.h>

using namespace std;

#define int long long

int p(int a,int b,int m)
{
int res=1;
while(b)
{
if(b&1)
res=((a%m)*(res%m))%m;
a=((a%m)*(a%m))%m;
b>>=1;
}
return res%m;
}

signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int n,m;
cin>>n>>m;
cout<<p(n,m-2,m);
return 0;
}

Redboi plays Game

Solution :

#include<bits/stdc++.h>

using namespace std;

int knapSack(int W, int wt[], int val[], int n)
{
int i, w;
vector<vector<int>> K(n + 1, vector<int>(W + 1));

// Build table K[][] in bottom up manner
for(i = 0; i <= n; i++)
{
for(w = 0; w <= W; w++)
{
if (i == 0 || w == 0)
K[i][w] = 0;
else if (wt[i - 1] <= w)
K[i][w] = max(val[i - 1] +
K[i - 1][w - wt[i - 1]],
K[i - 1][w]);
else
K[i][w] = K[i - 1][w];
}
}
return K[n][W];
}

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int X,n;
cin>>X>>n;
int a[n],b[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
cout<<knapSack(X,a,b,n);
return 0;
}

Point Blank Recruitment test 2
General Reasoning :

1)Given that A > B > C and A60 = Bt = C120. If logA, logB and logC are in Arithmetic Progression, then what is the value of ‘t’?

Choices

• 40

• 60

• 120

1. The sequence 1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17,…. has one odd number followed by the next two even numbers, then the next three odd numbers followed by the next four even numbers and so on. What is the 2003rd term of the sequence?

Choices

• 3953

• 3940

• 3950

1. Ten books are arranged in a row on a bookshelf. A student has to select three out of these ten books in such a way that no two books selected by him must have been lying adjacently. In how many ways can he make the selection?

Choices

• 64

• 72

• None of the above

1. x and y are real numbers such that 2log(x – 2y) = log x + log y. What is the value of x/y ?

Choices

• 1

• Either (a) or (b)

• None of these

1. In how many ways can 1000 be written as a sum of ‘n’ consecutive natural numbers, where ‘n’ is greater than 1?

Choices

• 0

• 1

• 2

Devops :

1. Which of the following is not a pure containerization service.

Choices

• cri-o

• lxc

• ansible

1. Which of the following is false about functions of load balancers?

Choices

• Distributes client requests or network load efficiently across multiple servers

• Ensures high availability and reliability by sending requests only to servers that are online

• Provides the flexibility to add or subtract servers as demand dictates

• None of these (Correct answer)

1. What are the following is false about containerization?

Choices

• Containerization is a type of virtualization strategy

• Docker provides a container virtualization platform that serves as a good alternative to hypervisor-based arrangements

• If one container fails, others sharing the OS kernel are affected, due to the user kernel isolation between them. (Correct answer)

• None of these

Backend :

1. What is the main usage of Node.js terminal (REPL)?

Choices

• To specify the preview of the Node.js application.

• For testing Node.js/JavaScript expressions. (Correct answer)

• For executing browser’s JavaScript expressions.

• None of the above.

1. Choose the correct option with reference to REST API.

Choices

• There is no default media type for both requests and responses.

• The default media type for requests and responses is application/json. (Correct answer)

• The default media type for requests is application/json while there is no default media type for responses.

• The default media type for responses is application/json while there is no default media type for requests.

Frontend :

1. In HTML elements, CSS can be added in different

Choices

• 2 ways

• 4 ways

• 5 way

1. What is used to create a space around a element content, inside of any defined border

Choices

• Margin

• Border

• gap

1. Which object is the top of the hierarchy

Choices

• Document Object

• Virtual Object

• Form Object

DBMS/Networking/Cybersecurity :

1. Code Injection attacks can be handled by

Choices

• Server side rendering

• Client side rendering

• Encrypted communication channel

1. Which statement is true regarding half duplex?

Choices

• Only works in a point-to-point configuration

• Allows for transmitting and receiving but not a the same time (Correct answer)

• Allow for transmitting and receiving of data simultaneously

• Doubles the bandwidth

1. Which of the following is generally used for performing tasks like creating the structure of the relations, deleting relation?

Choices

• DML(Data Manipulation Language)

• Query

• Relational Schema

• DDL(Data Definition Language) (Correct answer)

1. SELECT emp_name FROM department WHERE dept_name LIKE ’ _____ Computer Science’;

In the above-given Query, which of the following can be placed in the Query’s blank portion to select the “dept_name” that also contains Computer Science as its ending string?

Choices

• &

• _

• \$

1. The data type commonly used in TinyML or Edge AIIoT systems?

Choices

• Float16

• Int16

• Float8

1. Which kind of hardware development platform is the Raspberry Pi?

Choices

• Soc

• IoT controller

1. Which of the following statements are true for von Neumann architecture?

Choices

• separate bus between the program memory and data memory

• external bus for program memory and data memory

• external bus for data memory only

• shared bus between the program memory and data memory (Correct answer)

1. What is approximate data access time of SRAM?

Choices

• 2ns

• 10ns

• 60ns

1. What is the difference between different linux distributions (distros)?

Choices

• They are all separate operating systems.

• They all use the same kernel while the software on top of the kernel may be different. (Correct answer)

• They all use different types of kernel.

• A Linux distribution is not an operating system.

1. Linux is …

Choices

• a UNIX system.

• a UNIX like system. (Correct answer)

• a UNIX descendent system.

• a UNIX system predecessor.

25)Which option best describes the following sequence of commands executed on the terminal?

\$ mkdir demo && cd demo

\$ vim test.c

\$ gcc test.c

\$ ./a.out

Choices

• Mark a directory called demo → Control directory into demo → write input in test.c → compile program → execute it.
• Make a directory called demo → Control directory into demo → Create test.c with vim → execute program → compile it.
• Create a directory called demo → Change directory into demo → Create test.c with vim → execute program → compile it.
• Create a directory called demo → Change directory into demo → Create test.c with vim → compile program → execute it. (Correct answer)
1. What does the following command in Linux do?

\$ sed ‘s/always/never/g’

Choices

• Print the word ‘never’ after ‘always’.

• Replaces the first occurrence of the word ‘always’ with ‘never’.

• Replace all the occurrences of the word ‘always’ with ‘never’. (Correct answer)

• Print the word ‘always’ after ‘never’.

1. You are predicting whether an email is spam or not. Based on the features, you obtained an estimated probability to be 0.75. What’s the meaning of this estimated probability? The threshold to differ the classes is 0.5.

Choices

• The email is not spam

• The email is spam (Correct answer)

• Cant Determine

• Both (A) and (B)

1. A linear regression model assumes “a linear relationship between the input variables and the single output variable.” What’s the meaning of this assumption?

Choices

• Output variable = sum of the input variables

• Input variables can be calculated from a linear combination of the output variables

• The output variable can be calculated from a linear combination of the input variables (Correct answer)

• The output variable can’t be calculated from a linear combination of the input variables

1. What does a neuron compute?

Choices

• A neuron computes an activation function followed by a linear function (z = Wx + b)

• A neuron computes a linear function (z = Wx + b) followed by an activation function (Correct answer)

• A neuron computes a function g that scales the input x linearly (Wx + b)

• A neuron computes the mean of all features before applying the output to an activation function

1. Which parameter determines the size of the improvement step to take on each iteration of Gradient Descent?

Choices

• epoch

• batch size

• regularization parameter

Programing Problems Find Duplicate

Solution :

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
int n;
cin>>n;
int a[n];
map<int,int>m;
int ans=0;
for(auto &i:a)
{
cin>>i;
m[i]++;
if(m[i]==2)
ans=i;
}
cout<<ans<<'\n';
}
return 0;
}

Find the right combination

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
unsigned long long int x,p;
cin>>x>>p;
cout<<(p-x+1);
return 0;
}

The Middle

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
int n;
cin>>n;
int a[n];
for(auto &i:a)
{
cin>>i;
}
sort(a,a+n);
cout<<a[n/2]<<'\n';
}
return 0;
}

orz tree

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int n;
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
cout<<" ";
for(int j=0;j<=i;j++)
{
cout<<"orz";
}
cout<<'\n';
}
return 0;
}

Mersenne Prime Candidate

#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int n;
cin>>n;
if(!((n)&(n+1)))
cout<<"YES\n";
else
cout<<"NO\n";
return 0;
}

Deepu op

#include<bits/stdc++.h>

using namespace std;

int maxSubArraySum(int a[], int size)
{
int max_so_far = INT_MIN, max_ending_here = 0;

for (int i = 0; i < size; i++)
{
max_ending_here = max_ending_here + a[i];
if (max_so_far < max_ending_here)
max_so_far = max_ending_here;

if (max_ending_here < 0)
max_ending_here = 0;
}
return max_so_far;
}

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
cout<<maxSubArraySum(a,n);
return 0;
}

4 String Problem

#include<bits/stdc++.h>

using namespace std;

int dp={};

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
string a,b,c,d;
cin>>a>>b>>c>>d;
int m=a.size(),n=b.size(),o=c.size(),p=d.size();
for(int i=0;i<=m;i++)
{
for(int j=0;j<=n;j++)
{
for(int k=0;k<=o;k++)
{
for(int l=0;l<=p;l++)
{
if(i==0 || j==0 || k==0 || l==0)
dp[i][j][k][l]=0;
else if(a[i-1]==b[j-1] && b[j-1]==c[k-1] && c[k-1]==d[l-1])
dp[i][j][k][l]=1+dp[i-1][j-1][k-1][l-1];
else
dp[i][j][k][l]=max({dp[i-1][j][k][l],dp[i][j-1][k][l],dp[i][j][k-1][l],dp[i][j][k][l-1]});
}
}
}
}
int ex=dp[m][n][o][p];
//cout<<ex<<'\n';
cout<<m+n+o+p-4*ex<<'\n';
return 0;
}

PB Recruitment Test 3

General Reasoning :

1)Given that A > B > C and A60 = Bt = C120. If logA, logB and logC are in Arithmetic Progression, then what is the value of ‘t’?

Choices

• 40

• 60

• 120

1. The sequence 1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17,…. has one odd number followed by the next two even numbers, then the next three odd numbers followed by the next four even numbers and so on. What is the 2003rd term of the sequence?

Choices

• 3953

• 3940

• 3950

1. Ten books are arranged in a row on a bookshelf. A student has to select three out of these ten books in such a way that no two books selected by him must have been lying adjacently. In how many ways can he make the selection?

Choices

• 64

• 72

• None of the above

1. x and y are real numbers such that 2log(x – 2y) = log x + log y. What is the value of x/y ?

Choices

• 1

• Either (a) or (b)

• None of these

1. In how many ways can 1000 be written as a sum of ‘n’ consecutive natural numbers, where ‘n’ is greater than 1?

Choices

• 0

• 1

• 2

Devops :

1. Which of the following is not a pure containerization service.

Choices

• cri-o

• lxc

• ansible

1. Which of the following is false about functions of load balancers?

Choices

• Distributes client requests or network load efficiently across multiple servers

• Ensures high availability and reliability by sending requests only to servers that are online

• Provides the flexibility to add or subtract servers as demand dictates

• None of these (Correct answer)

1. What are the following is false about containerization?

Choices

• Containerization is a type of virtualization strategy

• Docker provides a container virtualization platform that serves as a good alternative to hypervisor-based arrangements

• If one container fails, others sharing the OS kernel are affected, due to the user kernel isolation between them. (Correct answer)

• None of these

Backend :

1. What is the main usage of Node.js terminal (REPL)?

Choices

• To specify the preview of the Node.js application.

• For testing Node.js/JavaScript expressions. (Correct answer)

• For executing browser’s JavaScript expressions.

• None of the above.

1. Choose the correct option with reference to REST API.

Choices

• There is no default media type for both requests and responses.

• The default media type for requests and responses is application/json. (Correct answer)

• The default media type for requests is application/json while there is no default media type for responses.

• The default media type for responses is application/json while there is no default media type for requests.

Frontend :

1. In HTML elements, CSS can be added in different

Choices

• 2 ways

• 4 ways

• 5 way

1. What is used to create a space around a element content, inside of any defined border

Choices

• Margin

• Border

• gap

1. Which object is the top of the hierarchy

Choices

• Document Object

• Virtual Object

• Form Object

DBMS/Networking/Cybersecurity :

1. Code Injection attacks can be handled by

Choices

• Server side rendering

• Client side rendering

• Encrypted communication channel

1. Which statement is true regarding half duplex?

Choices

• Only works in a point-to-point configuration

• Allows for transmitting and receiving but not a the same time (Correct answer)

• Allow for transmitting and receiving of data simultaneously

• Doubles the bandwidth

1. Which of the following is generally used for performing tasks like creating the structure of the relations, deleting relation?

Choices

• DML(Data Manipulation Language)

• Query

• Relational Schema

• DDL(Data Definition Language) (Correct answer)

1. SELECT emp_name FROM department WHERE dept_name LIKE ’ _____ Computer Science’;

In the above-given Query, which of the following can be placed in the Query’s blank portion to select the “dept_name” that also contains Computer Science as its ending string?

Choices

• &

• _

• \$

1. The data type commonly used in TinyML or Edge AIIoT systems?

Choices

• Float16

• Int16

• Float8

1. Which kind of hardware development platform is the Raspberry Pi?

Choices

• Soc

• IoT controller

1. Which of the following statements are true for von Neumann architecture?

Choices

• separate bus between the program memory and data memory

• external bus for program memory and data memory

• external bus for data memory only

• shared bus between the program memory and data memory (Correct answer)

1. What is approximate data access time of SRAM?

Choices

• 2ns

• 10ns

• 60ns

1. What is the difference between different linux distributions (distros)?

Choices

• They are all separate operating systems.

• They all use the same kernel while the software on top of the kernel may be different. (Correct answer)

• They all use different types of kernel.

• A Linux distribution is not an operating system.

1. Linux is …

Choices

• a UNIX system.

• a UNIX like system. (Correct answer)

• a UNIX descendent system.

• a UNIX system predecessor.

25)Which option best describes the following sequence of commands executed on the terminal?

\$ mkdir demo && cd demo

\$ vim test.c

\$ gcc test.c

\$ ./a.out

Choices

• Mark a directory called demo → Control directory into demo → write input in test.c → compile program → execute it.
• Make a directory called demo → Control directory into demo → Create test.c with vim → execute program → compile it.
• Create a directory called demo → Change directory into demo → Create test.c with vim → execute program → compile it.
• Create a directory called demo → Change directory into demo → Create test.c with vim → compile program → execute it. (Correct answer)
1. What does the following command in Linux do?

\$ sed ‘s/always/never/g’

Choices

• Print the word ‘never’ after ‘always’.

• Replaces the first occurrence of the word ‘always’ with ‘never’.

• Replace all the occurrences of the word ‘always’ with ‘never’. (Correct answer)

• Print the word ‘always’ after ‘never’.

1. You are predicting whether an email is spam or not. Based on the features, you obtained an estimated probability to be 0.75. What’s the meaning of this estimated probability? The threshold to differ the classes is 0.5.

Choices

• The email is not spam

• The email is spam (Correct answer)

• Cant Determine

• Both (A) and (B)

1. A linear regression model assumes “a linear relationship between the input variables and the single output variable.” What’s the meaning of this assumption?

Choices

• Output variable = sum of the input variables

• Input variables can be calculated from a linear combination of the output variables

• The output variable can be calculated from a linear combination of the input variables (Correct answer)

• The output variable can’t be calculated from a linear combination of the input variables

1. What does a neuron compute?

Choices

• A neuron computes an activation function followed by a linear function (z = Wx + b)

• A neuron computes a linear function (z = Wx + b) followed by an activation function (Correct answer)

• A neuron computes a function g that scales the input x linearly (Wx + b)

• A neuron computes the mean of all features before applying the output to an activation function

1. Which parameter determines the size of the improvement step to take on each iteration of Gradient Descent?

Choices

• epoch

• batch size

• regularization parameter

Missing Number

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
int n;
cin>>n;
int a[n-1];
int s=0;
for(auto &i:a)
{
cin>>i;
s+=i;
}
cout<<(n*(n+1)/2)-s<<'\n';
}
return 0;
}

Check Sum

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
int n,x;
cin>>n>>x;
int a[n],s=0;
for(auto &i:a)
{
cin>>i;
s+=i;
}
if(s>x)
cout<<1;
else
cout<<0;
}
return 0;
}

Max Frequency

#include<bits/stdc++.h>

using namespace std;

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int t=1;
while(t--)
{
string a;
cin>>a;
int ans=0;
char f;
map<char,int>m;
for(char c:a)
{
ans=max(ans,++m[c]);
if(ans==m[c])f=c;
}
cout<<f<<'\n';
}
return 0;
}

Mersenne Prime Candidate

#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
int n;
cin>>n;
if(!((n)&(n+1)))
cout<<"YES\n";
else
cout<<"NO\n";
return 0;
}

Mohit and Colors

#include<bits/stdc++.h>

using namespace std;

long long minCost(long long arr[], long long n) {
priority_queue<long long,vector<long long>,greater<long long>>q;
for(int i=0;i<n;i++)
{
q.push(arr[i]);
}
long long ans=0;
while(q.size()>1)
{
long long a=q.top();
q.pop();
long long b=q.top();
q.pop();
ans+=(a+b);
q.push(a+b);
}
return ans;
}

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef OJ
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
freopen("error.txt","w",stderr);
#endif
long long n;
cin>>n;
long long a[n];
for(int i=0;i<n;i++)
cin>>a[i];
cout<<minCost(a,n);
return 0;
}