Showing posts with label fresher resume writing. Show all posts
Showing posts with label fresher resume writing. Show all posts

programming languages


There are a number of popular programming languages these days. Different companies, even different departments within the same company, prefer to use different languages. Driver developers get used to writing code in C. Many programmers who work on Linux develop applications in C++, while other programmers working on Windows prefer C#. Many cross-platform systems are developed in Java. Objective C becomes more and more popular due to sales of iPads and iPhones. Additionally, scripting languages, such as Perl and Python, are very suitable to toolkit development.
Massive books have been written about each language. It is not a goal to cover all languages in detail in this book because of the space limitation, so Coding Interviews only discusses interview questions for the four most popular programming languages: C, C++, C#, and Java1.
C
One of the reasons why the C programming language is so popular is the flexibility of its use for memory management. Programmers have opportunities to control how, when, and where to allocate and deallocate memory. Memory is allocated statically, automatically, or dynamically in the C programming language.
Static variables and global variables are static-duration variables, which are allocated along with the executable code of the program and persist during the execution of the application. When a local variable is declared as static inside a function, it is initialized only once. Whatever values the function puts into its static local variables during one call will be present when the function is called again. The following is a typical interview question about static local variables: What is the output when the function test executes? (See Listing 2-1).
Listing 2-1. C Code with Static Variables
int hasStatic(int n) {
    static int x = 0;
    x += n;
    return x;
 }
void test() {
    int sum = 0;
    for(int i = 1; i <= 4; ++i)
        sum += hasStatic(i);
    printf("Result of sum is %d.\n", sum);
}
The variable x in the function hasStatic is declared as static. When the function is called the first time with a parameter 1, the static variable x is initialized as 0, and then set to 1. When the function is called the second time with a parameter 2, it is not initialized again and its value 1 persists. It becomes 3 after execution. Similarly, its value becomes 6 and 10 after execution with parameters 3 and 4. Therefore, the result is the sum 1+2+6+10=19.
Automatic-duration variables, also called local variables, are allocated on the stack. They are allocated and deallocated automatically when the program execution flow enters and leaves their scopes. In the sample code in Listing 2-2, there is a local array str in the function allocateMemory. What is the problem with it?
Listing 2-2. C Code to Allocate Memory
char* allocateMemory() {
    char str[20] = "Hello world.";
    return str;
}
void test() {
    char* pString = allocateMemory();
    printf("pString is %s.\n", pString);
}
Because the array str is a local variable, it is deallocated automatically when the execution flow leaves the function allocateMemory. Therefore, the returned memory to pString in the function test is actually invalid, and its content is somewhat random.
One limitation of static-duration and automatic-duration variables is that their size of allocation is required to be compile-time constant. This limitation can be avoided by dynamic memory allocation in which memory is more explicitly, as well as more flexibly, managed. In the C programming language, the library function malloc is used to allocate a block of memory dynamically on the heap, where size is specified at runtime. This block of memory is accessible via a pointer that malloc returns. When the memory is no longer needed, the pointer should be passed to another library function, free, which deallocates the memory in order to avoid memory leaks.
The function allocateMemory in Listing 2-3 utilizes the function malloc to allocate memory dynamically. What is the problem in it? 

Listing 2-3. C Code to Allocate Memory
void allocateMemory(char* pString, int length) {
    pString = (char*)malloc(length);
}
void test() {
    char* pString = NULL;
    allocateMemory(pString, 20);
    strcpy(pString, "Hello world.");
}
The parameter pString in the function allocateMemory is a pointer, and the string content it points to can be modified. However, the memory address it owns cannot be changed when the function allocateMemory returns. Since the input parameter pString of allocateMemory in the function test is NULL, it remains NULL after the execution of allocateMemory, and it causes the program to crash when the NULL address is accessed in test. In order to fix this problem, the first parameter of allocateMemory should be modified as char** pString.
Macros are commonly used in the C programming language and also commonly asked about in technical interviews. Since it is tricky and error-prone to use macros, unexpected results are gotten when they are misused. For example, what is the output when the function test in Listing 2-4 gets executed?
Listing 2-4. C Code with Macros
#define SQUARE(x) (x*x)
void test() {
    printf("Square of (3+4) is %d.\n", SQUARE(3+4));
}
The result of 3+4 is 7, and the square of 7 is 49. However, 49 is not the result of SQUARE(3+4). Macros are substituted by the preprocessor, so SQUARE(3+4) becomes 3+4*3+4, which is actually 19. In order to make the result as expected, the macro should be modified to #define SQUARE(x) ((x)*(x)).
Even in the revised version of macro SQUARE, its result might look surprising if it is not analyzed carefully in some cases. For instance, what are the results of x and y after the code in Listing 2-5 is executed?
Listing 2-5. C Code with Macros
#define SQUARE(x) ((x)*(x))
void test() {
    int x = 5;
    int y = SQUARE(x++);
    printf("Result of x is %d, y is %d.\n", x, y);
}
 It looks like that the variable x increases only once in the code above. However, when the macro is substituted, the variable y is assigned as ((x++)*(x++)). The result of y is 25, and x becomes 7 because it increases twice.
 www.cinterviews.com appreciates your contribution please mail us the questions you have to cinterviews.blogspot.com@gmail.com so that it will be useful to our job search community

