Anda di halaman 1dari 97

MOCK PLACEMENT DRILL (21-22 September 2013) Technical Interview Questions (CSE/IT)

Sr

5 6 7

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25 26 27 28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47 48 49 50 51 52 53 54 55 56 57

58

59

60 61

62 63

64

65 66 67 68 69 70 71

72

73

74 75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100 101 102 103 104 105 106 107 108 109 110 111 112

113

114 115 116 117

118

119

120 121 122 123 124 125 126 127 128 129

130

131

132

133

134

135

136

137

138 139

140

141

142 143 144

145

146

147 148

149

150 151 152 153 154

155

156 157 158 159 160 161 162

163 164 165 166

167

168 169 170 171 172 173 174

175

176 177 178

179

180

181

182

183

184

185

186 187 188

189

190

191

192

193

194

195

196

197 198 199 200 201 202 203

204

205

206

207 208 209 210 211

212 213 214 215 216 217

218 219 220 221

222

223

224 225 226 227

228

229 230 231 232 233 234 235 236 237 238 239 240 241 242

243

244

245

246

247 248

249

250

251

252 253 254 255 256

257 258 259 260 261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290 291 292 293 294 295 296 297 298 299 300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

MOCK PLACEMENT DRILL (21-22 September 2013) Technical Interview Questions (CSE/IT)
Question (with answer) What is the difference between namespace and assembly? Ans. Namespace is a collection of different classes. whereas an assembly is the basic building blocks of the .net framework What is the difference between early binding and late binding? Ans. Calling a non-virtual method, decided at a compile time is known as early binding. Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding. What is Intermediate Language? Ans. Microsoft Intermediate Language(MSIL or IL) is the CPU -independent instruction set into which .Net framework programs are compiled. It contains instructions for loading, storing initializing, and calling methods on objects. What is Common Language Runtime? Ans. CLR also known as Common Language Run time provides a environment in which program are executed, it activate object, perform security check on them, lay them out in the memory, execute them and garbage collect them. What is common Type System? Ans. The common type system is a rich type system, built into the common language runtime, which supports the types and operations found in most programming language. What namespace does the webpage belong in the .NET framework class hierarchy? Ans. System.Web.UI.Page What are the advantages of an assembly? Ans. Increased performance. Better code management and encapsulation. It also introduces the n-tier concepts and business logic. What is the difference between dataset.clone and dataset.copy? Ans. Dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesnt copy the data. Dataset.copy, copies both the dataset structure and the data What is the use of Internal Keyword? Ans. Internal keyword is one of the access specifier available in .Net framework , that makes a type visible in a given assembly , for e.g : a single dll can contain multiple modules. How do I create frames? What is a frameset? Frames allow an author to divide a browser window into multiple (rectangular) regions. Multiple documents can be displayed in a single window, each within its own frame. Graphical browsers allow these frames to be scrolled independently of each other, and links can update the document displayed in one frame without affecting the others. You can't just "add frames" to an existing document. Rather, you must create a frameset document that defines a particular combination of frames, and then display your content documents inside those frames. The frameset document should also include alternative non-framed content in a NOFRAMES element. The HTML 4 frames model has significant design flaws that cause usability problems for web users. Frames should be used only with great care.

How can I include comments in HTML? Technically, since HTML is an SGML application, HTML uses SGML comment syntax. However, the full syntax is complex, and browsers don't support it in its entirety anyway. Therefore, use the following simplified rule to create HTML comments that both have valid syntax and work in browsers: An HTML comment begins with "<!--", ends with "-->", and does not contain "--" or ">" anywhere in the comment. How comfortable are you with writing HTML entirely by hand? Very. I dont usually use WYSIWYG. The only occasions when I do use Dreamweaver are when I want to draw something to see what it looks like, and then Ill usually either take that design and hand-modify it or build it all over again from scratch in code. I have actually written my own desktop HTML IDE for Windows (its called Less Than Slash) with the intention of deploying it for use in web development training. If has built-in reference features, and will autocomplete code by parsing the DTD you specify in the file. That is to say, the program doesnt know anything about HTML until after it parses the HTML DTD you specified. This should give you some idea of my skill level with HTML. What is a DOCTYPE? Which one do I use? According to HTML standards, each HTML document begins with a DOCTYPE declaration that specifies which version of HTML the document uses. Originally, the DOCTYPE declaration was used only by SGML-based tools like HTML validators, which needed to determine which version of HTML a document used (or claimed to use). Today, many browsers use the document's DOCTYPE declaration to determine whether to use a stricter, more standards-oriented layout mode, or to use a "quirks" layout mode that attempts to emulate older, buggy browsers. Can I nest tables within tables? Yes, a table can be embedded inside a cell in another table. Here's a simple example: How can we embed Audio in HTML 5? TML 5 comes with a standard way of embedding audio files. Supported audio formats are MP3, Wav and Ogg. <audio controls> <source src="jamshed.mp3" type="audio/mpeg"> Your browser doesn't support audio embedding feature. </audio> What are the different types of storage in HTML 5? HTML 5 has the capability to store data locally. Previously, it was done with the help of cookies. The exciting thing about this storage is that it's fast as well as secure. There are two different objects which can be used to store data: localStorage object stores data for a longer period of time even if the browser is closed. sessionStorage object stores data for a specific session.

What are the new Form Elements introduced in HTML 5? There are a number of new form elements that have been introduced in HTML 5 as follows: datalist datetime output keygen date month week time number range email url What is the difference between HTML 5 Application Cache and regular HTML Browser Cache? One of the key features of HTML 5 is "Application Cache" that enables us to make an offline version of a web application. It allows to fetch few or all of website contents such as HTML files, CSS, images, JavaScript, etc. locally. This feature speeds up the site performance. This is achieved with the help of a manifest file defined as follows: <!doctype html> <html manifest="example.appcache"> ..... </html> As compared with traditional browser caching, it's not compulsory for the user to visit website contents to be cached. How do I display the current date or time in my document? With server-side includes. Ask your webmaster if this is supported, and what the exact syntax is for your server. But this will display the local time on the server, not for the client. And if the document is cached, the date will of course be incorrect after some time. JavaScript can be used to display the local time for the client, but as most people already have one or more clocks on their screen, why display another one? How do I get my visitor's e-mail addresses? You can't. Although each request for a document is usually logged with the name or address of the remote host, the actual username is almost never logged as well. This is mostly because of performance reasons, as it would require that the server uses the ident protocol to see who is on the other end. This takes time. And if a cache proxy is doing the request, you don't get anything sensible. In Netscape 2.0, it was possible to automatically submit a form with a mailto as action, using Javascript. This would send e-mail to the document's owner, with the address the visitor configured in the From line. Of course, that can be "mickey.mouse@disney.com". This is fixed in Netscape 2.01. The most reliable way is to put up a form, asking the visitor to fill in his e-mail address. If you offer him something in return, he will most likely do it. Is there a way to get indexed better by the search engines? Yes. Put these two statements in the <HEAD> part of your documents: <META NAME="keywords" CONTENT="keyword keyword keyword keyword"> <META NAME="description" CONTENT="description of your site">

Should I use lower case or upper case for tags? Tags are case insensitive, so it doesn't matter. This is just a matter of style. Many people prefer upper case, as it makes the tags "stand out" better amongst the text. Should I put quotes around attribute values or not? It depends. It is never wrong to use them, but you don't have to if the attribute value consists only of letters, digits, periods and/or hyphens. This is explained in the HTML 2.0 specs. Oh, and keep in mind that if you use double quotes, you should escape any quotes inside the value with "&quot;" so you don't accidentally terminate the value prematurely. How do I get a button which takes me to a new page? This is done with a small form: <FORM ACTION="http://url.you.want.to.go.to/" METHOD=GET> <INPUT TYPE=submit VALUE="Text on button" NAME=foo> </FORM> Which tag is used to display a webpage inside another webpage in HTML? Iframe HTML Form Events ___________, fires the moment that the element loses focus. -onblur What is cell padding? -Used to separate cell walls from their contents. What is the difference between XML and HTML? Define graph matrix and connection matrix. Answer: Graph matrix: A graph matrix is a square matrix whose size(i.e., number of rows and columns) is equal to the number of nodes on the flow graph. Each row and column corresponds to an identified node, and matrix entries correspond to connections (an edge) between nodes. Connection matrix: In connection matrix, each letter has been replaced with a 1, indicating that a connection exists (zeros have been excluded for clarity). Name any Maintenance Model. Answer: Quick-fix Model: This is the simplest model used for the maintenance of the software. In this model changes at the code level are made as early as possible without anticipating future maintenance problems. What is the difference between software engineering and system engineering? Answer: Software Engineering - is concerned with all aspects of computer based systems development including hardware, software and process engineering. System Engineering - are involves in system specification architectural design intergration and deployment. What is winwinspiral model? Answer: Winwin spiral model defines a set of negotiation activities at the beginning of each pass around the spiral. The best negotiations strive for a win-win result. What do you mean by the term Hybrid Design? Answer: Hybrid design: Pure top-down or pure bottom up approaches are often not practical therefore hybrid approach which combines the above two approaches is often used

