NesC and WSN Quiz

 

 

 

Each right answer carries one mark and wrong answer carries negative 0.5 marks. You have 15 minutes to complete the quiz

 

Example:

 

NesC is

 

   1.  a programming language

   2.  an operating system

   3.  a variant of C language

   4.  name of coffee brand from Nestle

 

Above answers will earn you 1.5 marks. It is because two of your answers were right and one was wrong.

 

An Interface in nesC may contains following

1.      events

2.      tasks

3.      variables

4.      commands

 

An interface Intf contains an event. That event should be implemented by

1.      at least one user of Intf

2.      at least one provider of Intf

3.      all users of Intf

4.      all providers of Intf

 

An interface Intf contains a command. That command should be implemented by

1.      at least one user of Intf

2.      at least one provider of Intf

3.      all users of Intf

4.      all providers of Intf

 

An interface has three events. You are writing a component that needs to implement only one event. Hence you must provide implementation of

1.      only the event you are interested in

2.      all three events

3.      at least one event.

4.      none of above

 

A task

1.      Never returns a value

2.      May returns a value

3.      Never has parameters

4.      May has parameters

 

Three functions named fun1(), fun2(), fun3() are implemented by Split-Phase model. From a main function,  fun1() is called first followed by fun2() and finally fun3() is called. Which function will finish executing first?

1.      fun1()

2.      fun2()

3.      fun3()

4.      Any one of them.

 

Three functions named fun1(), fun2(), fun3() are implemented by Blocking model. From a main function, fun1() is called first followed by fun2() and finally fun3() is called. Which function will finish executing first?

1.      fun1()

2.      fun2()

3.      fun3()

4.      Any one of them.

 

 

You find following written in a configuration file A.B->C. Here A could be

1.      an interface

2.      a module

3.      a configuration

4.      a header file

 

You find following written in a file A.B->C. Here B could be

1.      an interface

2.      a module

3.      a configuration

4.      a header file

 

You find following written in a file A.B->C. Here C could be

1.      an interface

2.      a module

3.      a configuration

4.      a header file

 

You find following written in a file A = C. Here C could be

1.      an interface

2.      a module

3.      a configuration 

4.      a header file


 

Fill in the blanks

 

interface PacketTest {

    command  void function1(…);

    command void function2(…);

   event void function3(…);

}

 

module PacketTestC {

            uses interface PacketTest;

uses interface Boot;

}

 

{    

task void tast1();

 

  event  void Boot.booted()

  {

      post  task1();

  }

 

 

  event void PacketTest.function3(…) {

      …

     …

      }

         

 

          task void task1() {

              signal PacketTest.function3(…);

 call PacketTest. function1(…);

 

         }

     

      

 }

 

 

 

A RFID based device could not

1.      sense

2.      compute

3.      transmit

4.      save

 

In a unit time a typical WSN node consumes most energy in

1.      sleep mode

2.      transmitting

3.      idle listening

4.      computing

 

 

Two components have limited differences. They are required to interoperate using common interface, which design pattern could help?

1.      Facade

2.      Placeholder

3.      Dispatcher

4.      Adaptor

 

One wish to combine related interfaces which design pattern could help him?

1.      Facade

2.      Placeholder

3.      Dispatcher

4.      Adaptor

 

 

Typically in WSN a MAC layer is responsible for

1.      sharing medium between neighboring nodes

2.      sending/receiving data from source to destination using multiple hops

3.      sending/receiving data between neighbors

4.      reducing node’s energy consumption