Time and Space Efficiency

Outstanding developers pay a lot of attention to time and space consumption and have the passion needed to continue improving performance of their own code. When there are multiple solutions for a problem, interviewers always expect the best one. If interviewers point out that there are better solutions, candidates should try their best to find approaches to improving time and space performance, demonstrating his or her enthusiasm to pursue excellence, which is an essential spirit to have as an outstanding developer.
The first thing candidates should understand is how to analyze time and space efficiencies. Various implementations of the same algorithm may result in dramatic performance distinctions, so it is important to analyze performance of an algorithm and its implementation. Take the calculation of the Fibonacci Sequence as an example. The classical solution is based on the recursive equation f(n) = f(n-1) + f(n-2). It is not difficult to find out the time complexity increases exponentially since there are lots of duplicated calculations. However, the complexity will reduce to O(n) if it is calculated iteratively. First of all, f(1) and f(2) are calculated, and then f(3) is based on f(1) and f(2); f(4) is get based on f(2) and f(3). The sequence continues until f(n) is calculated in a loop. Please refer to the section Fibonacci Sequence for more details.
Candidates have to master pros and cons of each data structure and be able to choose the most suitable one to improve performance. For example, it seems that multiple types of data structures are available to get the median of a stream, including arrays, lists, balanced binary trees, and heaps. After analyzing the characteristics of each data type, we find that the best choice is to utilize two heaps—a maximal heap and a minimal heap (section Median in Stream).
Candidates should also be proficient in common algorithms. The most popular algorithms in interviews are about search and sort. It costs O(n) time to scan an array sequentially. However, it is reduced to O(logn) with the binary search algorithm if an array is sorted. The problem “Maximal Number in a Unimodal Array” and “Times of Occurrences in a Sorted Array”are both solved based on the binary search algorithm. The quicksort algorithm is widely used for other problems besides sorting. The Partition function in quicksort can be used to get the kth maximal number out of n numbers and solve the problem “Majority in an Array”and “Minimal k Numbers”.
www.cinterviews.com appreciates your contribution please mail us the questions you have to cinterviews.blogspot.com@gmail.com so that it will be useful to our job search community

How to Write a Fresher Resume

