0% found this document useful (0 votes)
10 views

TEST - 2 15-11-2024 - Questions & Answers

Uploaded by

chintuelishala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

TEST - 2 15-11-2024 - Questions & Answers

Uploaded by

chintuelishala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

pyramidexam

Capgemini CMRCET Assessments


KA K Zayd Ahmed
Quiz navigation
Started on Friday, 15 November 2024, 9:19 PM
1 2 3 4 5 6 7 8 9
State Finished
Completed on Friday, 15 November 2024, 10:23 PM
10 11 12 13 14 15 16 17 18
Time taken 1 hour 4 mins
Marks 128.00/140.00 19 20 21 22 23 24 25 26 27
Grade 9.14 out of 10.00 (91.43%)
28 29 30 31 32 33 34 35 36
Question 1
Correct
Problem Statement: 37 38 39 40 41 42 43 44 45
Mark 20.00 out Problem Statement – You have write a function that accepts, a string which
of 20.00 length is “len”, the string has some “#”, in it you have to move all the hashes to 46 47 48 49 50 51 52 53
Flag the front of the string and return the whole string back and print it. char*
question moveHash(char str[],int n); example :- Sample Test Case Input:
Show one page at a time
 Edit Move#Hash#to#Front Output: ###MoveHashtoFront
question Finish review
v3 (latest) Sample TestCases:
Sample Input 1:
a#b#c
Sample Output 1:
##abc

Sample Input 2:
Move##hash##tofront
Sample Output 2:
####Movehashtofront
Sample Input 3:
###abcdef##

Sample Output 3:
#####abcdef

Constraints:
-
For example:

Test Input Result

Sample Test Case 1 a#b#c ##abc

Sample Test Case 2 Move##hash##tofront ####Movehashtofront

Sample Test Case 3 ###abcdef## #####abcdef

Answer: (penalty regime: 10, 20, ... %)

Language java

1 import java.util.*;
2
3 ▼ public class Main{
4▼ public static void main(String[] args){
5 Scanner in = new Scanner(System.in);
6 String s = in.next();
7 String res = moveHash(s);
8 System.out.println(res);
9 }
10 ▼ public static String moveHash(String s){
11 char[] arr = s.toCharArray();
12 int count = 0;
13 StringBuilder sb = new StringBuilder();
14
15 ▼ for (char c: arr){
16 if (c=='#')
17 count++;
18 }
19 while (count-- > 0)
20 sb.append('#');
21
22 for (char c: arr)
23 if (c != '#')
24 sb.append(c);
25
26 return sb.toString();
27 }
28 }

Test Input

 Sample Test Case 1 a#b#c

 Sample Test Case 2 Move##hash##tofront

 Sample Test Case 3 ###abcdef##

 Hidden Test Case 1 #q#r#s#t#u#

 Hidden Test Case 2 k#l#m#n#

 Hidden Test Case 3 l#m#n#o#p#q#r#s#t#u#v#w#x

 Hidden Test Case 4 #v#w#x#y#z

 Hidden Test Case 5 ##bad#

 Hidden Test Case 6 k#l#m#n#

 Hidden Test Case 7 h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#

 Hidden Test Case 8 s#t

 Hidden Test Case 9 j#k#l#m#n

 Hidden Test Case 10 #c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#

 Hidden Test Case 11 #r#s#t#u#

 Hidden Test Case 12 #x#y#z

 Hidden Test Case 13 #l#m#n#o#p#q#r#s#t#u#v

 Hidden Test Case 14 #g#h#i#j#k#l#m#n#o#p#q#r#s#t#u

Passed all tests! 

Correct
Marks for this submission: 20.00/20.00.

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not


21:19:17 complete

2 15/11/24, Prechecked: import java.util.*; Precheck


21:23:45 public class Main{ public static results
void main(String[] args){ Scanner
in = new Scanner(System.in);
String s = in.next(); String res =
moveHash(s);
System.out.println(res); } public
static String moveHash(String s){
char[] arr = s.toCharArray(); int
count = 0 StringBuilder sb = new
StringBuilder(); for (char c: arr){ if
(c=='#') count++; } while (count--)
sb.append('#'); for (char c: arr) if
(c != '#') sb.append(c); return
sb.toCharArray(); } }

3 15/11/24, Prechecked: import java.util.*; Precheck


21:23:54 public class Main{ public static results
void main(String[] args){ Scanner
in = new Scanner(System.in);
String s = in.next(); String res =
moveHash(s);
System.out.println(res); } public
static String moveHash(String s){
char[] arr = s.toCharArray(); int
count = 0; StringBuilder sb = new
StringBuilder(); for (char c: arr){ if
(c=='#') count++; } while (count--)
sb.append('#'); for (char c: arr) if
(c != '#') sb.append(c); return
sb.toCharArray(); } }

4 15/11/24, Prechecked: import java.util.*; Precheck


21:24:08 public class Main{ public static results
void main(String[] args){ Scanner
in = new Scanner(System.in);
String s = in.next(); String res =
moveHash(s);
System.out.println(res); } public
static String moveHash(String s){
char[] arr = s.toCharArray(); int
count = 0; StringBuilder sb = new
StringBuilder(); for (char c: arr){ if
(c=='#') count++; } while (count-- >
0) sb.append('#'); for (char c: arr)
if (c != '#') sb.append(c); return
sb.toCharArray(); } }

5 15/11/24, Prechecked: import java.util.*; Precheck


21:24:26 public class Main{ public static results
void main(String[] args){ Scanner
in = new Scanner(System.in);
String s = in.next(); String res =
moveHash(s);
System.out.println(res); } public
static String moveHash(String s){
char[] arr = s.toCharArray(); int
count = 0; StringBuilder sb = new
StringBuilder(); for (char c: arr){ if
(c=='#') count++; } while (count-- >
0) sb.append('#'); for (char c: arr)
if (c != '#') sb.append(c); return
sb.toString(); } }

6 15/11/24, Submit: import java.util.*; public Correct 20.00


21:24:33 class Main{ public static void
main(String[] args){ Scanner in =
new Scanner(System.in); String s
= in.next(); String res =
moveHash(s);
System.out.println(res); } public
static String moveHash(String s){
char[] arr = s.toCharArray(); int
count = 0; StringBuilder sb = new
StringBuilder(); for (char c: arr){ if
(c=='#') count++; } while (count-- >
0) sb.append('#'); for (char c: arr)
if (c != '#') sb.append(c); return
sb.toString(); } }

7 15/11/24, Attempt finished submitting: {$a} Correct 20.00


22:23:31

Question 2 Determine the candidate key for the given relation and related functional
Correct dependencies. Given: Relation R = {A, B, C, D, E, F} Functional Dependencies: C
Mark 1.00 out of → F, E → A, EC → D, A → B
1.00

Flag Select one:


question
1. EF
 Edit
question
2. E
v1 (latest) 3. AB
4. CE 

The correct answer is: CE

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:26:54 Saved: CE Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 3 Which of the following statements is FALSE if a relation is decomposed into


Correct two different relations? 1=> Decomposition is always dependency preserving.
Mark 1.00 out of 2=> Decomposition is always lossless join. 3=> Decomposition is always
1.00 dependency preserving and lossless join.
Flag
question Select one:
 Edit
1. Only 2
question
v1 (latest) 2. 1 & 2
3. Only 1
4. 1, 2 & 3 

The correct answer is: 1, 2 & 3

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:27:45 Saved: 1, 2 & 3 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 4 What will be the value of s if n=127?


Correct Read n
Mark 1.00 out of i=0,s=0
1.00 Function Sample(int n)
Flag while(n>0)
question r=n%l0
 Edit p=8^i
question s=s+p*r
v2 (latest)
i++
n=n/10
End While
Return s;
End Function

a. 120

b. 87 

c. 127

d. 27

e. 187

Your answer is correct.

The correct answer is: 87

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:29:51 Saved: 87 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 5 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main(){
1.00 while(printf(“%d”, 5) < 4)
Flag printf(“Loop “);
question return 0;
 Edit }
question
v2 (latest)
a. 5Loop 5Loop 5Loop 5Loop 5Loop

b. None

c. Infinite loop 

d. Loop Loop Loop Loop Loop

Your answer is correct.


The correct answer is: Infinite loop

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Infinite Answer saved


21:30:50 loop

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 6 Identify the highest normal form of relation R(k, l, m, n) with functional
Incorrect dependencies: f{k → m, l → n}
Mark 0.00 out of
1.00 Select one:
Flag
1. 2NF 
question
2. BCNF
 Edit
question 3. 1NF
v1 (latest) 4. 3NF

The correct answer is: BCNF

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:30:59 Saved: 2NF Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 7 What will be the value of t if a =56 ,b = 876?


Correct Read a,b
Mark 1.00 out of Function mul(a, b)
1.00 t=0
Flag while (b != 0)
question t=t+a
 Edit b=b-1
question End While
v2 (latest)
return t;
End Function

a. 490560

b. None

c. 49056 

d. 490563

e. 490561

Your answer is correct.

The correct answer is: 49056

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:32:19 Saved: 49056 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 8 A bridge (networking component) can be used to join: I=> An unshielded


Incorrect twisted-pair (UTP) cabling and fiber-optic cabling II=> Token Ring and Ethernet
Mark 0.00 out of
1.00 Select one:
Flag
1. Both I and II
question
2. Only II
 Edit
question 3. Neither I Nor II
v1 (latest) 4. Only I 