What is stepwise refinement? Answer: -Stepwise Refinement is a top-down design strategy originally proposed by Niklaus Wirth. A program is developed by successively refining levels of procedural detail. A hierarchy is developed by decomposing a macroscopic statement of function in a stepwise fashion until programming language statements are reached. What is the fourth maturity level of CMM? Answer: Managed (maturity level 4)-At this level, the organization sets quantitative quality goals for both software products and processes. Productivity and quality are measured for important software process activities across all projects as part of an organizational measurement program. The software process capability at level 4 organizations can be summarized as predictable. Define cyclomatic complexity Answer: Cyclomatic complexity is a software metric that provides a quantitative measuer of the logical complexity of a program. What is Data Dictionary? Answer: Data dictionary is a storehouse of data giving information about data. It is a list of terms and their definition for all data items and data files of a system. A data dictionary contains descriptions and definitions concerning the data structure, data elements, their interrelationships and other characteristics of a system. Explain Equivalence Class Partitioning. Answer: It is a technique in black box testing. It is designed to minimize the number of test cases by dividing tests in such a way that the system is expected to act the same way for all tests of each equivalence partition. Test inputs are selected from each class. Every possible input belongs to one and only one equivalence partition." What is reverse engineering? Answer: It is a process of analysing software with a view to understanding its design and specification. - In reverse engineering, source code and executable code are the input. - It may be part of a re-engineering process but may also be used to re- specify a system for re-implementation. What is meant by loop testing? Answer: Loop testing is a white box testing techniques that focuses exclusively on the validity of loop constructs. This technique can be applied to simple loops, nested loops, concatenated loops and unstructured loops.

What is adaptive maintenance? Answer: Adaptive maintanence is the maintenance to adapt software to a different operating environment. It involves changing a system so that it operates in a different environment from its initial implementation. Define Throwaway Prototyping? Answer: Throw-Away Prototyping: Also called close ended prototyping. Throwaway or Rapid Prototyping refers to the creation of a model that will eventually be discarded rather than becoming part of the final delivered software. What is white box testing? Answer: White box testing is a test case design method that uses the control structure of the procedural design to derive test cases. It is otherwise called as structural testing

What are the categories of software? Answer:System software, Application software, embedded software, Web Applications, Artificial Intelligence software, scientific software.

What is verification and validation? Answer: Verification refers to the set of activities that ensure that software correctly implements a specific function. Validation refers to the set of activities that ensure that the software that has been built is traceable to customer requirements. What is SDLC ? Answer: Software cycle deals with various parts and phases from planning to testing and deploying. All these activities are carried out in different ways, as per the needs. Each way is known as a Software Development Lifecycle Model (SDLC)

When is a switch statement better than multiple if statements? Answer: A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type. How we can print "Hello World" without using semicolon in c program Answer: if we write the printf function inside the if block structure eg : if(printf("Hello World")); what printf library function returns ? Answer: printf functions is having int return type which is used to return number of elements which is printed which header file is used to define a function in c programming which can have variable number of arguments Answer: stdarg.h how we can achieve run time polymorphism in C++ Answer: we can achieve run time polymorphism with the use of virtual function in base class in C++ what is dangling pointer? Answer: Dangling pointer is referred to that pointer which points to deallocated memory location Library function which is used to convert string value into int value Answer: atoi () , the function is defined in header file is stdlib.h How the overriding is different than overloading ? Answer: Overriding is achieved using redefine the base class into derived class but overloading is achieve using two or more functions with same name and different arguments Explain diamond problem of inheritance ? Answer: Diamond problem is ambiguity problem of hybrid inheritance, this ambiguity can be resolved using virtual base class what is significance of argc and argv in command line arguments ? Answer: argc stands for number of arguments including executable file name, argv stands for argument vector(set of input strings) why we create reference object in the argument of copy contructor ? Answer: if we create copy constructor without reference ,in that it will result into infinite execution of copy constructor.so to avoid infinite execution, we create reference object in the argument of copy constructor can we call any class member function without using object of the class Answer: Yes, we can call static member function without using object.static member function can be executed with the help of class itself. Give 3 uses of scope resultion operator ( :: ) in C++ Answer: 1) to define member function of the outside the class 2)to define static data member outside the class 3) to access static member function with classname 4) to access global variable what is importance of this pointer Answer: this object always refers to self object.which is used to access data member as well as this object is used to return self object from the member function write the statements which are used to swap two variables without using 3rd variable and without using airthematic operators Answe

Explain the polymorphism? Answer: Polymorphism is the property of C++ , by which we can use same name functions/operators with different purposes.compile time polymorphism(functions overloading,operator overloading ) run time polymorphism(virtual function) how can we change the const variable value in the program? Answer: We can change the const variables value with the help of pointers only. how type conversion is different than type casting ? Answer: Generally type casting works with basic data types like int to float or vice versa, Type casting mathod is not applicable with user defined data types, so type conversion method is used with user defined data types conversion(like basic to user defined, user defined to basic and user defined 1 to user defined 2) list the operators which cant be overloaded ? Answer: 1) :: 2) .* 3). 4)sizeof 5) ?: which operator can replace the if statement in the program? Answer: conditional operator ( ?:) what is the role of abstract class in c++ Answer: Abstract class,is the class which is having minimum one pure virtual function inside its definition.Abstract class is no having any object with it. what is the return type of malloc and calloc function and in which header file they are defined Answer: return type of memory functions are generic pointer(Void *) and they are defined in stdlib.h header file what is use of sscanf() function Answer: sscanf function is used to convert string value into any other data type value based on the format specifer? which is having more precedence between pre increment and post increment operator Answer: post increment operator When is a switch statement better than multiple if statements? Answer: A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type. What is the output of printf("%d")? Answer: When we write printf("%d",x); this means compiler will print the value of x. But as here, there is nothing after %d so compiler will show in output window garbage value. What is the difference between "calloc(...)" and "malloc(...)"? Answer: . calloc(...) allocates a block of memory for an array of elements of a certain size. By default the block is initialized to 0. The total number of memory allocated will be (number_of_elements * size).malloc(...) takes in only a single argument which is the memory required in bytes. malloc(...) allocated bytes of memory and not blocks of memory like calloc(...). What is the difference between "printf(...)" and "sprintf(...)"? Answer: sprintf(...) writes data to the character array whereas printf(...) writes data to the standard output device. How to reduce a final size of executable? Answer: Size of the final executable can be reduced using dynamic linking for libraries. What does static variable mean? Answer: 1. If you declare within a function It retains the value between function calls 2.If it is declared for a function name: By default function is extern..so it will be visible from other files if the function declaration is as static..it is invisible for the outer files 3. Static for global variables: By default we can use the global variables from outside files If it is static global..that variable is limited to with in the What are the advantages of a macro over a function? Answer: Macro gets to see the Compilation environment, so it can expand __ __TIME__ __FILE__ #defines. It is expanded by the preprocessor. What are the differences between malloc() and calloc()? Answer: First, is in the number of arguments. malloc() takes a single argument(memory required in bytes), while calloc() needs 2 arguments(number of variables to allocate memory, size in bytes of a single variable). Secondly, malloc() does not initialize the memory allocated, while calloc() initializes the allocated memory to ZERO.

What is the difference between strings and character arrays? Answer: A major difference is: string will have static storage duration, whereas as a character array will not, unless it is explicity specified by using the static keyword What is the difference between const char* p and char const* p? Answer: In const char* p, the character pointed by p is constant, so u cant change the value of character pointed by p but u can make p refer to some other location. In char const* p, the ptr p is constant not the character referenced by it, so u cant make p to reference to any other location but u can change the value of the char pointed by p.

What is hashing? Answer: To hash means to grind up, and thats essentially what hashing is all about. The heart of a hashing algorithm is a hash function that takes your nice, neat data and grinds it into some random-looking integer. The idea behind hashing is that some data either has no inherent ordering (such as images) or is expensive to compare (such as images). If the data has no inherent ordering, you cant perform comparison searches. Can static variables be declared in a header file? Answer: You cant declare a static variable without defining it as well (this is because the storage class modifiers static and extern are mutually exclusive). A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.

Can a variable be both const and volatile? Answer: Yes. The const modifier means that this code cannot change the value of the variable, but that does not mean that the value cannot be changed by means outside this code. Can include files be nested? Answer: Yes. Include files can be nested any number of times. As long as you use precautionary measures , you can avoid including the same file twice. In the past, nesting header files was seen as bad programming practice, because it complicates the dependency tracking function of the MAKE program and thus slows down compilation. Many of todays popular compilers make up for this difficulty by implementing a concept called precompiled headers, in which all headers and associated dependencies are stored in a precompiled state. What is a null pointer? Answer: There are times when its necessary to have a pointer that doesnt point to anything. The macro NULL, defined in , has a value thats guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*. Some people, notably C++ programmers, prefer to use 0 rather than NULL. The null pointer is used in three ways: 1) To stop indirection in a recursive data structure 2) As an error value 3) As a sentinel value

What is the difference between text and binary modes? Answer: Streams can be classified into two types: text streams and binary streams. Text streams are interpreted, with a maximum length of 255 characters. With text streams, carriage return/line feed combinations are translated to the newline n character and vice versa. Binary streams are uninterrupted and are treated one byte at a time with no translation of characters. Typically, a text stream would be used for reading and writing standard text files, printing output to the screen or printer, or receiving input from the keyboard. A binary text stream would typically be used for reading and writing binary files such as graphics or word processing documents, reading mouse input, or reading and writing to the modem. What is static memory allocation and dynamic memory allocation? Answer: 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. When should a far pointer be used? Answer: Sometimes you can get away with using a small memory model in most of a given program. There might be just a few things that dont fit in your small data and code segments.

How are pointer variables initialized? Answer: Pointer variable are initialized by one of the following two ways - Static memory allocation - Dynamic memory allocation

What is the difference between arrays and pointers? Answer: Pointers are used to manipulate data using the address. Pointers use * operator to access the data pointed to by them - Arrays use subscripted variables to access and manipulate data. Array variables can be equivalently written using pointer expression. Is using exit() the same as using return? Answer: No. The exit() function is used to exit your program and return control to the operating system. The return statement is used to return from a function and return control to the calling function. If you issue a return from the main() function, you are essentially returning control to the calling function, which is the operating system. In this case, the return statement and exit() function are similar.

What is indirection? Answer: If you declare a variable, its name is a direct reference to its value. If you have a pointer to a variable, or any other object in memory, you have an indirect reference to its value. What is modular programming? Answer: If a program is large, it is subdivided into a number of smaller programs that are called modules or subprograms. If a complex problem is solved using more modules, this approach is known as modular programming. How many levels deep can include files be nested? Answer: Even though there is no limit to the number of levels of nested include files you can have, your compiler might run out of stack space while trying to include an inordinately high number of files. This number varies according to your hardware configuration and possibly your compiler.

What is an lvalue? Answer: An lvalue is an expression to which a value can be assigned. The lvalue expression is located on the left side of an assignment statement, whereas an rvalue is located on the right side of an assignment statement. Each assignment statement must have an lvalue and an rvalue. The lvalue expression must reference a storable variable in memory. It cannot be a constant. Differentiate between an internal static and external static variable? Answer: An internal static variable is declared inside a block with static storage class whereas an external static variable is declared outside all the blocks in a file.An internal static variable has persistent storage, block scope and no linkage.An external static variable has permanent storage,file scope and internal linkage. What is a void pointer? Answer: A void pointer is a C convention for a raw address. The compiler has no idea what type of object a void Pointer really points to. If you write int *ip; ip points to an int. If you write void *p; p doesnt point to a void! When should a type cast not be used? Answer: A type cast should not be used to override a const or volatile declaration. Overriding these type modifiers can cause the program to fail to run correctly. A type cast should not be used to turn a pointer to one type of structure or data type into another. In the rare events in which this action is beneficial, using a union to hold the values makes the programmers intentions What is a static function?clearer. Answer: A static function is a function whose scope is limited to the current source file. Scope refers to the visibility of a function or variable. If the function or variable is visible outside of the current source file, it is said to have global, or external, scope. If the function or variable is not visible outside of the current source file, it is said to have local, or static, scope. Differentiate between a linker and linkage? Answer: A linker converts an object code into an executable code by linking together the necessary build in functions. The form and place of declaration where the variable is declared in a program determine the linkage of variable. When is a switch statement better than multiple if statements? Answer: A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type. What is the difference between declaration and definition? Answer: The declaration tells the compiler that at some later point we plan to present the definition of this declaration.The definition contains the actual implementation. What are the advantages of inheritance? Answer: It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional. What are inline functions and when they can prove beneficial? Answer: inline functions are used to insert the code of a called function at the point where the function is called. If done carefully, this can improve the applications performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables What is a template? Answer: Templates allow creating generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types What is the difference between new and malloc() Answer: new and delete are preprocessors while malloc() and free() are functions.no need of allocate the memory while using new but in malloc() we have to use sizeof(). new will initlize the new memory to 0 but malloc() gives random value in the new alloted memory location [better to use calloc()] What is namespace? Answer: Namespaces allow us to group a set of global classes, objects and/or functions under a name. To say it somehow, they serve to split the global scope in sub-scopes known as namespaces. What is the word you will use when defining a function in base class to allow this function to be a polimorphic function? Answer: virtual What is a scope resolution operator? Answer: A scope resolution operator (::), can be used to define the member functions of a class outside the class. Why are arrays usually processed with for loop? Answer: The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a counter, incrementing from 0 to a.length -1That is exactly what a loop does. What is the difference between macro and inline? Answer: Inline follows strict parameter type checking, macros do not.Macros are always expanded by preprocessor, whereas compiler may or may not replace the inline definitions. Name some pure object oriented languages? Answer: Smalltalk, Java,Effel,Sather

How can we access protected and private members of a class? Answer: In the case of members protected and private, these could not be accessed from outside the same class at which they are declared. This rule can be transgressed with the use of the friend keyword in a class, so we can allow an external function to gain access to the protected and private members of by a class What do you mean early binding? Answer: Early binding refers to the events that occur at compile time. Early binding occurs when all information needed to call a function is known at compile time. Examples of early binding include normal function calls, overloaded function calls, and overloaded operators. The advantage of early binding is efficiency In the derived class, which data member of the base class are visible? Answer: In the public and protected sections. What is a dangling pointer? Answer: A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed. What are the defining traits of an object-oriented language? Answer: The defining traits of an object-oriented langauge are: encapsultaion,inheritance, polymorphism What is the need for a Virtual Destructor ? Answer: Destructors are declared as virtual because if do not declare it as virtual the base class destructor will be called before the derived class destructor and that will lead to memory leak because derived classs objects will not get freed.Destructors are declared virtual so as to bind objects to the methods at runtime so that appropriate destructor is called What is the Standard Template Library (STL)? Answer: A library of container templates approved by the ANSI committee for inclusion in the standard C++ specification.A programmer who then launches into a discussion of the generic programming model, iterators, allocators, algorithms, and such, has a higher than average understanding of the new technology that STL brings to C++ programming Are there any new intrinsic (built-in) data types? Answer: Yes. The ANSI committee added the bool intrinsic type and its true and false value keywords. What is difference between class and sructure Answer: In class data memebrs are private but in structure they are public Why we create NULL pointers Answer: So that pointer should not point to any random address When is a template a better solution than a base class? Answer: When you are designing a generic class to contain or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unknown (thus, the generosity) to the designer of the container or manager class. Why we use file handling Answer: To store data pemanently What are run time errors Answer: When there is a problem in logic of program How you can solve run time error Answer: By using exception handling Which function is used to position back from the end of file object? Answer: seekg() Which member function is used to determine whether the stream object is currently associated with a file? Answer: is_open() What is a stream? Answer: A stream is a continuous series of bytes that flow into or out of your program. Input and output from devices such as the mouse, keyboard, disk, screen, modem, and printer are all handled with streams. What is the difference between text and binary modes Answer: Text streams are interpreted, with a maximum length of 255 characters. With text streams, carriage return/line feed combinations are translated to the newline \n character and vice versa. Binary streams are uninterpreted and are treated one byte at a time with no translation of characters. Typically, a text stream would be used for reading and A binary text stream would typically be used for reading and writing binary files such as graphics or word processing documents, reading mouse input, or reading and writing to the modem.writing standard text files, printing output to the screen or printer, or receiving input from the keyboard. How do you find out if a linked-list has an end? Answer: You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower. If that is the case, then you will know the linked-list is a cycle. What is the difference between realloc() and free()? Answer: The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block

