You are on page 1of 4

5/25/2018 Start your examination..

Welcome, ADHIYAT MIFTAHUDIN LATIF Friday - May 25, 2018

Test Subject : Firmware Engineer

Start Time : 15:05:00

End Time : 15:35:00

Time Left : 00:28:57

Read carefully and answer this question to complete the test! and do not refresh the test page or your answer will be lost!

1 What is the output of following code snippet?

//code

int main(void)
{
int c[] = { 2, 3, 5, 8, 13 };
int j;
int *p=c;
int *q=c;
for (j=0;j<5;j++)
{
printf(" %d ",*c);
++q;
}
for (j=0;j<5;j++)
{
printf(" %d ",*p);
++p;
}
return 0;
}

//end code

a. 2 2 2 2 2 2 3 5 8 13

b. 2 3 5 8 13 2 3 5 8 13

c. 2 3 5 8 13 13 13 13 13 13

d. 2 3 4 5 6 6 4 6 9 14

2 Consider this code:

int x = 11;
x |= 6;
x &= ~4;

What is the value of x?

a. 4

b. 16

c. 11

d. 15

https://formulatrixindonesia.com/fmlx/fmlx_quiz/_startExam.php 1/4
5/25/2018 Start your examination..

3 Consider this method:

// assume: short is 2 bytes


short int xxx(short int x)
{
return x << 8 | x >> 8;
}

What would get returned on: xxx (0x77aa)?

a. 0x77aa

b. 0x77aa00

c. 0xaa77

d. 0xff77

4
What is the output of above code snippet?

//code
class Shape
{
public:
virtual void showName() { cout<<"I am a shape. "; }
void showArea() { cout<<"Cannot be determined. "; }
};

class Circle: public Shape


{
public:
void showName() { cout<<"I am a circle. "; }
virtual void showArea() { cout<<"Area = PI*r*r. "; }
}

int main(void)
{
Shape *c = new Circle();
c->showName();
c->showArea();
return 0;
}
//end code

a. I am a shape. Cannot be determined.

b. I am a circle. Area = PI*r*r.

c. I am a shape. Area = PI*r*r.

d. I am a circle. Cannot be determined.

5 When is a hash table better to use than a list?

a. When adding items to the collection.

b. When finding items by value on a large collection.

c. When finding items by key on a large collection.

d. When iterating over all the values.

6 Given these definitions:


What circuit is this?

https://formulatrixindonesia.com/fmlx/fmlx_quiz/_startExam.php 2/4
5/25/2018 Start your examination..

a. Half Adder

b. Full Adder

c. Multiplexer

d. Selector

7 What would calling Daemon.run() print?

//code
public class Daemon
{
private int id;
public Daemon( int testid )
{
id = testid;
}
public void printID()
{
Console.WriteLine( id );
}
// creates a thread that calls printID() on entry
private static Thread createThread( int id )
{
ThreadStart entryPoint = new ThreadStart( new Daemon( id ).printID );
return new Thread( entryPoint );
}
public static void run()
{
createThread( 1 ).Start();
createThread( 2 ).Start();
}
}
//end code

a. Exception is thrown

b. Cannot be determined

c. 21

d. 12

8 Given these definitions:

void * v;
char * c;

and these statements:


(1) The v pointer can point to anything.

(2) You can perform pointer arithmetic the c pointer.


(3) Once c goes out of scope, its value cannot be determined.
(4) You cannot cast v as (int *).
(5) You can cast c as (void *).

Which statements are true?

https://formulatrixindonesia.com/fmlx/fmlx_quiz/_startExam.php 3/4
5/25/2018 Start your examination..
a. 1, 2, 3, 4

b. 1, 3, 4, 5

c. 1, 2, 3, 5

d. 2, 3, 4, 5

9 A signal has a maximum frequency of 10 kHz. At what minimum frequency should the signal be sampled?

a. 10 kHz

b. 100 kHz

c. 20 kHz

d. 5 kHz

10 There is a PID algorithm controlling your system. Given the system response in the picture. If you did not mind overshoot how would you
decrease the time to get to the set-point?

a. Decrease P gain

b. Increase D gain

c. Decrease I gain

d. Increase P gain

Submit your answer

Copyright©2010 Formulatrix,Inc | Programmed by Forindo-IT

https://formulatrixindonesia.com/fmlx/fmlx_quiz/_startExam.php 4/4

You might also like