The correct answer is: Both I and II

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:33:06 Saved: Only I Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 9 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main(){
1.00 while(!printf(“awesome”));
Flag return 0;
question }
 Edit
question
a. awesome 
v2 (latest)
b. None

c. Error

d. Infinite loop

Your answer is correct.

The correct answer is: awesome

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:34:13 Saved: Answer saved


awesome

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 10 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main()
1.00 {
Flag while(!!7)
question printf(“Hai”);
 Edit return 0;
question }
v2 (latest)

a. Infinite loop 

b. HaiHai

c. Hai

d. None

Your answer is correct.

The correct answer is: Infinite loop

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Infinite Answer saved


21:34:49 loop

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 11 Which of the following data structures can be used to implement a priority
Correct queue?
Mark 1.00 out of
1.00 Select one:
Flag
1. Stack
question
2. Queue
 Edit
question 3. Heap 
v1 (latest) 4. Linked list

The correct answer is: Heap

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:34:58 Saved: Heap Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 12 Which device operates at Layer 3 of the OSI model?


Correct

Mark 1.00 out of Select one:


1.00
1. Switch
Flag
question
2. Router 

 Edit
3. Hub
question 4. Repeater
v1 (latest)

The correct answer is: Router

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:35:38 Saved: Router Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 13 What will be the output of the following pseudocode?


Correct Integer n
Mark 1.00 out of for (n = 3; n != 0; n--)
1.00 Print n
Flag n = n-1
question end for
 Edit
question
a. 3 2 1
v2 (latest)
b. Infinite Loop 

c. 3

d. 3 1

Your answer is correct.

The correct answer is: Infinite Loop

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Infinite Answer saved


21:35:57 Loop

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 14 Which of the following devices combines transmissions from different


Correct input/output devices into one line?
Mark 1.00 out of
1.00 Select one:
Flag
1. Repeater
question
2. Multiplexer 
 Edit
question 3. Concentrator
v1 (latest) 4. Modifier

The correct answer is: Multiplexer

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Answer saved


21:36:08 Multiplexer

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 15 Which of the following expressions is written in Reverse Polish notation?


Incorrect

Mark 0.00 out of Select one:


1.00
1. ((w + f) -) + d
Flag
question
2. wc + de *- 

 Edit
3. None of the mentioned options
question 4. -*ddvw
v1 (latest)

The correct answer is: None of the mentioned options

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:36:20 Saved: wc + de Answer saved


*-

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 16 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main()
1.00 {
Flag if(sizeof(‘\0’))
question printf(“inside if block”);
 Edit else
question printf(“inside else block”);
v2 (latest)
return 0;
}

a. inside else block

b. None

c. inside if block 

d. Null Pointer Exception

Your answer is correct.

The correct answer is: inside if block

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: inside if Answer saved


21:37:31 block

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 17 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main()
1.00 {
Flag switch(2/3)
question {
 Edit case 1:
question printf(“case 1 executed “);
v2 (latest)
case 2:
printf(“case 2 executed “);
break;
default:
printf(“Default block executed”);
}
return 0;
}

a. case 2 executed

b. case 1 executed

c. Error : Switch statements can not hold

d. Default block executed 

Your answer is correct.


The correct answer is: Default block executed

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Default block Answer saved


21:37:47 executed

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 18 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of #define NULL 0
1.00 int main()
Flag {
question while (NULL == 0)
 Edit {
question printf(“Loop”);
v2 (latest)
break;
}
return 0;
}

a. Loop 

b. 1

c. Null

d. Error : Null can not be compared

e. 0

Your answer is correct.

The correct answer is: Loop

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:38:33 Saved: Loop Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 19 Which of the following checks the cloud service control, verifies adherence to
Incorrect standards, and examines areas such as privacy and performance levels?
Mark 0.00 out of
1.00 Select one:
Flag
1. Cloud carrier
question
2. Load dispatcher
 Edit
question 3. Monitor of services 
v1 (latest) 4. Cloud auditor

The correct answer is: Cloud auditor

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Monitor of Answer saved


21:38:53 services

3 15/11/24, Attempt finished Incorrect 0.00


22:23:31

Question 20 Consider the following arithmetic expression written in postfix notation: 15 3 8


Correct + - 150 + Find the value of the above expression (using the stack data
Mark 1.00 out of structure).
1.00

Flag Select one:


question
1. 146
 Edit
question 2. 154 
v1 (latest) 3. 102
4. 153

The correct answer is: 154

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:40:30 Saved: 154 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 21 Repeaters work on which of the following layers of the OSI model?
Correct

Mark 1.00 out of Select one:


1.00
1. Session layer
Flag
question
2. Physical layer 

 Edit
3. Network layer
question 4. Data link layer
v1 (latest)

The correct answer is: Physical layer

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Physical Answer saved


21:40:52 layer

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 22 Which of the following statements is/are correct about the adjacency matrix?
Correct 1=> The adjacency matrix for an undirected graph is always symmetric. 2=>
Mark 1.00 out of The adjacency matrix is also used to represent weighted graphs.
1.00

Flag Select one:


question
1. Only 2
 Edit
question
2. Neither 1 nor 2
v1 (latest) 3. Both 1 and 2 
4. Only 1

The correct answer is: Both 1 and 2

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Both 1 and Answer saved


21:41:58 2

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 23 Code to sort given array in ascending order:


Incorrect Read size
Mark 0.00 out of Read a[1],a[2],a[size]
1.00 i=0
Flag While(i<size)
question j=i+1
 Edit While(j<size)
question If a[i] < a[j] then
v2 (latest)
t= a[i];
a[i] = a[j];
a[j] = t;
End If
j=j+1
End While
i=i+1
End While
i=0
While (i<size)
print a[i]
i=i+1
End While
Find out the wrong statement in the above pseudocode

a. Line 6

b. Line 4

c. no error

d. Line 7 

e. Line 9

Your answer is incorrect.

The correct answer is: Line 6

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:42:46 Saved: Line 7 Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 24 Consider the following scenario: We want to perform depth-first traversal on a


Correct graph G with n nodes and e edges. Which of the following complexities is
Mark 1.00 out of correct?
1.00

Flag Select one:


question
1. O(n + e) 
 Edit
question 2. O(n + log e)
v1 (latest) 3. O(log n + e)
4. O(e)

The correct answer is: O(n + e)

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:43:38 Saved: O(n + e) Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 25 Consider the following searching algorithms: 1=> Binary search 2=>
Incorrect Exponential binary search Which of the above searching techniques can be
Mark 0.00 out of used to perform unbounded searches?
1.00

Flag Select one:


question
1. Only 2 
 Edit
question
2. Both 1 and 2
v1 (latest) 3. Only 1
4. Neither 1 nor 2

The correct answer is: Both 1 and 2

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:43:55 Saved: Only 2 Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 26 Which of the following are the fundamental constraints that cloud
Correct infrastructure should implement? 1=> Transparency 2=> Scalability 3=> Security
Mark 1.00 out of
1.00 Select one:
Flag
1. 1 & 2
question
2. 1 & 3
 Edit
question 3. 1, 2 & 3 
v1 (latest) 4. 2 & 3

The correct answer is: 1, 2 & 3

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:44:10 Saved: 1, 2 & 3 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 27 What will be the output of the following pseudocode?


Correct For input a = 8 & b = 9.
Mark 1.00 out of Function(input a, input b)
1.00 If(a < b)
Flag return function(b, a)
question elseif(b != 0)
 Edit return (a + function(a,b-1))
question else
v2 (latest)
return 0

a. 72 

b. 78

c. 68

d. 56

e. 62

Your answer is correct.

The correct answer is: 72

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:44:49 Saved: 72 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 28 Consider an array of integers, A = {a, b, c, d, e, f, g, h, i, j, k}, where all elements


Incorrect are constant integers. It is given that the sum of squares of all elements of the
Mark 0.00 out of array equals 0. Find the sum of all elements of the array.
1.00

Flag Select one:


question
1. Cannot be determined
 Edit
question
2. 3
v1 (latest) 3. 2
4. 0 

The correct answer is: 2

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:45:50 Saved: 0 Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 29 Which of the following is a system that accepts service requests and allocates
Correct virtual machines as required?
Mark 1.00 out of
1.00 Select one:
Flag 1. Cloud carrier
question
2. Monitor of services
 Edit
question 3. Load dispatcher 
v1 (latest) 4. Cloud auditor

The correct answer is: Load dispatcher

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Load Answer saved


21:45:59 dispatcher

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 30 In which type of graph, there is a cycle in which each vertex is visited only once
Correct and no edge is visited more than once?
Mark 1.00 out of
1.00 Select one:
Flag
1. Bipartite graph
question
2. Directed graph
 Edit
question 3. Hamiltonian cycle 
v1 (latest) 4. Eulerian graph

The correct answer is: Hamiltonian cycle

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Hamiltonian Answer saved


21:46:34 cycle

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 31 Write an essay on 'How the Internet Has Changed the World.'
Correct
Your essay should consist of a minimum of three paragraphs: the first should
Mark 50.00 out
serve as the introduction, the second should comprise the body, and the third
of 50.00
should act as the conclusion.
Flag
question The essay must contain a minimum of 200 words and a maximum of 250

 Edit
words.
question
v2 (latest)
The internet has completely transformed the world in many ways. It
has made communication faster and easier, connecting people from
different parts of the world instantly. Through social media, emails and
video calls, families and friends can stay in touch no matter the
distance. Businesses can now operate globally, making it easier for
people to work from home, collaborate, and share ideas with
colleagues around the world. The internet has also allowed people to
access information quickly, making learning and education more
accessible to anyone with a connection.

