begin process at 2012 05 29 02:14:56
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive C/C++

 > 

Archives

 > 

Au secours

 > 

C++ questionaire


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

C++ questionaire

jeudi 31 mars 2005 à 13:29:59 | C++ questionaire

fcoutel

Bonjour,

On m'a donne un questionnaire a remplir est ce que quelq'un connait les reponses ?

Merci!

 

Multiple choice questions may have more than one correct answer. 

 

Q1:

 

You need to use a data structure for storing many data elements by a unique key.  The key values are sparse, and you need quick retrieval of the data elements by key.  What container class(es) could you use?

 

A) Double linked list

B) Array \ Vector

C) AVL Tree

D) Hash Table

E) None of the above

 

 

 

 

Q2:

 

Which of the following implicitly invokes a c++ copy constructor?

 

A) Passing a class instance by value as a function\method argument.

B) Initializing one class instance to another in its declaration.

C) Returning a class instance from a function\method by value.

D) Copying one class instance to another in an assignment statement when an assignment operator is provided.

E) Copying one class instance to another in an assignment statement.

 

 

 

 

Q3:

 

You need to remove an item from a container class, which of the following containers will remove the item in constant time?

 

A) Double Linked List

B) Single Linked List

C) Array \ Vector

D) Hash Table

E) RB Tree

F) Dongle Tree

 

 

 

 

Q4:
 

One way to implement a scene graph culling system is to have an array of structs where the struct has a sphere member and object pointer. Another way is to have a list of objects where the object contains a sphere. What are some of the tradeoffs?

 

A) array of structs is cache friendly and is easy to work with; list of objects is cache friendly but is difficult to maintain and use

 

B) array of structs is not cache friendly and is easy to work with; list of objects is not cache friendly and is difficult to maintain and use.

 

C) array of structs is cache friendly, hard to maintain and work with; list of objects is not cache friendly but is easy to maintain and work with.

 

D) array of structs is cache friendly and is easy to maintain and work with; list of objects is cache friendly and is easy to maintain and work with.

 

 

 

 

Q5:

 

You have added some virtual function to a class, which do you incur?

 

A) a small constant memory footprint cost for each virtual function to each class instantiation

B) a small constant memory footprint cost to each class instantiation

C) no cost to the memory footprint whatsoever

D) a small constant memory footprint cost to each class instantiation and a once off memory footprint for a virtual function pointer table

E) if the virtual function is pure virtual, no cost.

 

 

 

 

Q6:

 

You need to write a reference counted base class and want to stop users from manually calling delete on the object.  How would you do this?

 

A) Override the delete operator in the reference counted base class.

B) Declare the class destructor in the protected or private scope.

C) Declare the class destructor using the "const" declaration modifier.

D) Declare the class destructor using the "static" declaration modifier.

E) Don't provide a class destructor.                                                                                 

 

 

 

 

Q7:

 

If a vector A = (1, 0, 0), and vector B = (0, 1, 0), what would be the approximate value of a linear interpolation from A to B, when t = 0.5?

 

A) 0.5

B) (0, 0, 1)

C) (0.5, 0.5, 0)

D) (0.7, 0.7, 0)

E) (0, 0, 0)

 

 

 

 

Q8:

 

How is the number 0x12345678 stored on a big-endian machine:

 

A) 12  34  56  78

B) 78  56  34  12

C) 87  65  43  21

D) 56  78  12  34

 

 

 

 

Q9:

 

You have added static members and methods to a class; do they contribute to the byte size of an instantiation of that class?

 

A) Yes                                                                         

B) No                                                                           

C) It Depends

 

 

 

 

Q10:

 

You have written a template class in c++ and use the class templated with 3 types.  Does the compiler

 

A) Generate code for the 3 instantiations at runtime

B) Generate code and symbol table information once

C) Generate code and symbol table information for all 3 types

D) Depends if you force instantiated the class by using function prototypes or typedefs

 

 

Q11:

 

Create a Sphere class with the following capabilities:

 

 

1) Write a collision function that will return true if two spheres intersect.