What is the difference between declaration and definition? What is the difference between declaration and definition? Answer: The declaration tells the compiler that at some later point we plan to present the definition of this declaration. E.g.: void stars () //function declaration The definition contains the actual implementation. E.g.: void stars () // declarator { for(int j=10; j > =0; j--) //function body cout << *; cout << endl What are the advantages of inheritance? Answer: It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional. Why are arrays usually processed with for loop? Answer: The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a counter, incrementing from 0 to a.length -1. That is exactly what a loop does What problems might the following macro bring to the application? #define sq(x) x*x Anything wrong with this code? T *p = new T[10]; delete p; Everything is correct, Only the first element of the array will be deleted, The entire array will be deleted, but only the first element destructor will be called. Anything wrong with this code? T *p = 0; delete p; Answer: Yes, the program will crash in an attempt to delete a null pointer. What does extern mean in a function declaration? Answer: Using extern in a function declaration we can make a function such that it can used outside the file in which it is defined. An extern variable, function definition, or declaration also makes the described variable or function usable by the succeeding part of the current source file. This declaration does not replace the definition. The declaration is used to describe the variable that is externally defined. If a declaration for an identifier already exists at file scope, any extern declaration of the same identifier found within a block refers to that same object. If no other declaration for the identifier exists at file scope, the identifier has external linkage. What can I safely assume about the initial values of variables which are not explicitly initialized? Answer: It depends on complier which may assign any garbage value to a variable if it is not initialized. What is the difference between char a[] = string; and char *p = string;? Answer: In the first case 6 bytes are allocated to the variable a which is fixed, where as in the second case if *p is assigned to some other value the allocate memory can change. Whats the auto keyword good for? Answer: Not much. It declares an object with automatic storage duration. Which means the object will be destroyed at the end of the objects scope. All variables in functions that are not declared as static and not dynamically allocated have automatic storage duration by default. What does extern mean in a function declaration? Answer: It tells the compiler that a variable or a function exists, even if the compiler hasnt yet seen it in the file currently being compiled. This variable or function may be defined in another file or further down in the current file

Are there any new intrinsic (built-in) data types? Answer: The ANSI committee added the bool intrinsic type and its true and false value keywords Describe run-time type identification. Answer: The ability to determine at run time the type of an object by using the typeid operator or the dynamic_cast operato In C++, what is the difference between method overloading and method overriding? Answer: Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method ofthe thedefining base class. What are traits of an object-oriented language? Answer: The defining traits of an object-oriented langauge are: * encapsulation * inheritance * polymorphism What is the need for a Virtual Destructor ? Answer: Destructors are declared as virtual because if do not declare it as virtual the base class destructor will be called before the derived class destructor and that will lead to memory leak because derived classs objects will not get freed.Destructors are declared virtual so as to bind objects to the methods at runtime so that appropriate destructor is called. What is an accessor? Answer: An accessor is a class operation that does not modify the state of an object. The accessor functions need to be declared as const operations Define namespace. Answer: It is a feature in C++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions. What is a dangling pointer? Answer: A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed. What is a Null object? Answer: It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an object. What are proxy objects? Answer: Objects that stand for other objects are called proxy objects or surrogates. Name some pure object oriented language Answer: Smalltalk, Java, Eiffel, Sather. What is pure virtual function? Answer: A class is made abstract by declaring one or more of its virtual functions to be pure. A pure virtual function is one with an initializer of = 0 in its declaration In the derived class, which data member of the base class are visible? Answer: In the public and protected sections Name some major differences between C++ and Java. Answer: C++ has pointers; Java does not. Java is platformindependent; C++ is not. Java has garbage collection; C++ does not. Java does have pointers. In fact all variables in Java are pointers. The difference is that Java does not allow you to manipulate the addresses of the pointer

When is a switch statement better than multiple if statements? Answer: A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type. What data type can be used in switch statement? Answer: int, char, enum How 'int' and 'unsigned int' data type is different? Answer: Range is different int takes -32768 to +32767 and unsigned int takes 0 to 65535 Can Constructor of class be private? Answer: We wont make object some where else in code outside class. So no fun of making it private. How structure in C++ different from class? Answer: No difference other than default access specifiers of members; in struct it is default public and in class it is default private. Can local and global variables be same names? Answer: Yes; global variable access with scope resolution operator i.e. ::variablename What type of functions are nonmember functions of a class but are granted the same privileges as methods of the class. Answer: Friend Functions

The constructor that performs an initialization using another object of the same class is called as? Answer: Copy Constructor A class object can be static or public? That is, it can be created once, when the control reaches its declaration, and destroyed when the program terminates. Answer: Static In C++,Which keyword can you use with a variable so that when fuction is called by reference and still prevent the function from changing its value. Answer: const How many destructors can a class have? Answer: 1 Out of fgets() and gets() which function is safe to use and why? Answer: fgets() is safer than gets(), because we can specify a maximum input length. Neither one is completely safe, because the compiler cant prove that programmer wont overflow the buffer he pass to fgets ().

What do you mean by early binding? Answer: Early binding refers to the events that occur at compile time. Early binding occurs when all information needed to call a function is known at compile time. Examples of early binding include normal function calls, overloaded function calls, and overloaded operators. The advantage of early binding is efficiency. How many characters are recognized by ANSI C++? Answer: no limit The null character will take space of Answer: 1 byte Keywords support dynamic method of resolution is Answer: Virtual Destructor can have following number of argument Answer: 0 Name the operators that cannot be overloaded? Answer: sizeof, ., .*, .->, ::, ?: What is class invariant? Answer: A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and postconditions for all operations or member functions of the class. What is a dangling pointer? Answer: A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed. What do you mean by late binding? Answer: Late binding refers to function calls that are not resolved until run time. Virtual functions are used to achieve late binding. When access is via a base pointer or reference, the virtual function actually called is determined by the type of object pointed to by the pointer. What is a virtual destructor? Answer: The simple answer is that a virtual destructor is one that is declared with the virtual attribute. Whats the difference between these two declarations? Ans: struct x1 { }; typedef struct { } x2; Answer: The first form declares a structure tag; the second declares a typedef. The main difference is that the second declaration is of a slightly more abstract type.its users dont necessarily know that it is a structure, and the keyword struct is not used when declaring instances of it. Why doesnt this code: a[i] = i++; work? Answer: The subexpression i++ causes a side effect.it modifies is value.which leads to undefined behavior since i is also referenced elsewhere in the same expression.

Differentiate between a constant pointer and pointer to a constant? Answer: const char *p; //pointer to a const character. char const *p; //pointer to a const character. char * const p; //const pointer to a char variable. const char * const p; // const pointer to a const character.

How are structure passing in functions and returning implemented? Answer: When structures are passed as arguments to functions, the entire structure is typically pushed on the stack, using as many words as are required. Some compilers merely pass a pointer to the structure, though they may have to make a local copy to preserve pass-by-value semantics. Structures are often returned from functions in a location pointed to by an extra,compiler-supplied hidden argument to the function. Some older compilers used a special,static location for structure returns, although this made structurevalued functions non-reentrant, which ANSI C disallows.

Is the allocated space within a function automatically deallocated when the function returns? Answer: No pointer is different from what it points to .Local variables including local pointers variables in a function are deallocated automatically when function returns.,But in case of a local pointer variable ,deallocation means that the pointer is deallocated and not the block of memory allocated to it. Memory dynamically allocated always persists until the allocation is freed or the program terminates. What are the advantages of using array of pointers to string instead of an array of strings? Answer: i) Efficient use of memory. ii) Easier to exchange the strings by moving their pointers while sorting.

Are the expressions *ptr ++ and ++ *ptr same? Answer: No,*ptr ++ increments pointer and not the value pointed by it. Whereas ++ *ptr increments the value being pointed to by ptr.

What would be the equivalent pointer expression foe referring the same element as a[p][q][r][s] ? Answer: *( * ( * ( * (a+p) + q ) + r ) + s)

Are the variables argc and argv are always local to main? Answer: Yes they are local to main. Can main () be called recursively? Answer: Yes How is a file closed ? Answer: A file is closed using fclose() function Eg. fclose(fp); Where fp is a file pointer. What is the purpose of ftell ? Answer: The function ftell() is used to get the current file represented by the file pointer. ftell(fp); returns a long integer value representing the current file position of the file pointed by the file pointer fp.If an error occurs ,-1 is returned.

Difference between an array of pointers and a pointer to an array? Answer: Array of pointers 1- Declaration is: data_type *array_name[size]; 2-Size represents the row size. 3- The space for columns may be dynamically Pointers to an array 1-Declaration is data_type ( *array_name)[size]; 2-Size represents the column size.

Can a Structure contain a Pointer to itself? Answer: Yes such structures are called self-referential structures.

How many ways are there to initialize an int with a constant? Answer: There are two formats for initializers in C++ as shown in the example that follows. The first format uses the traditional C notation. The second format uses constructor notation. int foo = 123; int bar (123); What is an explicit constructor? Answer: A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. Its purpose is reserved explicitly for construction.

What do you mean by virtual methods? Answer: virtual methods are used to use the polymorphism feature in C++. Say class A is inherited from class B. If we declare say function f() as virtual in class B and override the same function in class A then at runtime appropriate method of the class will be called depending upon the type of the object. What modular programming? Answer: If a program is large, it is subdivided into a number of smaller programs that are called modules or subprograms. If a complex problem is solved using more modules, this approach is known as modular programming. What is a Null object? Answer: It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an object.

When is a switch statement better than multiple if statements? Answer: A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type. Specify the 2 library functions to dynamically allocate memory? Answer: malloc() and calloc() Which function reads at most next n-1 characters into the array and stops if a newline is encountered. Answer: fgets. Which function we use in order to find the current file position Answer: ftell. What is the difference between a structure and a union? Answer: The way memory is allocated What is the use of sprintf() Answer: used in strings just like printf() Why shouldn't I start variable names with underscores? Answer: Identifier names beginning with two underscores or an underscore followed by a capital letter are reserved for use by the compiler or standard library functions wherever they appear.

Is a default case necessary in a switch statement? Answer: No, but it is not a bad idea to put default statements in switch statements for error- or logic-checking purposes. For instance, the following switch statement is perfectly normal Can the last case of a switch statement skip including the break? Answer: ven though the last case of a switch statement does not require a break statement at the end, you should add break statements to all cases of the switch statement, including the last case. You should do so primarily because your program has a strong chance of being maintained by someone other than you who might add cases but neglect to notice that the last case has no break statement. What is the difference between goto and long jmp( ) and setjmp()? Answer: A goto statement implements a local jump of program execution, and the longjmp() and setjmp() functions implement a nonlocal, or far, jump of program execution. Generally, a jump in execution of any kind should be avoided because it is not considered good programming practice to use such statements as goto and longjmp in your program. Can an array be an lvalue? Answer: he answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: Can include files be nested? Answer: Yes. Include files can be nested any number of times. As long as you use precautionary measures , you can avoid including the same file twice. Which bit wise operator is suitable for checking whether a particular bit is on or off ? Answer: The bitwise AND operator. Which bit wise operator is suitable for turning off a particular bit in a number? Answer: The bitwise AND operator Can the sizeof operator be used to tell the size of an array passed to a function? Answer: No. There's no way to tell, at runtime, how many elements are in an array parameter just by looking at the array parameter itself. Remember, passing an array to a function is exactly the same as passing a pointer to the first element. This is a Good Thing. It means that passing pointers and arrays to C functions is very efficient. Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name? Answer: It's easier for a C compiler to generate good code for pointers than for subscripts. When is a null pointer used? Answer: To stop indirection in a recursive data structure.As an error value. When should the register modifier be used? Does it really help? Answer: The register modifier hints to the compiler that the variable will be heavily used and should be kept in the CPU's How can you determine the maximum value that a numeric variable can hold? Answer: The easiest way to find out how large or small a number that a particular type can hold is to use the values defined in the ANSI standard header file limits.h. What is operator promotion? Answer: If an operation is specified with operands of two different types, they are converted to the smallest type that can hold both values. The result has the same type as the two operands wind up having. What is the difference between declaring a variable and defining a variable? Answer: Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. What is the benefit of using const for declaring constants? Answer: 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. How do I determine whether a character is numeric, alphabetic, and so on? Answer: The header file ctype.h defines various functions for determining what class a character belongs to. What is a "locale"? Answer: A locale is a description of certain conventions your program might be expected to follow under certain circumstances. It's mostly helpful to internationalize your program. Is there a way to jump out of a function or functions? Answer: The standard library functions setjmp() and longjmp() are used to provide a goto that can jump out of a function or functions What is the difference between realloc() and free()? Answer: The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer What is the difference between declaration and definition Answer: The declaration tells the compiler that at some later point we plan to present the definition of this declaration .The definition contains the actual implementation.

In C++, what is the difference between method overloading and method overriding? 3 Answer: Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class What is the benefit of constructor? Answer: Constructor eases our task by assigning values to object data members at the time of their declaration. Define namespace. Answer: It is a feature in C++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions. What is the difference between class and structure in C++ ? Answer: There is only one difference i.e by default data members and member functions are public in structure and in class they are private. What is virtual class and friend class? Answer: Friend classes are used when two or more classes are designed to work together and need access to each other's implementation in ways that the rest of the world shouldn't be allowed to have. In other words, they help keep private things private. For instance, it may be desirable for class Database Cursor to have more privilege to the internals of class Database than main() has. What is the word you will use when defining a function in base class to allow this function to be a polimorphic function? Answer: Virtual What is an object? Answer: Object is a software bundle of variables and related methods. Objects have state and behavior. What do you mean by inline function? Answer: The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables What is multiple inheritance? Answer: A class can inherit properties from more than one class which is known as multiple inheritance What do you mean by reference variable in c++? Answer: A reference variable provides an alias to a previously defined variable. Data -type & reference-name = variable name What do you mean by implicit conversion? Answer: Whenever data types are mixed in an expression then c++ performs the conversion automatically. Here smaller type is converted to wider type. Example : in case of integer and float integer is converted into float type. what is the use of virtual destructor in c++? Answer: A destructor is automatically called when the object is destroyed. A virtual destructor in C++ is used primarily to prevent resource leaks by performing a clean-up of the object. what is difference between function overloading and operator overloading? Answer: A function is overloaded when same name is given to different function. While overloading a function, the return type of the functions need to be the same. What are the advantages of inheritance? Answer: Code reusability , Saves time in program development. What is a dynamic constructor? Answer: The constructor can also be used to allocate memory while creating objects. Allocation of memory to objects at the time of their construction is known as dynamic construction of objects.The memory is allocated with the help of the new operator. What is a scope resolution operator? Answer: A scope resolution operator (::), can be used to define the member functions of a class outside the class. What is this pointer? Answer: It is a pointer that points to the current object. This can be used to access the members of the current object with the help of the arrow operator. Can destructor be private? Answer: Yes destructors can be private. But according it is not advisable to have destructors to be private. What is the difference between a copy constructor and an overloaded assignment operator? Answer: A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class. How can we access protected and private members of a class? Answer: In the case of members protected and private, these could not be accessed from outside the same class at which they are declared. This rule can be transgressed with the use of the friend keyword in a class, so we can allow an external function to gain access to the protected members of a class. What do and youprivate mean by early binding? Answer: Early binding refers to the events that occur at compile time. Early binding occurs when all information needed to call a function is known at compile time. Examples of early binding include normal function calls, overloaded function calls, and overloaded operators. The advantage of early binding is efficiency.

Is it better to create a thread or a child process for doing a task? Why? Ans: Thread. Because threads share resources What is the difference between preemptive and non- preemptive scheduling? Ans: Preemptive Any process keeps control of CPU until it is finished Non preemptive a higher priority process takes away the CPU from a lower priority process that was using it How resource allocation graph can help to solve the deadlock problem? Ans: A cycle in graph means deadlock else not What is swapping? Ans: Moving out processes from the main memory to the backing store and from backing store to main memory. What is thrashing? Ans: when the system spends more time in paging than executing and the performance drops to almost zero is called paging. How paging helps to improve system performance? Ans: By paging only those pages are brought into memory that are required and those are removed which will not be required immediately. What is the need of process synchronization? Give a practical example Ans: Bank transaction. If one draws Rs. 100 and the other deposits Rs. 100 (in any order) then the resulting amount should the same as before the transactions. This can only be done if one reads the value after the other has finished. What is the reason behind calling a long term scheduler long term scheduler? Ans: Because it is called less frequently as compared to short term scheduler Differentiate between internal and external fragmentation. Ans: Internal when memory is wasted within a partition External when memory is wasted as a whole Calculate waiting time using SJF (preemptive) Ans: Student can give any example Which threading model is used in Windows? Ans: Many to many What is locality of reference? Ans: is a phenomenon describing the same value, or related storage locations, being frequently accessed Explain Belady's Anomaly. Ans: Even on increasing the number of frames the page fault increases but it should have decreased. What is a binary semaphore? What is its use? Ans: semaphore can have a value 0 or 1. It is used to solve critical section problem List the Coffman's conditions that lead to a deadlock. Ans: Mutual exclusion, hold and wait, no preemption and circular wait What is the Translation Lookaside Buffer (TLB)? Ans: Is a hardware cache memory that stores a part of the page table for faster reference When is a system in safe state? Ans: When allocation of resources to a requesting process will not lead to a deadlock What are local and global page replacements? Ans: GLOBAL REPLACEMENT: All pages in the system are viewed as a common pool LOCAL REPLACEMENT: Each process is assigned a pool of pages, termed the "working set." When a process needs a page, the page comes from its own pool.

What are demand-paging and pre-paging? Pre-paging bring into memory at one time all the pages that will be needed. Demand paging bring into memory those pages that are requested. What is cycle stealing? Cycle stealing is a method of accessing RAM without interfering with the CPU. It is similar to DMA for allowing I/O controllers to read or write RAM without CPU intervention What is busy waiting? Ans: When a process wastes CPU cycles in just checking on the value of semaphore variable that it is TRUE or FALSE What is the difference between a JDK and a JVM? JDK is Java Development Kit which is for development purpose and it includes execution environment also. But JVM is purely a run time environment and hence you will not be able to compile your source files using a JVM. What is the return type of a constructor? Are the constructors inherited? Can we make a constructor final? Constructors dont have any return type. Constructors are never inherited. And we cant create a final constructor. What is Exception chaining in Java? Exception chaining is a popular exception handling concept in Java, where another exception is thrown in response of an exception and creating a chain of Exceptions. This technique mostly used to wrap a checked exception into an unchecked or RuntimeException. By the way if you are throwing new exception due to another exception then always include original exception so that handler code can access root cause by using methods like getCause() and initCause(). What is difference in final, finalize and finally keyword in Java? Another classic interview question in core Java, this was asked to one of my friend on his telephonic interview for core Java developer with Morgan Stanley. final and finally are keyword, while finalize is method. final keyword is very useful for creating a Immutable class in Java By making a class final, we prevent it from being extended, similarly by making a method final, we prevent it from being overridden,. On the other hand, finalize() method is called by garbage collector, before that object is collected, but this is not guaranteed by Java specification. finally keyword is the only one which is related to error and exception handling and you should always have finally block in production code for closing connection and resources. Can there be an abstract class with no abstract methods in it? Yes, there can be an abstract class without abstract methods. What is the difference between private, protected, and public? Public: accessible to all classes Private: accessible only to the class to which they belong Protected: accessible to the class to which they belong and any subclasses. Define static variable, instance variable and local variable. Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and it will be destroyed when the method has completed. Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded. Static or class variables are variables declared with in a class, outside any method, with the static keyword. Difference between Swing and Awt? AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.

What do you mean by platform independence? What is the difference between platform-independence and portability? Platform independence means that we can write and compile the java code in one platform (eg Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc). Portability is the ability to execute a program in any platform by either making some changes on it and recompiling where as platform-independence is to execute a program anywhere without recompiling it. What's the difference between the methods sleep() and wait() The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread. What is Singleton class? Singleton class control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes. What is the difference between an Interface and an Abstract class? An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods. 3. Describe synchronization in respect to multithreading? With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors. What is difference between Checked and Unchecked Exception in Java ? This is another popular Java Exception interview question appears in almost all level of Java interviews. Main difference between Checked and Unchecked Exception lies in there handling. Checked Exception requires to be handled at compile time using try, catch and finally keywords or else compiler will flag error. This is not a requirement for Unchecked Exceptions. Also all exceptions derived from java.lang.Exception classes are checked exception, exception those which extends RuntimeException, these are known as unchecked exception in Java. What is difference between throw and throws keyword in Java? One more Java Exception interview questions from beginners kitty. throw and throws keyword may look quite similar, especially if you are new to Java programming and haven't seen much of it. Though they are similar in terms that both are used in Exception handling, they are different on how and where they are used in code. throws keyword is used in method signature to declare which checked exception method can throw, you can also declare unchecked exception, but that is not mandatory by compiler. This signifies lot of things like method is not going to handle Exception instead its throwing it, if method throws checked Exception then caller should provide compile time exception handling etc. On the other hand throw keyword is actually used to throw any Exception. String objects are immutable what do you mean by this statement? The String class is immutable, so that once it is created a String object cannot be changed. Since String is immutable it can safely be shared between many threads ,which is considered very important for multithreaded programming.

What is an Iterator? How it is different from ListIterator? Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator. Using iterator we can move or traverse only in the forward direction but listIterator proides the methods to traverse the collection in both forward and backward directions. Is it possible to override the main method? NO, because main is a static method. A static method can't be overridden in Java. Can we declare the main() method as public static final void main(String arr[])? Yes. How can a dead thread be restarted? A dead thread cannot be restarted. Can we overload a static method with a non-static method? Static methods cant be overloaded with non-static methods but static methods can be overloaded with static methods. The basic requirement is to change the parameters. Parent class reference variable can hold the child class object but child class reference variable can not hold the parent class object. Why? class A{} class B extends A{} then; Aa = new B(); // valid B b = new A(); //invalid When a subclass extends a superclass, it can also have additional attributes and methods not existing in the superclass. As the reference variable determines what methods you can use on it, a variable of a subclass type can hence expose more operations available than the superclass has implemented. That's why a variable of a subclass type can't reference an instance of a superclass. Can we define a class within a constructor? What will happen if we define a static nested class in a constructor? Yes we can define a non-static class within a constructor. But we can not define a static (nested )class within a constructor. It will result in a compile time error. Can we declare and use a private constructor in any class? Yes, but we can not create the object of that class in any other class. Its object can be created only within that class.

When should I use abstract classes and when should I use interfaces? Use Interfaces when You see that something in your design will change frequently. If various implementations only share method signatures then it is better to use Interfaces. you need some classes to use some methods which you don't want to be included in the class, then you go for the interface, which makes it easy to just implement and make use of the methods defined in the interface. Use Abstract Class when If various implementations are of the same kind and use common behavior or status then abstract class is better to use. When you want to provide a generalized form of abstraction and leave the implementation task with the inheriting subclass. Abstract classes are an excellent way to create planned inheritance hierarchies. They're also a good choice for nonleaf classes in class hierarchies. Define leaf? The node without any child node is a leaf node. What do you mean by overflow and underflow? Overflow: When there is no more room to store new elements Underflow: When there are no more elements to be deleted What is binary search tree? The tree constructed using the relationship as Left Child < Root < Right Child What is time-space trade-off? A compromise between achieving either of the two rendering the other as expensive What are the different types of traversing (trees)? Preorder, Postorder and Inorder What is the data structures used to perform recursion? Stack When is a binary search algorithm best applied? In case the data items are already sorted There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree? Tree with 15 nodes Whether Linked List is linear or Non-linear data structure? Linear Convert the expression ((A + B) * C - (D - E) ^ (F + G)) to equivalent Prefix and Postfix notations. Prefix: -*+ABC ^-DE+FG Postfix: AB+C* DE-FG+^In tree construction which is the suitable efficient data structure? (Array, Linked list, Stack, Queue) Array or Linked List What is difference between Singly Linked List and Doubly Linked List data structure? Singly list: Each node can point only to next node Doubly list: Each node can point to previous node as well as next node -- Exceptions for first and last nodes in each case What are the types of Collision Resolution Techniques and the methods used in each of the type? Separate chaining Open addressing Linear probing Quadratic probing Double hashing What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model. RDBMS: Array Network Model: Graph Hierarchical Model: Tree/Linked List

If you are using C language to implement the heterogeneous linked list, what pointer type will you use? Void pointer What is database? ANSWER: A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose. What is DBMS? State its advantages/features ANSWER: Database management system ? Redundancy is controlled. ? Unauthorised access is restricted. ? Providing multiple user interfaces. ? Enforcing integrity constraints. ? Providing backup and recovery. What is a Database system? ANSWER: The database and DBMS software together is called as Database system. Disadvantage in File Processing System? ANSWER: ? Data redundancy & inconsistency. ? Difficult in accessing data. ? Data isolation. ? Data integrity. ? Concurrent access is not possible. ? Security Problems. . Describe the three levels of data abstraction? ANSWER: The are three levels of abstraction: ? Physical level: The lowest level of abstraction describes how data are stored. ? Logical level: The next higher level of abstraction, describes what data are stored in database and what relationship among those data. ? View level: The highest level of abstraction describes only part of entire database. Define the "integrity rules" ANSWER: There are two Integrity rules. ? Entity Integrity: States that ?Primary key cannot have NULL value? ? Referential Integrity: States that ?Foreign Key can be either a NULL value or should be Primary Key value of other relation.

What is System R? What are its two major subsystems? ANSWER: System R was designed and developed over a period of 1974-79 at IBM San Jose Research Center . It is a prototype and its purpose was to demonstrate that it is possible to build a Relational System that can be used in a real life environment to solve real life problems, with performance at least comparable to that of existing system. Its two subsystems are ? Research Storage ? System Relational Data System. What is Data Independence? ANSWER: Data independence means that ?the application is independent of the storage structure and access strategy of data?. In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level. Two types of Data Independence: ? Physical Data Independence : Modification in physical level should not affect the logical level. ? Logical Data Independence : Modification in logical level should affect the view level. NOTE: Logical Data Independence is more difficult to achieve What is a view? How it is related to data independence? ANSWER: A view may be thought of as a virtual table, that is, a table that does not really exist in its own right but is instead derived from one or more underlying base table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary. Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database. Hence accounts for logical data independence. . What is Data Model? ANSWER: A collection of conceptual tools for describing data, data relationships data semantics and constraints. What is Object Oriented model? ANSWER: This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes. What is an Entity type? ANSWER: It is a collection (set) of entities that have same attributes. What is an Entity set? ANSWER: It is a collection of all entities of particular entity type in the database. What is degree of a Relation? ANSWER: It is the number of attribute of its relation schema.

What is DML (Data Manipulation Language)? What are its types? ANSWER: This language that enable user to access or manipulate data as organised by appropriate data model. ? Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data. ? Non-Procedural DML or High level: DML requires a user to specify what data are needed without specifying how to get those data. What is DML Compiler? ANSWER: It translates DML statements in a query language into low-level instruction that the query evaluation engine can understand. What is Query evaluation engine? ANSWER: It executes low-level instruction generated by compiler. What is Relational Algebra? ANSWER: It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation. What is normalization? ANSWER: It is a process of analysing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties ? Minimizing redundancy ? Minimizing insertion, deletion and update anomalies. What is Functional Dependency? Give example ANSWER: A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y. What is Multivalued dependency? ANSWER: Multivalued dependency denoted by X Y specified on relation schema R, where X and Y are both subsets of R, specifies the following constraint on any relation r of R: if two tuples t1 and t2 exist in r such that t1[X] = t2[X] then t3 and t4 should also exist in r with the following properties ? t3[x] = t4[X] = t1[X] = t2[X] ? t3[Y] = t1[Y] and t4[Y] = t2[Y] ? t3[Z] = t2[Z] and t4[Z] = t1[Z] where [Z = (R-(X U Y)) ] What is 3NF? ANSWER: A relation schema R is in 3NF if it is in 2NF and for every FD X A either of the following is true ? X is a Super-key of R. ? A is a prime attribute of R. In other words, if every non prime attribute is non-transitively dependent on primary key.

What is BCNF (Boyce-Codd Normal Form)? ANSWER: A relation schema R is in BCNF if it is in 3NF and satisfies an additional constraint that for every FD X A, X must be a candidate key. What is "transparent DBMS"? It is one, which keeps its Physical Structure hidden from user.

Brief theory of Network, Hierarchical schemas and their properties Network schema uses a graph data structure to organize records example for such a database management system is CTCG while a hierarchical schema uses a tree data structure example for such a system is IMS.

What do you mean by Correlated subquery? Give example Subqueries, or nested queries, are used to bring back a set of rows to be used by the parent query. Depending on how the subquery is written, it can be executed once for the parent query or it can be executed once for each row returned by the parent query. If the subquery is executed for each row of the parent, this is called a correlated subquery. A correlated subquery can be easily identified if it contains any references to the parent subquery columns in its WHERE clause. Columns from the subquery cannot be referenced anywhere else in the parent query. The following example demonstrates a non-correlated subquery. E.g. Select * From CUST Where '10/03/1990' IN (Select ODATE From ORDER Where CUST.CNUM = ORDER.CNUM) What are the primitive operations common to all record management systems? Addition, deletion and modification. Are the resulting relations of PRODUCT and JOIN operation the same? No. PRODUCT: Concatenation of every row in one relation with every row in another. JOIN: Concatenation of rows from one relation and related rows from another.

Name the sub-systems of a RDBMS I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery, Distribution Control, Transaction Control, Memory Management, Lock Management What is the purpose of the information stored in data-dictionary? The information in the data dictionary validates the existence of the objects, provides access to them, and maps the actual physical storage location. Define SQL and state the differences between SQL and other conventional programming Languages SQL is a nonprocedural language that is designed specifically for data access operations on normalized relational database structures. The primary difference between SQL and other conventional programming languages is that SQL statements specify what data operations should be performed rather than how to perform them.

What is an Oracle Instance? The Oracle system processes, also known as Oracle background processes, provide functions for the user processesfunctions that would otherwise be done by the user processes themselves Oracle database-wide system memory is known as the SGA, the system global area or shared global area. The data and control structures in the SGA are shareable, and all the Oracle background processes and user processes can use them. The combination of the SGA and the Oracle background processes is known as an Oracle instance What are database files, control files and log files. How many of these files should a database have at least? Why? Database Files The database files hold the actual data and are typically the largest in size. Depending on their sizes, the tables (and other objects) for all the user accounts can go in one database filebut that's not an ideal situation because it does not make the database structure very flexible for controlling access to storage for different users, putting the database on different disk drives, or backing up and restoring just part of the database. You must have at least one database file but usually, more than one files are used. In terms of accessing and using the data in the tables and other objects, the number (or location) of the files is immaterial. The database files are fixed in size and never grow bigger than the size at which they were created Control Files The control files and redo logs support the rest of the architecture. Any database must have at least one control file, although you typically have more than one to guard against loss. The control file records the name of the database, the date and time it was created, the location of the database and redo logs, and the synchronization information to ensure that all three sets of files are always in step. Every time you add a new database or redo log file to the database, the information is recorded in the control files. Redo Logs Any database must have at least two redo logs. These are the journals for the database; the redo logs record all changes to the user objects or system objects. If any type of failure occurs, the changes recorded in the redo logs can be used to bring the database to a consistent state without losing any committed transactions. In the case of non-data loss failure, Oracle can apply the information in the redo logs automatically without intervention from the DBA. The redo log files are fixed in size and never grow dynamically from the size at which they were created. What is database Trigger? A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can e defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted. For any one table, there are twelve events for which you can define database triggers. A database trigger can call database procedures that are also written in PL/SQL. What are stored-procedures? And what are the advantages of using them. Stored procedures are database objects that perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client. Stored procedures are used to reduce network traffic. What are cursors give different types of cursors. PL/SQL uses cursors for all database information accesses statements. The language supports the use two types of cursors

What operator performs pattern matching? LIKE operator Which command executes the contents of a specified file? START <filename> or @<filename>

State true or false. EXISTS, SOME, ANY are operators in SQL. True Which system table contains information on constraints on all the tables created? USER_CONSTRAINTS What is the difference between TRUNCATE and DELETE commands? TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE. What will be the output of the following query? SELECT REPLACE(TRANSLATE(LTRIM(RTRIM('!! ATHEN !!','!'), '!'), 'AN', '**'),'*','TROUBLE') FROM DUAL; TROUBLETHETROUBLE

What does the following query do? SELECT SAL + NVL(COMM,0) FROM EMP; This displays the total salary of all employees. The null values in the commission column will be replaced by 0 and added to salary. What is the advantage of specifying WITH GRANT OPTION in the GRANT command? The privilege receiver can further grant the privileges he/she has obtained from the owner to any other user. What is the use of the DROP option in the ALTER TABLE command? It is used to drop constraints specified on the table.

What is the use of DESC and CASCADE in SQL commands? Answer : DESC has two purposes. It is used to describe a schema as well as to retrieve rows from table in descending order. Explanation : The query SELECT * FROM EMP ORDER BY ENAME DESC will display the output sorted on ENAME in descending order. CASCADE When this clause is used with the DROP command, a parent table can be dropped even when a child table exists. e.g. ON DELETE CASCADE

mber 2013) IT)


Subject Difficulty level (1-Easy, 5-Difficult) 3

.Net

.Net

.Net

.Net

.Net .Net .Net

3 2 3

.Net

.Net

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML

HTML HTML HTML HTML

3 3 3 2

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

SE

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

2 3 3 5 3 3 4 3 4 4 4

C/C++

C/C++

C/C++ C/C++

3 4

C/C++ C/C++

3 3

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

3 2 3 3 3 2 2

C/C++

C/C++

C/C++ C/C++

4 5

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

4 2 2 2 3 4 4 3 2 2 3 4 2

C/C++

C/C++ C/C++ C/C++ C/C++

3 1 4 2

C/C++

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

3 1 1 4 1 2 2 2 2 3

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++ C/C++

4 3

C/C++

C/C++

C/C++ C/C++ C/C++

3 3 3

C/C++

C/C++

C/C++ C/C++

22 2

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++

2 2 2 2 3

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

2 4 3 5 4 3 4

C/C++ C/C++ C/C++ C/C++

3 2 2 3

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

3 3 2 3 1 3 5

C/C++

C/C++ C/C++ C/C++

3 4 4

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++ C/C++ C/C++

2 1 2

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

2 2 4 2 2 3 4

C/C++

C/C++

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++

3 5 3 3 4

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

3 4 1 5 4 2

C/C++ C/C++ C/C++ C/C++

2 5 5 4

C/C++

C/C++

C/C++ C/C++ C/C++ C/C++

3 2 3 2

C/C++

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

3 1 3 3 2 4 3 3 2 4 3 3 2 4

C/C++

C/C++

OS

OS

OS OS

1 2

OS

OS

OS

OS OS OS OS OS

2 5 4 2 2

OS OS OS OS OS

3 3 3 4 2

OS

OS Computer Architecture OS

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

Java

DS DS DS DS DS DS DS DS DS DS DS

1 1 1 2 2 2 2 3 1 4 3

DS

DS

DS

DS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

DBMS

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

