Welcome to graduate2professional.blogspot.com

Wednesday, November 11, 2009

HR Questions

1. Do you ever outperform others? Tell me a time that demonstrates this?
2. Do you prefer a slow, medium, fast paced environment and why?
3. Do you ever take on to many tasks?
4. Do people come to you for answers and why?
5. How important is it to you to be the best?
6. Do you prefer to be part of a group or to lead a group and why?
7. What do you look for in a company that you work for?
8. On a scale of 1 to 10, how competitive are you and why?
9. How important is it for you to be 'liked' by your peers?
10.Did anyone approach you if they face any obstacles? When?
11. Explain me about the character of any of your manager?
12.Explain me the best reputation or the best compliments about your work?
13. Have you felt very proud of yourself when you accomplished
anything?when?
14. Rate yourself from 1 - 5 about your honesty.
15. Did anyone feel you are friendly in nature? Explain
16. Is your character the same with everyone or changes from person to
person.
17. What type of characters do you feel to work out with.
18. Are you liked by your colleagues?
19. Do you get your things done because they like you?
20. Whom do you share with if you complete your work?
21. How did you deal with the conflicts?
22. DO you to be busy always are free?
23. How do you manage things on a typical day?
24. What will you do if there are many projects due at a time?
25. Do your colleagues approach you for any help? Example.
26. How do you thank your colleague for their help?
27. Do you feel that you need to be recognized for your work?
28. If there are many distractions beside you while you are working what
will you do?
29. Are you focused? Example.
30. If your voice is ugly in the group what will you do in the discussions?
31. Will you according to the plan or according to the flow.
32. Will you take decisions according to the facts or indigenous?
33. If all the things are equal will you like to be in the group or take the
lead position?
34. Will you like to instruct someone?

Difference between "C structure" and "C++ structure"?

1.The defination of the structure in C is limited to within the module and cannot be initialized outside its scope. Where as in C++ you can initialize the objects anywhere within the boundaries of the project.
2. By default C structure members are Public and C++ structure members are private.
3. C does not support Methods inside structure but C++ does.
4. In C++ structure we can add functions but in C structure we can...t.
5. In C++, structure behaves like class like can add function, and can use properties on class as inheritance, virtual,etc, But in C, structure we can have only data member but not functions.

What is the difference between an object and a class?

Class and Objects are diff but related concepts. Every object belongs to the class and every class has a one or more related objects.

Class is:
1. A Class is static.
2. A class combination of data (called data members) and functions (called member functions).
3. Class is a user defined data type with data members and member functions.
4. Class defines object.
5. One class can define any no of Object.
6. Class is a template (type) or blue print its state how objects should be and behave.

Object is:
1. Object is an instance of a class while a class can have many objects.
2. Object is a dynamic.
3. Objects are the basic runtime entities in an object oriented system.
4. Data and function which combine into a single entity is called object.
5. Objects are instances of classes which identifies the class properties.
6. Object can't define classes.
7. Object can be created and destroyed as your necessity.
8. Object is defined as a s/w construct which binds data and logic or methods (functions) both.

What's the difference between the keywords struct and class?

Class is defined as-
1. Class is a successor of Structure. By default all the members inside the class are private.
2. Class is the advanced and the secured form of structure.
3. Classes are reference typed.
4. Class can be inherited.
5. In Class we can initilase the variable during the declaration.
6. Class can not be declared without a tag at the first time.
7. Class support polymorphism.

Structure defined as :
1. In C++ extended the structure to contain functions also. All declarations inside a structure are by default public.
2. Structures contains only data while class bind both data and member functions.
3. Structure dosen't support the polymorphism, inheritance and initilization.
4. Structure is a collection of the different data type.
5. Structure is ovrloaded.
6. Structures are value type.
7. Structure can be declared without a tag at the first time

Friday, November 6, 2009

Accessing fixed memory locations

Embedded systems are often characterized by requiring the programmer to access a specific memory location. On a certain project it is required to set an integer variable at the absolute address 0x67a9 to the value 0xaa55.
Example:
int *ptr;
ptr = (int *)0x67a9;
*ptr = 0xaa55;

A more obscure approach is:*(int * const)(0x67a9) = 0xaa55;

What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

The strcpy() function is designed to work exclusively with strings. It copies each byte of the source string to the destination string and stops when the terminating null character () has been moved.
On the other hand, the memcpy() function is designed to work with any type of data. Because not all data ends with a null character, you must provide the memcpy() function with the number of bytes you want to copy from the source to the destination.

What is the purpose of using stack?

The stack is the place where all the function`s local (auto) variables are created. The stack also contains some information used to call and return from functions.

A “stack trace” is a list of which functions have been called, based on this information. When you start using a debugger, one of the first things you should learn is how to get a stack trace.
The stack is very inflexible about allocating memory; everything must be deallocated in exactly the reverse order it was allocated in. For implementing function calls, that is all that’s needed. Allocating memory off the stack is extremely efficient. One of the reasons C compilers generate such good code is their heavy use of a simple stack.

There used to be a C function that any programmer could use for allocating memory off the stack. The memory was automatically deallocated when the calling function returned. This was a dangerous function to call; it’s not available anymore.

What is the heap?

The heap is where malloc(), calloc(), and realloc() get memory.
Getting memory from the heap is much slower than getting it from the stack. On the other hand, the heap is much more flexible than the stack. Memory can be allocated at any time and deallocated in any order. Such memory isn’t deallocated automatically; you have to call free().

Recursive data structures are almost always implemented with memory from the heap. Strings often come from there too, especially strings that could be very long at runtime. If you can keep data in a local variable (and allocate it from the stack), your code will run faster than if you put the data on the heap. Sometimes you can use a better algorithm if you use the heap—faster, or more robust, or more flexible. It’s a tradeoff.

If memory is allocated from the heap, it’s available until the program ends. That’s great if you remember to deallocate it when you’re done. If you forget, it’s a problem. A “memory leak” is some allocated memory that’s no longer needed but isn’t deallocated. If you have a memory leak inside a loop, you can use up all the memory on the heap and not be able to get any more. (When that happens, the allocation functions return a null pointer.) In some environments, if a program doesn’t deallocate everything it allocated, memory stays unavailable even after the program ends.

What is the purpose of realloc( )?

The function realloc(ptr,n) uses two arguments.the first argument ptr is a pointer to a block of memory for which the size is to be altered.The second argument n specifies thenew size.

The size may be increased or decreased.
If n is greater than the old size and if sufficient space is not available subsequent to the old region, the function realloc( )may create a new region and all the old data are moved to the new region.

What is the benefit of using const for declaring constants?

The benefit of using the const keyword is that the compiler might be able to make optimizations based on the knowledge that the value of the variable will not change. In addition, the compiler will try to ensure that the values won’t be changed inadvertently.

Of course, the same benefits apply to #defined constants. The reason to use const rather than #define to define a constant is that a const variable can be of any type (such as a struct, which can’t be represented by a #defined constant). Also, because a const variable is a real variable, it has an address that can be used, if needed, and it resides in only one place in memory

Is it better to use a macro or a function?

The answer depends on the situation you are writing code for. Macros have the distinct advantage of being more efficient (and faster) than functions, because their corresponding code is inserted directly into your source code at the point where the macro is called. There is no overhead involved in using a macro like there is in placing a call to a function. However, macros are generally small and cannot handle large, complex coding constructs. A function is more suited for this type of situation. Additionally,macros are expanded inline, which means that the code is replicated for each occurrence of a macro. Your code therefore could be somewhat larger when you use macros than if you were to use functions.

Thus, the choice between using a macro and using a function is one of deciding between the tradeoff of faster program speed versus smaller program size. Generally, you should use macros to replace small, repeatable code sections, and you should use functions for larger coding tasks that might require several lines of code.

What is static memory allocation and dynamic memory allocation?

Static memory allocation:
The compiler allocates the required memory space for a declared variable.By using the address of operator,the reserved address is obtained and this address may be assigned to a pointer variable.Since most of the declared variable have static memory,this way of assigning pointer value to a pointer variable is known as static memory allocation. Memory is assigned during compilation time.

Dynamic memory allocation:
It uses functions such as malloc( ) or calloc( ) to get memory dynamically.If these functions are used to get memory dynamically and the values returned by these functions are assingned to pointer variables, such assignments are known as dynamic memory allocation.memory is assined during run time.

DO-178B FAQS

1.What is DO-178B?
In the avionics industry, software was initially viewed as an inexpensive and more flexible way to extend the functionality of mechanical and analog-electrical systems. However, it was quickly realized that the usual statistical approaches to assess the safety and reliability would not work for flight-critical software. An alternative means of assessment, one that addressed design errors rather than component failure rates, was required. From this need, the first version of DO-178 was created. The current version of the guideline is DO-178B.

2.Which systems need to be certified under DO-178B?
Under the Global Aviation Traffic Management (GATM) agreement, all commercial airborne systems have to comply with Federal Aviation Administration (FAA) regulations for avionics and require DO-178B certification. In addition, all airborne military and space systems must also comply with DO-178B. All retrofits, as well as new airborne system designs, also require DO-178B certification. Note that GATM has international validity and applicability.

3.What are the main goals that are addressed by DO-178B?
• Develop objectives for the life-cycle processes
• Provide a description of the activities and design considerations for achieving those objectives
• Provide a description of the evidence indicating the objectives have been satisfied

4.What is RTCA and what role does it play in DO-178B?
"RTCA" is the Radio Technical Commission for Aeronautics, Inc. ( www.rtca.org). It plays an important role in defining guidelines for various aviation practices. It is not a government agency. The guidelines it produces are sometimes accepted as standards by the FAA ex. DO-178B FAA Advisory Circular AC20-115B establishes DO-178B as the accepted means of certifying all new aviation software.

5.Who are DERs?
DERs, Designated Engineering Representatives, are experienced engineers designated by the FAA to approve engineering data used for certification. All FAA projects must have an FAA representative assigned and a DER to review all submissions.
A DER is an independent specialist designated by the FAA as having authority to sign off on your project as a representative of the FAA.
A DER will eventually examine your documentation. It is good practice to get a DER involved at an early stage in your development. The DER may insist on witnessing portions of your software testing. A DER may insist on changes to documentation before signoff.

6.What do the DO-178B levels mean?
DO-178B software levels (A, B, etc.) are based on the potential of the software to cause safety-related failures identified in the system safety assessment. DO-178B has five levels of certification:
Level A: Software whose failure would cause or contribute to a catastrophic failure of the aircraft.
Level B: Software whose failure would cause or contribute to a hazardous/severe failure condition.
Level C: Software whose failure would cause or contribute to a major failure condition.
Level D: Software whose failure would cause or contribute to a minor failure condition.
Level E: Software whose failure would have no effect on the aircraft or on pilot workload.
Who determines which DO-178B level is required?
The level to which a particular system must be certified is selected by a process of failure analysis and input from the device manufacturers and the certifying authority (FAA or JAA), with the final decision made by the certifying authority.
Certification at any level automatically covers the lower-level requirement. Software certified at Level A can be used in any avionics application.

7.What levels of structural testing are required by DO-178B?
Three primary levels of structural testing concern most DO-178B projects:
SC: Statement Coverage. Means that every statement in the program has been invoked or used at least once. This is the most common use of the term code coverage}.
DC: Decision Coverage. Means that every point of entry and exit in the program has been invoked at least once and that each decision in the program has been taken on all possible (Boolean) outcomes at least once. Essentially, this means that every Boolean statement has been evaluated both TRUE and FALSE.
MCDC: Modified Condition Decision Coverage. Means that every point of entry and exit in the program has been invoked at least once, that every decision in the program has taken all possible outcomes at least once, and that each condition in a decision has been shown to independently affect that decision's outcome. Complex Booleans need to have truth tables developed to set each variable (inside a Boolean expression) to both TRUE and FALSE.