Writing Fresher Resume 
Whether you are just entering the workforce after graduation or you have decided to change careers, you need an entry-level resume that will help you get a job in a new field.  Without industry experience, however, many applicants worry that their resume won’t pass muster.
Not to worry – when you are applying for an entry-level job, employers will expect you to have entry-level experience.  However, a professional resume is still required, regardless of your level of experience.  Here are the elements that every entry-level resume needs to have, as well as several tips for writing a winning resume.
Elements of an Entry-Level Resume
When browsing resumes, the majority of hiring managers simply scan the objectives and summary of each one before moving on to the next.  This means that the information at the top is the first – and possibly the only – part of your resume that gets noticed.  A resume is basically a sales pitch – a one- or two-page description of what an employer will get if they hire you.  And because hiring managers have very short attention spans, you need to hit them with your selling points as quickly as possible.
Contact Information
Nothing will hurt your chances faster than making a prospective employer hunt for your contact information.  This information should be listed clearly at the very top of your resume.
Objectives
Believe it or not, this is the most important part of an entry-level resume.  First, this is the first thing a hiring manager sees.  Second, since your work history cannot demonstrate your chosen career path, it’s up to your objectives to tell employers where you are headed.
A bulleted list of focused objectives is a necessity.  Instead of “Position where I can exercise my creative skills,” use, “Assistant art direct position in the independent film industry in the New York City metropolitan area.”  Likewise, if you want a management job with good upward mobility, write something like, “Management position with opportunities for advancement.  Open to travel and/or relocation.”
Of course, your objectives should be tailored to fit the specific job you are applying for – if you really want it, that is.  Telling the retail hiring manager that you would prefer a job in engineering is a sure way to get passed over!
Summary
Your resume summary is also extremely important – if the hiring manager doesn’t see what he is looking for there, he is not likely to look any further.  Your summary section should contain a bulleted list of your most important qualifications.  When you have more experience, this is the section where you will list the number of years you have worked in the field.  For now, you will simply list other noteworthy qualifications you have.
Avoid summary statements that have become cliché, such as saying you are “detail-oriented.”  Too many other applicants will make the exact same claim.  Instead, pick out the qualifications that make you valuable and unique.  Remember, this is not only your sales pitch – it is also your last chance to get the hiring manager’s attention before he moves on to the next resume.
Education
Typically, a resume lists work experience before education.  However, the point of a resume is to highlight your strengths, not expose your weaknesses.  If you have a good education but not a lot of experience, you can shift the focus by listing your education first.
Your education section should list your degrees with the most recent first.  List the degree, followed by the name of the school.  Your graduation date should also be included; if you haven’t graduated yet, simply put your scheduled graduation date.  You should also include your GPA only if it is worth writing home about – that is, if it is above 3.0.  Otherwise, don’t include it in your resume, but practice your answer for when you are asked about it!

Work Experience
Many entry-level applicants worry about their lack of detail in this area.  Don’t forget, though, that you are applying for entry-level positions, so hiring managers expect that applicants won’t have a lot of work experience in the field.  You can make your work history look better by describing each set of job responsibilities in a way that plays up the work experience.  For example, if an after-school job included lower-level management responsibilities, make sure you note them on your resume.
Alternatively, you can use a functional resume format, which works well for entry-level applicants.  The functional format allows you to arrange work experience according to skills that employers will be looking for.  For example, if you are trying to break into journalism, but have no experience in the field, you might be able to highlight the desired skills elsewhere: under the skill heading “Communication” you could list your letter-writing duties as an office secretary, the research write-ups you had to do as a work-study student, and the reporting you did for the school paper.
The downside to the function format is that it is not always well received – some employers and most recruiters prefer to see a listing of the jobs you have actually held.  The combination format typically satisfies this requirement.  This format still combines work experience into a “Professional Skills” section; however, it is followed by a bare bones listing of your work history, with only the job title, employer, and dates listed.
Other Elements
There are other sections that you can add to your resume to showcase your other qualifications.  A section entitled “Community Service” demonstrates additional work experience, even if it wasn’t paid.  The “Achievements” section allows you to list awards you have received at school and work.  “Training and Certifications” lists other qualifications you have, such as certificates or on-the-job training, which cannot be listed under the education section.  The placement of these sections depends on the context of the rest of your resume, with the most important (or impressive) qualifications always going nearer to the top.
Last-Minute Advice for Writing Your Entry-Level Resume
Now that you know what goes into an entry-level resume, you’re ready to start writing!  As you work on your resume, however, remember these rules of thumb:
  • Be honest – Whatever you do, don’t succumb to the temptation to inflate your qualifications!  The littlest white lie can cause you not only to lose the job, but also to burn that bridge before you even get a chance to cross it.
  • Cut to the chase – Above all, hiring managers are short on time.  This means that the fewer words you use, the shorter your resume, and the better its chances of being read.  Don’t use unnecessary words – make each point as succinctly as possible.
  • Sell your strengths – It is important to remember that the point of a resume is to “sell” your qualifications to the hiring manager.  Your resume should display your qualifications prominently.  Don’t hide your lack of experience or make up qualifications you don’t have – just be sure employers can readily see what you’ll be bringing to the table.
As long as you follow these tips and include the basic elements listed above, your resume is sure to get attention.  Remember, while a great resume alone won’t land you a job, a sloppy or incomplete resume could cost you a great opportunity!