Vidispine Quiz

Systemvetardagen 2018

Take our quiz, show your skills and compete for epic (well…) prizes!

You!


yey!ney


https

1. Which of these urls have correct syntax?

https://www.vidispine.com/careers?cool=true?wage=highhttps://www.vidispine.com/careers;inspiring=yes/marketinghttps://www.vidispine.com/partycalendar?date=30/11/2017

Java

1. Why is this code not very good? What tool can be used to make the method more efficient?

Class MyString{
	private String myStringValue;
	public void myAppend(String anotherString){
		myStringValue = myStringValue + anotherString;
	}
}

StringBuilderStringConcatjoinStringsStringConstructor

2. The following code will not work as the author expected. Why not?

interface Container<T>{
	boolean contains(T item);
}
Class ABContainer implements Container<A>, Container<B>{
	public List<A> AContents;
	public List<B> BContents;
	boolean contains(A item){
		return AContents.contains(item);
	}
	boolean contains(B item){
		return BContents.contains(item);
	}
}

Python

1. The following code is run. Will it run, and if so, what the value of x be?

def print_stuff(stuff):
	print(“This is some stuff: “ + str(stuff))
x = 3
x = print_stuff(x)

It will not run (due to invalid typing)It will not run (due to missing return statement)It will run. The value will be 3It will run. The value will be NoneIt will run. The value will be Null

2. These methods are intended to work the same, but they don't quite. For what input do they differ?

def method_1(x):
	[print(y) for y in x]

def method_2(x):
	print(x[0])
	if len(x) > 1:
		method_2(x[1:])

3. Describe what the following method does:

def method_a(*args, **kwargs):
	kwargs[‘c’] = True
	return method_b(*args, **kwargs)

It calls method_b with the argument 'c' always set to True.It calls method_b, and modifies the output value to include 'c'=True.If calls method_b, but if the user hasn't set the argument 'c', an exception is raised.

Javascript

1 What will be printed here?

var arr = [10, 12, 15, 21];
for (var i = 0; i < arr.length; i++) {
	setTimeout(function() {
		console.log('index: ' + i + ', element: ' + arr[i]);
	}, 1000);
}


a

index: 0, element: 10
index: 1, element: 12
index: 2, element: 15
index: 3, element: 21

b

index: 4, element: undefined
index: 4, element: undefined
index: 4, element: undefined
index: 4, element: undefined

c

index: 3, element: 21
index: 3, element: 21
index: 3, element: 21
index: 3, element: 21

d

index: 0, element: 12
index: 1, element: 15
index: 2, element: 21
index: 3, element: undefined

2. What will be printed?

obj_1 = {
	print: () => {
		var message = "Aloha";
		console.log(this.message);
	},
	message: "Good day"
}

obj_2 = {
	print: function() {
		var message = "Howdy"
		console.log(this.message);
	},
	message: "Greetings"
}

obj_1.print.message = "Bonjour";
obj_2.print.message = "Namaste";

this.message = "Hello";
message= "Whazzup";

obj_1.print();
obj_2.print();