Tuesday, February 13, 2007
Wednesday, May 10, 2006
parsing the command line options / flags
The GNU C library provides a function that you can use in C and C++
programs to parse the make this job somewhat easier (although still a
bit annoying).This function, getopt_long, understands both short and
long options.
header file to include <getopt.h>
Tuesday, May 09, 2006
OOP interview questions.
- What is MUTEX ?
- What isthe difference between a 'thread' and a 'process'?
- What is INODE?
- Explain the working of Virtual Memory.
- How does Windows NT supports Multitasking?
- Explain the Unix Kernel.
- What is Concurrency? Expain with example Deadlock and Starvation.
- What are your solution strategies for "Dining Philosophers Problem" ?
- Explain Memory Partitioning, Paging, Segmentation.
- Explain Scheduling.
- Operating System Security.
- What is Semaphore?
- Explain the following file systems : NTFS, Macintosh(HPFS), FAT .
- What are the different process states?
- What is Marshalling?
- Define and explain COM?
- What is Marshalling?
- Difference - Loading and Linking ?
C /C++ interview questions..
- What is the output of printf("%d")
- What will happen if I say delete this
- What is Dangling pointer?
- Difference between "C structure" and "C++ structure".
- Diffrence between a "assignment operator" and a "copy constructor"
- What is the difference between "overloading" and "overridding"?
- Explain the need for "Virtual Destructor".
- Can we have "Virtual Constructors"?
- What are the different types of polymorphism?
- What are Virtual Functions? How to implement virtual functions in "C"
- What are the different types of Storage classes?
- What is Namespace?
- What are the types of STL containers?.
- Is there any difference between a messageand method?
- If I ask you to write 'VI' editor in C++ - How you'll proceed?
- Difference between char name[] = “prashant n mhatre”; and char *name = “prashant n mhatre”;
- Should we use global variables?
- Parsing HTML or XML document with C++
- What is 'self assignment'?
- Difference between how virtual and non-virtual member functions are called
- Finding shortest path aka Dijkstra's algorithm and backtracking
- Doing permutations and combinations in C++
- Difference between "vector" and "array"?
- How to write a program such that it will delete itself after exectution?
- Can we generate a C++ source code from the binary file?
- What are inline functions?
- Talk sometiming about profiling?
- How many lines of code you have written for a single program?
- What is "strstream" ?
- How to write Multithreaded applications using C++?
- Explain "passing by value", "passing by pointer" and "passing by reference"
- Write any small program that will compile in "C" but not in "C++"
- Have you heard of "mutable" keyword?
- What is a "RTTI"?
- Is there something that I can do in C and not in C++?
- Why preincrement operator is faster than postincrement?
- What is the difference between "calloc" and "malloc"?
- What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
- What is Memory Alignment?
- Explain working of printf.
- Difference between "printf" and "sprintf".
- What is "map" in STL?
- When shall I use Multiple Inheritance?
- What are the techniques you use for debugging?
- How to reduce a final size of executable?
- Give 2 examples of a code optimization.
Database/SQL Interview questions
- What are the different types of joins?
- Explain normalization with examples.
- What cursor type do you use to retrieve multiple recordsets?
- Diffrence between a "where" clause and a "having" clause
- What is the difference between "procedure" and "function"?
- How will you copy the structure of a table without copying the data?
- How to find out the database name from SQL*PLUS command prompt?
- Tadeoffs with having indexes
- Talk about "Exception Handling" in PL/SQL?
- What is the diference between "NULL in C" and "NULL in Oracle?"
- What is Pro*C? What is OCI?
- Give some examples of Analytical functions.
- What is the difference between "translate" and "replace"?
- What is DYNAMIC SQL method 4?
- How to remove duplicate records from a table?
- What is the use of ANALYZing the tables?
- How to run SQL script from a Unix Shell?
- What is a "transaction"? Why are they necessary?
- Explain Normalizationa dn Denormalization with examples.
- When do you get contraint violtaion? What are the types of constraints?
- How to convert RAW datatype into TEXT?
- Difference - Primary Key and Aggregate Key
- How functional dependency is related to database table design?
- What is a "trigger"?
- Why can a "group by" or "order by" clause be expensive to process?
- What are "HINTS"? What is "index covering" of a query?
- What is a VIEW? How to get script for a view?
- What are the Large object types suported by Oracle?
- What is SQL*Loader?
- Difference between "VARCHAR" and "VARCHAR2" datatypes.
- What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a table.
- Difference between "ORACLE" and "MICROSOFT ACCESS" databases.
- How to create a database link ?
OOP interview questions.
- What is inheritance?
- Difference between Composition and Aggregation.
- Difference: Sequence Diagrams, Collaboration Diagrams.
- Difference: 'uses', 'extends', 'includes'
- What shall I go for Package Diagram?
- What is Polymorphism?
- Is class an Object? Is object a class?
- Comment: C++ "includes" behavior and java "imports"
- What do you mean by "Realization"?
- What is a Presistent, Transient Object?
- What is the use of Operator Overloading?
- Does UML guarantee project success?
- Difference: Activity Diagram and Sequence Diagram.
- What is association?
- How to resolve many to many relationship?
- How do you represent static members and abstract classes in Class Diagram?
- Can we use UML for user interface (UI) design?
- Every object has : state, behavior and identity - explain
- How to reverse engineer C++ code in UML?
- What are the tools you used for OOAD?
- Difference: Object Oriented Analysis (OOA) and Object Oriented Design (OOD)?
- What are the four phases of the Unified Process ?
- How do you convert uses cases into test cases?
- Explain Class Diagram in Detail.
- What are the Design Patterns you know.
- When do you prefer to use composition than aggregation?
- UML: IS it a process, method or notation?
- Does a concept HAVE to become a class in Design?
- What are the good practices to use while designing for reuse?
- Can you think of some nice examples where *multiple* actors are associated with a use case ?
- How to use CRC Cards for Class Design?
- What is the difference between static and dynamic Classificaition.Give some examples.
- Explian following terms: Constraint Rules, Design by contract.
- What is Object Constraint Language (OCL)?
- Difference Between Attribute and Association.
- What are associative classes?
Friday, May 05, 2006
compile for debug with gdb
add -ggdb flag in the compile & link command.
eg:
g++ -c file_one.c -o file_one.o -ggdb
g++ file_one.o file_two.o -o binary_file -ggdb
eg:
g++ -c file_one.c -o file_one.o -ggdb
g++ file_one.o file_two.o -o binary_file -ggdb
Wednesday, May 03, 2006
create, chmod a directory
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int main(int argc, char** argv)
{
int fd;
fd = open("testdir", O_CREAT, 555);
if(fd != -1)
fchmod(fd, 422);
else
printf("cannot open the directory \n");
return 0;
}
Subscribe to:
Posts (Atom)