M count: 212
Word h i h h d h h dd b i

Comment: The text is well-structured with an introduction, body, and


conclusion, fulfilling task requirements. It demonstrates coherence, cohesion,
and a rich lexical resource. No grammatical or punctuation errors were found.
Total marks: 50. (Response provided by gpt-4o)

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Commented: The text is well- Not yet


21:19:17 structured with an introduction, answered
body, and conclusion, fulfilling
task requirements. It
demonstrates coherence,
cohesion, and a rich lexical
resource. No grammatical or
punctuation...

2 15/11/24, Saved: The internet has Answer


21:58:42 completely transformed the saved
world in many ways. It has made
communication faster and easier,
connecting people from different
parts of the world instantly.
Through social media, emails and
video calls, families and friends
can stay in touch no matter the
distance. Businesses can now
operate globally, making it easier
for people to work from home,
collaborate, and share ideas with
colleagues around the world. The
internet has also allowed people
to access information quickly,
making learning and education
more accessible to anyone with a
connection. Moreover, the
internet has changed the way we
shop and do business. Online
shopping has become a major
part of everyday life, with people
buying products and services
from the comfort of their homes.
Small businesses can now reach
a global audience without the
need for a physical store. The
internet has also introduced new
ways for people to entertain
themselves, from streaming
movies, to playing online games.
This has lead to the growth of the
entertainment industry, providing
countless options for
entertainment. However, with
these changes, there are
challenges too. The internet has
raised concerns about privacy,
security and addiction. Despite
these challenges, it is clear that
the internet has brought a
revolution, making the world
more connected and opening up
endless possibilities.

3 15/11/24, Attempt finished Correct 50.00


22:23:31

Question 32 Consider the following searching algorithms: 1=> Interpolation search 2=>
Incorrect Binary search Which of the above searching techniques works better if the
Mark 0.00 out of array is sorted and uniformly distributed?
1.00

Flag Select one:


question
1. Only 2
 Edit
question
2. Both 1 and 2 work equally well
v1 (latest) 3. Neither 1 nor 2 works for sorted arrays
4. Only 1 

The correct answer is: Both 1 and 2 work equally well

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:58:54 Saved: Only 1 Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 33 In the context of stacks, what is the term used for removing an element from a
Correct stack?
Mark 1.00 out of
1.00 Select one:
Flag
1. Remove
question
2. Extract
 Edit
question 3. Pop 
v1 (latest) 4. Push

The correct answer is: Pop

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:59:03 Saved: Pop Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 34 Consider a binary heap in which the value in a parent node is greater than the
Correct values in its two children nodes. What is such a binary heap called?
Mark 1.00 out of
1.00 Select one:
Flag
1. Max heap 
question
2. Unique heap
 Edit
question 3. None of the mentioned options
v1 (latest) 4. Min heap

The correct answer is: Max heap

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:59:18 Saved: Max Answer saved


heap

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 35 Consider the following arithmetic expression written in postfix notation: 14 7 2 -


Correct * 3 +. Find the value of the above expression (using stack data structure).
Mark 1.00 out of
1.00 Select one:
Flag
1. 173
question
2. 172
 Edit
question 3. 72
v1 (latest) 4. 73 

The correct answer is: 73

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 21:59:51 Saved: 73 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 36 In which layer of the OSI model does encryption typically occur?
Incorrect

Mark 0.00 out of Select one:


1.00
1. Network layer
Flag
question
2. Transport layer 

 Edit
3. Session layer
question 4. Data Link layer
v1 (latest)

The correct answer is: Session layer

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Transport Answer saved


22:00:38 layer

3 15/11/24, Attempt finished Incorrect 0.00


22:23:31

Question 37 Consider a stack s: 2, 4, 16, 4, 6, 7, 8_,_. A push operation is performed until a


Incorrect perfect square is encountered. What is the value of the top-most element after
Mark 0.00 out of all the push operations have been performed?
1.00

Flag Select one:


question
1. 2
 Edit
question
2. 4
v1 (latest) 3. 16 
4. None of the mentioned options

The correct answer is: 2

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:02:38 Saved: 16 Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 38 What will be the value of even_counter if number = 2630?


Incorrect Read number
Mark 0.00 out of Function divisible(number)
1.00 even_counter = 0, num_remainder = number;
Flag while (num_remainder)
question digit = num_remainder % 10;
 Edit if digit != 0 AND number % digit == 0
question even_counter= even_counter+1
v2 (latest)
End If
num_remainder= num_remainder / 10;
End While
return even_counter;

a. 4

b. 0

c. 1

d. 3

e. 2 

Your answer is incorrect.

The correct answer is: 1

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:03:34 Saved: 2 Answer saved

3 15/11/24, Attempt Incorrect 0.00


22:23:31 finished

Question 39 Which of the following array representations represent a strict but not complete
Correct binary tree?
Mark 1.00 out of
1.00 Select one:
Flag 1. A, B, C, D, E
question
2. A, B, C, D, E, F, G
 Edit
question 3. None of the mentioned options
v1 (latest) 4. A, B, C, _, _, D, E 

The correct answer is: A, B, C, _, _, D, E

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: A, B, C, _, _, Answer saved


22:03:54 D, E

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 40
Correct
Problem Statement:
Mark 20.00 out Given a string with consecutive repeated characters, you are tasked with
of 20.00 compressing the string such that each consecutive character sequence is
Flag replaced by the character followed by the count of its occurrences. If a
question character appears only once consecutively, it should be retained without any
 Edit count. Objective: Write a program that compresses a string by reducing
question consecutive repeated characters into the character followed by the count of
v2 (latest) repetitions. Input: A string s consisting of lowercase alphabets (a-z). Output: A
compressed version of the string, where each consecutive character is
followed by its count if it appears more than once consecutively, or just the
character itself if it appears only once.

Sample TestCases:
Sample Input 1:

aabbbbeeeeffggg

Sample Output 1:

a2b4e4f2g3

Sample Input 2:

abbccccc

Sample Output 2:
ab2c5

Sample Input 3:

abcd

Sample Output 3:

abcd

Constraints:
-

For example:

Test Input Result

Sample Test Case 1 aabbbbeeeeffggg a2b4e4f2g3

Sample Test Case 2 abbccccc ab2c5

Sample Test Case 3 abcd abcd

Answer: (penalty regime: 10, 20, ... %)

Language java

1 import java.util.*;
2
3 ▼ public class Main{
4▼ public static void main(String[] args) {
5 Scanner in = new Scanner(System.in);
6
7 String s = in.next();
8 String compressed = compress(s);
9 System.out.println(compressed);
10 }
11 ▼ public static String compress(String s){
12 StringBuilder sb = new StringBuilder();
13 int n = s.length(), count = 0;
14 ▼ for (int i = 0; i < n;) {
15 final char c = s.charAt(i);
16 count = 0;
17 ▼ while (i < n && s.charAt(i)==c) {
18 i++; count++;
19 }
20 sb.append(c);
21 ▼ if (count > 1) {
22 sb.append(count);
23 }
24 }
25
26 return sb.toString();
27 }
28 }

Test Input Expected Got

 Sample Test Case 1 aabbbbeeeeffggg a2b4e4f2g3 a2b4e4f2g3

 Sample Test Case 2 abbccccc ab2c5 ab2c5

 Sample Test Case 3 abcd abcd abcd

 Hidden Test Case 1 ffppppyyyydddds f2p4y4d4s f2p4y4d4s

 Hidden Test Case 2 zppzzzzwwwwwoox zp2z4w5o2x zp2z4w5o2x

 Hidden Test Case 3 ffwwwwwssrrrrri f2w5s2r5i f2w5s2r5i

 Hidden Test Case 4 xxxxxllwwwwwttm x5l2w5t2m x5l2w5t2m

 Hidden Test Case 5 ssccccmmcccccew s2c4m2c5ew s2c4m2c5ew

 Hidden Test Case 6 kiyyyyynnmmmmxx kiy5n2m4x2 kiy5n2m4x2

 Hidden Test Case 7 nnnniiiiuuiuuut n4i4u2iu3t n4i4u2iu3t

 Hidden Test Case 8 cccnlllllyjjxxx c3nl5yj2x3 c3nl5yj2x3

 Hidden Test Case 9 vvvwwwwwwwsppxb v3w7sp2xb v3w7sp2xb

 Hidden Test Case 10 ggggbbbbbxxsrrr g4b5x2sr3 g4b5x2sr3

 Hidden Test Case 11 gxxxxzzwwweeeee gx4z2w3e5 gx4z2w3e5

 Hidden Test Case 12 bbbbbggggjpppee b5g4jp3e2 b5g4jp3e2

 Hidden Test Case 13 hhhhhttlffhhhoo h5t2lf2h3o2 h5t2lf2h3o

 Hidden Test Case 14 aiitttttoooooii ai2t5o5i2 ai2t5o5i2

Passed all tests! 

Correct
Marks for this submission: 20.00/20.00.

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not


21:19:17 complete

2 15/11/24, Prechecked: import java.util.*; Precheck


22:08:15 public class Main{ public static results
void main(String[] args) { Scanner
in = new Scanner(System.in);
String s = in.next(); String
compressed = compress(s);
System.out.println(compressed); }
public static String
compressed(String s){
StringBuilder sb = new
StringBuilder(); int n = s.length();
for (int i = 0; i < n;) { final char c =
s.charAt(i); int count = 0; while (i <
n && s.charAt(i)==c) { i++;
count++; } if (count > 1) {
sb.append(c).append(count); } }
sb.append(s.charAt(n-1));
sb.append(count); return
sb.toString(); } }

3 15/11/24, Prechecked: import java.util.*; Precheck


22:08:29 public class Main{ public static results
void main(String[] args) { Scanner
in = new Scanner(System.in);
String s = in.next(); String
compressed = compress(s);
System.out.println(compressed); }
public static String
compress(String s){ StringBuilder
sb = new StringBuilder(); int n =
s.length(); for (int i = 0; i < n;) {
final char c = s.charAt(i); int count
= 0; while (i < n && s.charAt(i)==c)
{ i++; count++; } if (count > 1) {
sb.append(c).append(count); } }
sb.append(s.charAt(n-1));
sb.append(count); return
sb.toString(); } }

4 15/11/24, Prechecked: import java.util.*; Precheck


22:09:57 public class Main{ public static results
void main(String[] args) { Scanner
in = new Scanner(System.in);
String s = in.next(); String
compressed = compress(s);
System.out.println(compressed); }
public static String
compress(String s){ StringBuilder
sb = new StringBuilder(); int n =
s.length(), count = 0; for (int i = 0; i
< n;) { final char c = s.charAt(i);
count = 0; while (i < n &&
s.charAt(i)==c) { i++; count++; } if
(count > 1) {
sb.append(c).append(count); } }
sb.append(s.charAt(n-1));
sb.append(count); return
sb.toString(); } }

5 15/11/24, Prechecked: import java.util.*; Precheck


22:13:18 public class Main{ public static results
void main(String[] args) { Scanner
in = new Scanner(System.in);
String s = in.next(); String
compressed = compress(s);
System.out.println(compressed); }
public static String
compress(String s){ StringBuilder
sb = new StringBuilder(); int n =
s.length(), count = 0; for (int i = 0; i
< n;) { final char c = s.charAt(i);
count = 0; while (i < n &&
s.charAt(i)==c) { i++; count++; }
sb.append(c); if (count > 1) {
sb.append(count); } }
sb.append(s.charAt(n-1));
sb.append(count); return
sb.toString(); } }

6 15/11/24, Prechecked: import java.util.*; Precheck


22:13:38 public class Main{ public static results
void main(String[] args) { Scanner
in = new Scanner(System.in);
String s = in.next(); String
compressed = compress(s);
System.out.println(compressed); }
public static String
compress(String s){ StringBuilder
sb = new StringBuilder(); int n =
s.length(), count = 0; for (int i = 0; i
< n;) { final char c = s.charAt(i);
count = 0; while (i < n &&
s.charAt(i)==c) { i++; count++; }
sb.append(c); if (count > 1) {
sb.append(count); } } return
sb.toString(); } }

7 15/11/24, Submit: import java.util.*; public Correct 20.00


22:13:52 class Main{ public static void
main(String[] args) { Scanner in =
new Scanner(System.in); String s
= in.next(); String compressed =
compress(s);
System.out.println(compressed); }
public static String
compress(String s){ StringBuilder
sb = new StringBuilder(); int n =
s.length(), count = 0; for (int i = 0; i
< n;) { final char c = s.charAt(i);
count = 0; while (i < n &&
s.charAt(i)==c) { i++; count++; }
sb.append(c); if (count > 1) {
sb.append(count); } } return
sb.toString(); } }

8 15/11/24, Attempt finished submitting: {$a} Correct 20.00


22:23:31

Question 41 Consider two arrays, A and B: A = {1, 3, 5} B = {2, 0} A new array is formed by
Correct joining the two arrays. Sorting is done on the new array. What will be the
Mark 1.00 out of second-to-last element in the new array?
1.00

Flag Select one:


question
1. 0
 Edit
question
2. 1
v1 (latest) 3. 5
4. 3 

The correct answer is: 3

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:15:58 Saved: 3 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 42 Which of the following are the main functions of a stack? 1=> Push 2=> Pop
Correct 3=> Peek
Mark 1.00 out of
1.00 Select one:
Flag
1. 1 & 2
question
2. 1, 2 & 3 
 Edit
question 3. 2 & 3
v1 (latest) 4. 1 only

The correct answer is: 1, 2 & 3

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:16:14 Saved: 1, 2 & 3 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 43 How many times the following loop be executed?


Correct {
Mark 1.00 out of ch = b;
1.00 while(ch >= a && ch <= z)
Flag ch++;
question }
 Edit
question
a. 0
v2 (latest)
b. 25 

c. 1

d. 26

Your answer is correct.

The correct answer is: 25

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:16:30 Saved: 25 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 44 Identify the correct statement about a full binary tree.


Incorrect

Mark 0.00 out of Select one:


1.00
1. The number of nodes in a full binary tree is always even
Flag
question
2. None of the mentioned options

 Edit
3. The number of nodes in a full binary tree may be even or odd
question 4. The number of nodes in a full binary tree is always odd 
v1 (latest)

The correct answer is: The number of nodes in a full binary tree may be even or
odd

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: The number of Answer


22:17:38 nodes in a full binary tree is saved
always odd

3 15/11/24, Attempt finished Incorrect 0.00


22:23:31

Question 45 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main()
1.00 {
Flag int i = 65;
question switch(i)
 Edit {
question case 65:
v2 (latest)
printf(“Integer 65”);
break;
case ‘A’:
printf(“Char 65”);
break;
default:
printf(“Bye”);
}
return 0;
}

a. Char 65

b. Error : Duplicate Values

c. Integer 65 

d. Bye

Your answer is correct.

The correct answer is: Integer 65

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:18:03 Saved: Integer Answer saved


65

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 46 Data redundancy leads to:


Correct

Mark 1.00 out of Select one:


1.00
1. Data atomicity problem
Flag
question
2. Data inconsistency problem 

 Edit
3. Data integrity problem
question 4. Data security problem
v1 (latest)

The correct answer is: Data inconsistency problem

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Data Answer


22:18:35 inconsistency problem saved

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 47 Which of the following statements is correct for routers? 1=> It manages traffic
Correct between networks by forwarding data packets to their intended IP addresses.
Mark 1.00 out of 2=> It allows multiple devices to use the same Internet connection. 3=> It
1.00 manages traffic between networks and devices by forwarding data packets to
Flag their intended MAC addresses.
question

 Edit Select one:


question
1. Only 2
v1 (latest)
2. 1 & 2 
3. Only 3
4. 2 & 3

The correct answer is: 1 & 2

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:19:06 Saved: 1 & 2 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 48 Which of the following protocols is used for routing in the Internet?
Correct

Mark 1.00 out of Select one:


1.00
1. ARP
Flag
question
2. RIP 

 Edit
3. ICMP
question 4. FTP
v1 (latest)

The correct answer is: RIP

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:19:38 Saved: RIP Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 49 James is using heap sort to sort an array in increasing order. What is the overall
Correct time complexity of the sorting technique used by him?
Mark 1.00 out of
1.00 Select one:
Flag
1. logn
question
2. n²
 Edit
question 3. nlogn 
v1 (latest) 4. O

The correct answer is: nlogn

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:20:03 Saved: nlogn Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 50 Consider an array R containing some number of elements. While sorting the
Correct array R using count sort, an array named C is used to store the frequencies of
Mark 1.00 out of the elements. What is the space complexity of the count sort algorithm in this
1.00 case?
Flag
question Select one:
 Edit
1. O 
question
v1 (latest) 2. O(log n)
3. O(n²)
4. O(1)

The correct answer is: O

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:21:19 Saved: O[No] Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 51 Suppose there is a 1-D array Arr[20] with the lower bound as 1 and starting
Correct base address as 60. Find the address of Arr[3] if the size of each element is 4.
Mark 1.00 out of
1.00 Select one:
Flag
1. 63
question
2. 72
 Edit
question 3. 68 
v1 (latest) 4. 64

The correct answer is: 68

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, 21:19:17 Started Not yet


answered

2 15/11/24, 22:22:28 Saved: 68 Answer saved

3 15/11/24, Attempt Correct 1.00


22:23:31 finished

Question 52 What will be the output of following code :


Correct #include<stdio.h>
Mark 1.00 out of int main(){
1.00 float ft = 7.5;
Flag while(ft)
question {
 Edit printf(“Loop”);
question ft = ft – .5;
v2 (latest)
if(ft == 5.0f)
break;
}
return 0;
}

a. Loop

b. LoopLoopLoopLoopLoop 

c. No output

d. LoopLoopLoopLoop

e. None

Your answer is correct.

The correct answer is: LoopLoopLoopLoopLoop

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: Answer


22:23:09 LoopLoopLoopLoopLoop saved

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Question 53 Which of the following statements is correct regarding the enqueue operation
Correct in a queue?
Mark 1.00 out of
1.00 Select one:
Flag
1. It is the operation to remove an element from the front of the queue.
question
2. It adds an element at the front of the queue.
 Edit
question 3. It is the operation to add an element at the end of the queue. 
v1 (latest) 4. None of the above

The correct answer is: It is the operation to add an element at the end of the
queue.

Make comment or override mark

Response history
Step Time Action State Marks

1 15/11/24, Started Not yet


21:19:17 answered

2 15/11/24, Saved: It is the operation to Answer


22:23:22 add an element at the end saved
of the queue.

3 15/11/24, Attempt finished Correct 1.00


22:23:31

Finish review

You might also like