A pointer to a function which receives nothing and returns nothing A pointer to array of three chars A pointer to function which receives an int pointer and returns a float pointer An array of three char pointers An array of three pointers to chars Are the expressions arr and &arr same for an array of integers? Are the variables argc and argv are local to main? Can a Structure contain a Pointer to itself? Can there be at least some solution to determine the number of arguments passed to a variable argument li Can we generate a C++ source code from the binary file? Can we have "Virtual Constructors"? Can we specify variable field width in a scanf() format string? If possible how? Can you dynamically allocate arrays in expanded memory? Can you use the function fprintf() to display the output on the screen? Can you write a function similar to printf()? Comment: C++ "includes" behavior and java "imports" Describe about storage allocation and scope of global, extern, static, local and register variables? Difference between "C structure" and "C++ structure". Difference between "printf" and "sprintf". Difference between "vector" and "array"? Difference between arrays and linked list? Difference between Composition and Aggregation. Difference between pass by reference and pass by value? Difference between realloc() and free? Difference between strdup and strcpy? Difference: Activity Diagram and Sequence Diagram. Difference: Sequence Diagrams, Collaboration Diagrams. Difference: 'uses', 'extends', 'includes' Differentiate between a for loop and a while loop? What are it uses? Diffrence between a "assignment operator" and a "copy constructor" Does c++ support multilevel and multiple inheritance? Does mentioning the array name gives the base address in all the contexts? Does there exist any other function which can be used to convert an integer or a float to a string? Does there exist any way to make the command line arguments available to other functions without passing Does UML guarantee project success? Explain "passing by value", "passing by pointer" and "passing by reference" Explain one method to process an entire string as one unit? Explain the need for "Virtual Destructor". Explain working of printf. Give 2 examples of a code optimization. Have you heard of "mutable" keyword? How are Structure passing and returning implemented by the complier? How can a called function determine the number of arguments that have been passed to it? How can I access memory located at a certain address? How can I allocate arrays or structures bigger than 64K? How can I call a function, given its name as a string? How can I convert integers to binary or hexadecimal?

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

How can I find out how much memory is available? How can I find the day of the week given the date? How can I increase the allowable number of simultaneously open files? How can I invoke another program from within a C program? How can I read a directory in a C program? How can I return multiple values from a function? How can we check whether the contents of two structure variables are same or not? How can we read/write Structures from/to data files? How can you increase the size of a dynamically allocated array? How can you increase the size of a statically allocated array? How do I access command-line arguments? How do you declare the following: How do you print a string on the printer? How do you represent static members and abstract classes in Class Diagram? How do you write a program which produces its own source code as its output? How is exception handling carried out in c++? How many lines of code you have written for a single program? How much maximum can you allocate in a single call to malloc()? How to reduce a final size of executable? How to resolve many to many relationship? How to write a program such that it will delete itself after exectution? How to write Multithreaded applications using C++? How will you declare an array of three function pointers where each function receives two ints and returns a How would you dynamically allocate a one-dimensional and two-dimensional array of integers? How would you implement a substr() function that extracts a sub string from a given string? How would you obtain segment and offset addresses from a far address of a memory location? How would you obtain the current time and difference between two times? How would you use bsearch() function to search a name stored in array of pointers to string? How would you use qsort() function to sort an array of structures? How would you use qsort() function to sort the name stored in an array of pointers to string? How would you use the functions fseek(), freed(), fwrite() and ftell()? How would you use the functions memcpy(), memset(), memmove()? How would you use the functions randomize() and random()? How would you use the functions sin(), pow(), sqrt()? If we want that any wildcard characters in the command line arguments should be appropriately expanded, In a header file whether functions are declared or defined? In c++ there is only virtual destructors, no constructors. Why? In header files whether functions are declared or defined? Is class an Object? Is object a class? Is there something that I can do in C and not in C++? Out of fgets() and gets() which function is safe to use and why? Talk sometiming about profiling? To which numbering system can the binary number 1101100100111100 be easily converted to? What are bit fields? What is the use of bit fields in a Structure declaration? What are enumerations? What are generic functions and generic classes? What are inline functions?

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

What are macros? what are its advantages and disadvantages? What are register variables? What are the advantage of using register variables? What are the advantages of inheritance? What are the advantages of using pointers in a program? What are the advantages of using typedef in a program? What are the differences between malloc() and calloc()? What are the differences between structures and arrays? What are the different storage classes in C? What are the different types of polymorphism? What are the different types of Storage classes? What are the main differences between procedure oriented languages and object oriented languages? What are the techniques you use for debugging? What are the types of STL containers?. What are virtual classes? What are virtual functions? What are Virtual Functions? How to implement virtual functions in "C" what do the 'c' and 'v' in argc and argv stand for? What do the functions atoi(), itoa() and gcvt() do? What do you mean by "Realization"? What do you mean by binding of data and functions? What do you mean by inheritance? What do you mean by inline function? What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them. What do you mean by public, private, protected and friendly? What do you mean by pure virtual functions? What does static variable mean? What does the error 'Null Pointer Assignment' mean and what causes this error? What is "map" in STL? What is "strstream" ? What is a "RTTI"? What is a far pointer? where we use it? What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro? what is a NULL Pointer? Whether it is same as an uninitialized pointer? What is a pointer? What is a Presistent, Transient Object? What is a scope resolution operator? What is a structure? What is a template? What is abstraction? What is an object? What is association? What is difference between Structure and Unions? What is Dynamic Polymorphism? What is encapsulation? What is friend function? What is function overloading and operator overloading? What is inheritance?

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

What is late bound function call and early bound function call? Differentiate. What is Memory Alignment? What is Namespace? What is namespace? What is near, far and huge pointers? How many bytes are occupied by them? What is object file? How can you access object file? What is Polymorphism? What is polymorphism? Explain with an example. What is public, protected, private? What is R T T I ? What is recursion? What is static identifier? What is the difference between "calloc" and "malloc"? What is the difference between "overloading" and "overridding"? What is the difference between an enumeration and a set of pre-processor # defines? What is the difference between an object and a class? What is the difference between class and structure? What is the difference between declaration and definition? What is the difference between pass by reference and pass by value? What is the difference between Strings and Arrays? What is the difference between the functions memmove() and memcpy()? What is the difference between the functions rand(), random(), srand() and randomize()? What is the maximum combined length of command line arguments including the space between adjacent a What is the most efficient way to count the number of bits which are set in a value? What is the output of printf("%d") What is the similarity between a Structure, Union and enumeration? What is the use of Operator Overloading? What is the use of typedef? What is virtual class and friend class? What is virtual constructors/destructors? What shall I go for Package Diagram? What the advantages of using Unions? What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free i What will happen if I say delete this What's wrong with the call "fopen("c:\newdir\file.dat", "r")"? When is a memory allocated to a class? When is an object created and what is its lifetime? When reallocating memory if any other pointers point into the same piece of memory do you have to readju When shall I use Multiple Inheritance? When will a constructor executed? Where are the auto variables stored? Where does global, static, local, register variables, free memory and C Program instructions get stored? Which bit wise operator is suitable for checking whether a particular bit is on or off? Which bit wise operator is suitable for checking whether a particular bit is on or off? Which bit wise operator is suitable for putting on a particular bit in a number? Which bit wise operator is suitable for turning off a particular bit in a number? Which function should be used to free the memory allocated by calloc()?

C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++ C/C++

Which header file should you include if you are to develop a function which can accept variable number of a which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or cha Why do we use virtual functions? Why doesn't C have nested functions? Why preincrement operator is faster than postincrement? Write a macro for swapping integers. Write a program to compare two strings without using the strcmp() function. Write a program to concatenate two strings. Write a program to find the Factorial of a number Write a program to generate the Fibinocci Series Write a program to interchange 2 variables without using the third one. Write a program which employs Recursion Write a program which uses Command Line Arguments Write a program which uses functions like strcmp(), strcpy()? etc Write any small program that will compile in "C" but not in "C++" Write down the equivalent pointer expression for referring the same element a[i][j][k][l]? Write programs for String Reversal & Palindrome check

s passed to a variable argument list function?

and register variables?

er or a float to a string? o other functions without passing them as arguments to the function?

been passed to it?

on receives two ints and returns a float? nal array of integers? om a given string? a memory location? pointers to string? pointers to string?

hould be appropriately expanded, are we required to make any special provision? If yes, which?

e easily converted to?

d object oriented languages?

ferentiate between them.

d a NULL Macro?

r # defines?

d randomize()? ding the space between adjacent arguments?

or allocate sing "calloc" and free it using "delete"?

of memory do you have to readjust these other pointers or do they get readjusted automatically?

gram instructions get stored?

h can accept variable number of arguments? eft shifting an unsigned int or char by 1?

ent a[i][j][k][l]?

Anda mungkin juga menyukai