2) Write a collision function that will return true if a sphere and a point intersec. Use the Point structure supplied below.

 

struct Point

{

  float x;

  float y;

  float z;

}; 

 

 

Please type working C++ code.  In other words, use standard C++, make certain that it is free of syntax errors, and is reasonably complete.

 

 

Type your code below:

 

 

 

 

jeudi 31 mars 2005 à 17:36:06 | Re : C++ questionaire

cleter

slt,
Tu peux nous dire a quoi sert ce questionnaire?


jeudi 31 mars 2005 à 19:29:24 | Re : C++ questionaire

steve_clamage

Ca ressemble beaucoup à un questionnaire d'embauche.

Q1: je doute, mais E)
Q2: A)  B) C)
Q3: A) et B) sur
Q5: D)
Q6: A)
Q8: voir sur google
Q10: C)

attends d'autres suggestions.
vendredi 1 avril 2005 à 10:06:52 | Re : C++ questionaire

fcoutel

Bonjour,

C'est bien un questionnaire d'embauche dans une boite a l'etranger. J'ai pas mal code jusque la mais j'avoue que certaines questions m'ont paru difficile.

Voila ce que j'ai pour le moment

Q1:
D [A lookup table that is designed to efficiently store non-contiguous keys (account numbers, part numbers, etc.) that may have wide gaps in their alphabetic and numeric sequences]

Q2:
A  B C  OK!

Q3:
A B  D   [C(except adding/deleting elements at the beg/end), RB tree (log(n),]
dongle Tree ???

Q4:
???

Q5:
D peut etre A et C?

Q6:
A mais comment?

Q7:
C

Q8:
B

Q9:
C

Q10
A?

Q11:
J'ai le code



vendredi 1 avril 2005 à 20:02:50 | Re : C++ questionaire

steve_clamage

Q5:
D peut etre A et C?

je pense que oui, et aussi E) à verifier, est-ce que une classe disposant d'une methode virtuelle pure suffit à la rendre polymorphique ?

Q6: [url]http://casteyde.christian.free.fr/online/cours_cpp/x3244.html#AEN3427[/url]

Q10: le mot 'runtime ' ? Je pense que c'est C), si tu instencies ta classe template pour 3 types, le code sera générés pour les 3 types lors de la compilation


Cette discussion est classée dans : and, class, to, of, is


Répondre à ce message

Sujets en rapport avec ce message

MFC - Créer des composants draggables et étirables - Comment marche DrawCLI du MSDN [ par randriano ] Bonjour tout le monde !J'ai étudié depuis quelques temps le sample mfc du MSDN qui se nomme "DrawCLI" mais il semble compliqué : je me demande comment probleme execution sous visual avec GLut [ par kcrik ] Bonjour, Voila j'ai un soucis avec un programme utilisant glut sous visual.J'ai fait tous les linkages necessaires, toutes les bibliotheques sont bien Petit probleme [ par Socium ] bonjours voila j'ai une petit probleme et je ne sais pas tros le qu'elle c'est .on ma passer un fichier comptenant des macro .voici les marco.Le probl Tres urgent [ par tomay3000 ] Hello every body. I am posting this message hope that you help me solving my problem which is:I crated a simple application using Visual C++ 6.0 with "must point to class/struct/union" [ par ouedge ] Bonjour à tous, Je suis en train de travailler sur un programme en C++ et j'obtiens régulièrement ce message "...must point to class/struct/union" qua réseau [ par bachoura ] hello How can i get OID against a particular command of router.Like i want to graph diferent aspect of a Cisco 7200 Router Commands.Like i want to mon pb avec allegro et dev c++ sur un port USB [ par karistouf ] Hi, I need DEEPLY HELP:I have a problem using Allegro and DEV C++ 4 9 8 0. I m developing a freeware for light management in theatre, with a hardware simulation OMNET++ [ par AmirateGHG ] Hello everyone, I am a beginner in OMNeT + + and I must simulate the end to end QoS through two networks of the same type (802.11e) via an MPLS net


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,170 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales