Sap Labs Scholar Mock-Test 1

514
Created on By useruser

Sap Labs Scholar Mock Test 2020

1 / 15

In a time-sharing operating system, when the time slot given to a process is completed, the process goes from the running state to the __________

2 / 15

Which is the correct format of writing JSON name/value pair?

3 / 15

import java.util.*;

public class hashSet
{
public static void main(String[] args)
{
HashSet<String> hashSet = new HashSet<>();
hashSet.add("Shout");
hashSet.add("Now");
hashSet.add("Coders");
hashSet.add("Shout Coders");

System.out.println(hashSet);

}
}

4 / 15

public class Test implements Runnable
{
public void run()
{
System.out.printf("Shout");
}
public static void main(String[] args) throws InterruptedException
{
Thread thread1 = new Thread(new Test());
thread1.start();
thread1.start();
System.out.println(thread1.getState());
}
}

5 / 15

import java.util.*;
class Bitset
{
public static void main(String args[])
{
BitSet obj = new BitSet(5);
for (int i = 0; i < 5; ++i)
obj.set(i);
obj.clear(2);
System.out.print(obj);
}
}

6 / 15

A single read statement can be used with one or more variables.

7 / 15

What is the time complexity to insert a node based on position in a priority queue?

8 / 15

import java.util.*;
class Bitset
{
public static void main(String args[])
{
BitSet obj = new BitSet(5);
for (int i = 0; i < 5; ++i)
obj.set(i);
obj.clear(2);
System.out.print(obj);
}
}

9 / 15

What is the functionality of the following piece of code?

public Object delete_key()
{
if(count == 0)
{
System.out.println("Q is empty");
System.exit(0);
}
else
{
Node cur = head.getNext();
Node dup = cur.getNext();
Object e = cur.getEle();
head.setNext(dup);
count--;
return e;
}
}

10 / 15

To spawn a child of our own choice for running the script, we can use ___ command.

11 / 15

Choose the statement which is incorrect with respect to dynamic memory allocation?

12 / 15

#include <stdio.h>
int main()
{
int ary[2][3];
foo(ary);
}
void foo(int *ary[])
{
int i = 10, j = 2, k;
ary[0] = &i;
ary[1] = &j;
*ary[0] = 2;
for (k = 0;k < 2; k++)
printf("%d\n", *ary[k]);
}

13 / 15

SELECT *
FROM student JOIN takes USING (ID);
The above query is equivalent to

14 / 15

The query given below will not give an error. Which one of the following has to be replaced to get the desired output?

SELECT ID, name, dept name, salary * 1.1
WHERE instructor;

15 / 15

#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
int *r = &p;
printf("%d", (**r));
}

Your score is

The average score is 38%

0%

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami