1 / 19

You can do more than what you think ……… If you believe you can

You can do more than what you think ……… If you believe you can. Important Mantra. Do not Panic if you get a question which you do not know. Relax and the best tool to attempt for the answer is try using your common sense… You will not believe 80% of them manages to answer correctly.

zody
Download Presentation

You can do more than what you think ……… If you believe you can

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. You can do more than what you think ………If you believe you can

  2. Important Mantra • Do not Panic if you get a question which you do not know. • Relax and the best tool to attempt for the answer is try using your common sense… • You will not believe 80% of them manages to answer correctly. • Do not forget the word ATTITUDE at any point of your life.

  3. Plan yourself • You are not the first • Maximum conversation time is 15-20 minutes • Make the interviewer bound to you never allow the reverse to happen….But do this is very carefully and swiftly. Do not do it abruptly… • And most of the questions are based on your previous answers….So the question paper is almost in your hands. • Please Do not overload yourself till the last minute…

  4. Links used • http://c-faq.com/~scs/cgi-bin/faqcat.cgi • http://www.techinterviews.com/c-interview-questions-and-answers-2 • http://zarrata.com/durofy/programming/10-major-differences-between-c-and-c/ • http://www.coolinterview.com/

  5. Simple but yet asked many a times as refresh questions • Programming language • Difference between Preprocessor, Compiler, Assembler, Linker and Interpreter • Difference between C, C++ and Java • Features of OOPS • Definition about each of them

  6. Frequently asked questions • What is the difference between an ARRAY and a LIST? • What is faster : access the element in an ARRAY or in a LIST? • Define a constructor - what it is and how it might be called (2 methods). • Describe PRIVATE, PROTECTED and PUBLIC the differences and give examples.

  7. What is a COPY CONSTRUCTOR and when is it called (this is a frequent question !)? • Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE. • What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

  8. You have two pairs: new() and delete() and another pair : malloc() and free(). Explain differences between eg. new() and malloc() • What is a callbyreference and callbyvalue? • Difference between calloc and malloc. what c in calloc stand for?

  9. Check list • 1. Declarations and Initializations • 2. Structures, Unions, and Enumerations • 3. Expressions • 4. Pointers • 5. Null Pointers

  10. 6. Arrays and Pointers • 7. Memory Allocation • 8. Characters and Strings • 9. Boolean Expressions and Variables • 10. C Preprocessor

  11. 11. ANSI/ISO Standard C • 12. Stdio • 13. Library Functions • 14. Floating Point • 15. Variable-Length Argument Lists

  12. Reference • malloc: malloc create the single block of given size by usercalloc: calloc creates multiple blocks of given sizeboth return void pointer(void *)so boh requires type castingmalloc: eg:int *p;p=(int*)malloc(sizeof(int)*5)above syntax tells that malloc occupies the 10 bytes memory and assign the address of first byte to Pcalloc: eg:p=(int*)calloc(5,sizeof(int)*5)above syntax tells that calloc occupies 5 blocks each of the 10 bytes memeory and assign the address of first byte of first block to P

  13. Other difference • the above answer is absolutely right,but the difference between calloc and malloc is that calloc also initialize the reserved memory block to zero rather than garbage value in case of malloc()

  14. 1. What is the difference between an ARRAY and a LIST? Array is collection of homogeneous elements.List is collection of heterogeneous elements. For Array memory allocated is static and continuous.For List memory allocated is dynamic and Random. Array: User need not have to keep in track of next memory allocation.List: User has to keep in Track of next location where memory is allocated. 2. What is faster : access the element in an ARRAY or in a LIST? • It’s array the reason is it continuous.

  15. 3. Define a constructor - what it is and how it might be called (2 methods). constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized. Ways of calling constructor: 1) Implicitly: automatically by complier when an object is created. 2) Calling the constructors explicitly is possible

  16. 4. You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc() 1.) “new and delete” are preprocessors while “malloc() and free()” are functions. [we dont use brackets will calling new or delete]. 2.) no need of allocate the memory while using “new” but in “malloc()” we have to use “sizeof()”. 3.) “new” will initlize the new memory to 0 but “malloc()” gives random value in the new alloted memory location [better to use calloc()].

  17. 5. Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE POLYMORPHISM : A phenomenon which enables an object to react differently to the same function call.in C++ it is attained by using a keyword virtualexamplepublic class SHAPE{public virtual void SHAPE::DRAW()=0;}Note here the function DRAW() is pure virtual which means the sub classes must implement the DRAW() method and SHAPE cannot be instatiated

  18. public class CIRCLE::public SHAPE{public void CIRCLE::DRAW(){// TODO drawing circle}}public class SQUARE::public SHAPE{public void SQUARE::DRAW(){// TODO drawing square}}

  19. now from the user class the calls would be like globallySHAPE *newShape; when user action is to drawpublic void MENU::OnClickDrawCircle(){newShape = new CIRCLE();} public void MENU::OnClickDrawCircle(){newShape = new SQUARE();} when user actually drawspublic void CANVAS::OnMouseOperations(){newShape->DRAW();} What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?virtual

More Related