top programming interview questions and answers job interview tips

47
Top 20 programming interview questions and answers If you need top 7 free ebooks below for your job interview, please visit: 4career.net • Free ebook: 75 interview questions and answers • Top 12 secrets to win every job interviews • 13 types of interview quesitons and how to face them • Top 8 interview thank you letter samples Interview questions and answers – free pdf download Page 1 of 47

Upload: programmingtutorial

Post on 29-Jun-2015

308 views

Category:

Education


0 download

DESCRIPTION

You'll likely be asked difficult questions during the interview. Preparing the list of likely questions in advance will help you easily transition from question to question.

TRANSCRIPT

Page 1: Top programming interview questions and answers job interview tips

Top 20 programming interview questions and answers

If you need top 7 free ebooks below for your job interview, please visit: 4career.net

• Free ebook: 75 interview questions and answers• Top 12 secrets to win every job interviews• 13 types of interview quesitons and how to face them• Top 8 interview thank you letter samples• Top 7 cover letter samples• Top 8 resume samples• Top 15 ways to search new jobs

Interview questions and answers – free pdf download Page 1 of 30

Page 2: Top programming interview questions and answers job interview tips

Tell me about yourself?

This is probably the most asked question in programming interview. It breaks the ice and gets you to talk about something you should be fairly comfortable with. Have something prepared that doesn't sound rehearsed. It's not about you telling your life story and quite frankly, the interviewer just isn't interested. Unless asked to do so, stick to your education, career and current situation. Work through it chronologically from the furthest back to the present.

Interview questions and answers – free pdf download Page 2 of 30

Page 3: Top programming interview questions and answers job interview tips

Combine Two Strings ?We are given 3 strings: str1, str2, and str3. Str3 is said to be a shuffle of str1 and str2 if it can be formed by interleaving the characters of str1 and str2 in a way that maintains the left to right ordering of the characters from each string. For example, given str1=”abc” and str2=”def”, str3=”dabecf” is a valid shuffle since it preserves the character ordering of the two strings. So, given these 3 strings write a function that detects whether str3 is a valid shuffle of str1 and str2.

Interview questions and answers – free pdf download Page 3 of 30

Page 4: Top programming interview questions and answers job interview tips

What Can You Do for Us That Other Candidates Can't?

What makes you unique? This will take an assessment of your experiences, skills and traits. Summarize concisely: "I have a unique combination of strong technical skills, and the ability to build strong customer relationships. This allows me to use my knowledge and break down information to be more user-friendly."

Interview questions and answers – free pdf download Page 4 of 30

Page 5: Top programming interview questions and answers job interview tips

Transform Word?

Given a source word, target word and an English dictionary, transform the source word to target by changing/adding/removing 1 character at a time, while all intermediate words being valid English words. Return the transformation chain which has the smallest number of intermediate words.

Interview questions and answers – free pdf download Page 5 of 30

Page 6: Top programming interview questions and answers job interview tips

Reverse Words in a String? Given an input string, reverse all the words. To clarify, input: “Interviews are awesome!” output: “awesome! are Interviews”. Consider all consecutive non-whitespace characters as individual words. If there are multiple spaces between words reduce them to a single white space. Also remove all leading and trailing whitespaces. So, the output for ”   CS degree”, “CS    degree”, “CS degree   “, or ”   CS   degree   ” are all the same: “degree CS”.

Interview questions and answers – free pdf download Page 6 of 30

Page 7: Top programming interview questions and answers job interview tips

Median of Integer Stream ?Given a stream of unsorted integers, find the median element in sorted order at any given time. So, we will be receiving a continuous stream of numbers in some random order and we don’t know the stream length in advance. Write a function that finds the median of the already received numbers efficiently at any time. We will be asked to find the median multiple times. Just to recall, median is the middle element in an odd length sorted array, and in the even case it’s the average of the middle elements.

Interview questions and answers – free pdf download Page 7 of 30

Page 8: Top programming interview questions and answers job interview tips

Check Balanced Parentheses Given a string of opening and closing parentheses, check whether it’s balanced. We have 3 types of parentheses: round brackets: (), square brackets: [], and curly brackets: {}. Assume that the string doesn’t contain any other character than these, no spaces words or numbers. Just to remind, balanced parentheses require every opening parenthesis to be closed in the reverse order opened. For example ‘([])’ is balanced but ‘([)]‘ is not.

Interview questions and answers – free pdf download Page 8 of 30

Page 9: Top programming interview questions and answers job interview tips

Anagram Strings?Given two strings, check if they’re anagrams or not. Two strings are anagrams if they are written using the same exact letters, ignoring space, punctuation and capitalization. Each letter should have the same count in both strings. For example, ‘Eleven plus two’ and ‘Twelve plus one’ are meaningful anagrams of each other.

Interview questions and answers – free pdf download Page 9 of 30

Page 10: Top programming interview questions and answers job interview tips

Search Unknown Length Array?Given a sorted array of unknown length and a number to search for, return the index of the number in the array. Accessing an element out of bounds throws exception. If the number occurs multiple times, return the index of any occurrence. If it isn’t present, return -1.

Interview questions and answers – free pdf download Page 10 of 30

Page 11: Top programming interview questions and answers job interview tips

Longest Compound Word?Given a sorted list of words, find the longest compound word in the list that is constructed by concatenating the words in the list. For example, if the input list is: ['cat', 'cats', 'catsdogcats', 'catxdogcatsrat', 'dog', 'dogcatsdog', 'hippopotamuses', 'rat', 'ratcat', 'ratcatdog', 'ratcatdogcat']. Then the longest compound word is ‘ratcatdogcat’ with 12 letters. Note that the longest individual words are ‘catxdogcatsrat’ and ‘hippopotamuses’ with 14 letters, but they’re not fully constructed by other words. Former one has an extra ‘x’ letter, and latter is an individual word by itself not a compound word.

Interview questions and answers – free pdf download Page 11 of 30

Page 12: Top programming interview questions and answers job interview tips

Trim Binary Search Tree ?Given the root of a binary search tree and 2 numbers min and max, trim the tree such that all the numbers in the new tree are between min and max (inclusive). The resulting tree should still be a valid binary search tree.

Interview questions and answers – free pdf download Page 12 of 30

Page 13: Top programming interview questions and answers job interview tips

Kth Largest Element in Array Given an array of integers find the kth element in the sorted order (not the kth distinct element). So, if the array is [3, 1, 2, 1, 4] and k is 3 then the result is 2, because it’s the 3rd element in sorted order (but the 3rd distinct element is 3).

Interview questions and answers – free pdf download Page 13 of 30

Page 14: Top programming interview questions and answers job interview tips

Find Missing Element?This an array of non-negative integers. A second array is formed by shuffling the elements of the first array and deleting a random element. Given these two arrays, find which element is missing in the second array.

Interview questions and answers – free pdf download Page 14 of 30

Page 15: Top programming interview questions and answers job interview tips

Matrix Region Sum?Given a matrix of integers and coordinates of a rectangular region within the matrix, find the sum of numbers falling inside the rectangle. Our program will be called multiple times with different rectangular regions from the same matrix.

Interview questions and answers – free pdf download Page 15 of 30

Page 16: Top programming interview questions and answers job interview tips

Find Even Occurring Element?Given an integer array, one element occurs even number of times and all others have odd occurrences. Find the element with even occurrences.

Interview questions and answers – free pdf download Page 16 of 30

Page 17: Top programming interview questions and answers job interview tips

Find Next Palindrome Number?Given a number, find the next smallest palindrome larger than the number. For example if the number is 125, next smallest palindrome is 131.

Interview questions and answers – free pdf download Page 17 of 30

Page 18: Top programming interview questions and answers job interview tips

Tree Level Order Print?Given a binary tree of integers, print it in level order. The output will contain space between the numbers in the same level, and new line between different levels.

Interview questions and answers – free pdf download Page 18 of 30

Page 19: Top programming interview questions and answers job interview tips

Tree Reverse Level Order Print?This is very similar to the previous post level order print. We again print the tree in level order, but now starting from bottom level to the root.

Interview questions and answers – free pdf download Page 19 of 30

Page 20: Top programming interview questions and answers job interview tips

Find Odd Occurring Element?Given an integer array, one element occurs odd number of times and all others have even occurrences. Find the element with odd occurrences.

Interview questions and answers – free pdf download Page 20 of 30

Page 21: Top programming interview questions and answers job interview tips

Find Word Positions in Text ?Given a text file and a word, find the positions that the word occurs in the file. We’ll be asked to find the positions of many words in the same file.

Interview questions and answers – free pdf download Page 21 of 30

Page 22: Top programming interview questions and answers job interview tips

Useful job interview materials:

If you need top free ebooks below for your job interview, please visit: 4career.net

• Free ebook: 75 interview questions and answers• Top 12 secrets to win every job interviews• Top 36 situational interview questions• 440 behavioral interview questions• 95 management interview questions and answers• 30 phone interview questions• Top 8 interview thank you letter samples• 290 competency based interview questions• 45 internship interview questions• Top 7 cover letter samples• Top 8 resume samples• Top 15 ways to search new jobs

Interview questions and answers – free pdf download Page 22 of 30

Page 23: Top programming interview questions and answers job interview tips

Top 6 tips for job interview

Interview questions and answers – free pdf download Page 23 of 30

Page 24: Top programming interview questions and answers job interview tips

Tip 1: Do your homeworkYou'll likely be asked difficult questions during the interview. Preparing the list of likely questions in advance will help you easily transition from question to question.

Spend time researching the company. Look at its site to understand its mission statement, product offerings, and management team. A few hours spent researching before your interview can impress the hiring manager greatly. Read the company's annual report (often posted on the site), review the employee's LinkedIn profiles, and search the company on Google News, to see if they've been mentioned in the media lately. The more you know about a company, the more you'll know how you'll fit in to it.

Ref material: 4career.net/job-interview-checklist-40-points

Interview questions and answers – free pdf download Page 24 of 30

Page 25: Top programming interview questions and answers job interview tips

Tip 2: First impressionsWhen meeting someone for the first time, we instantaneously make our minds about various aspects of their personality.Prepare and plan that first impression long before you walk in the door. Continue that excellent impression in the days following, and that job could be yours.Therefore:

Never arrive late. Use positive body language and turn on your

charm right from the start. Switch off your mobile before you step into the

room. Look fabulous; dress sharp and make sure you look

your best. Start the interview with a handshake; give a nice

firm press and then some up and down movement. Determine to establish a rapport with the

interviewer right from the start. Always let the interviewer finish speaking before

giving your response. Express yourself fluently with clarity and

precision.

Useful material: 4career.net/top-10-elements-to-make-a-

Interview questions and answers – free pdf download Page 25 of 30

Page 26: Top programming interview questions and answers job interview tips

good-first-impression-at-a-job-interview

Tip 3: The “Hidden” Job MarketMany of us don’t recognize that hidden job market is a huge one and accounts for 2/3 of total job demand from enterprises. This means that if you know how to exploit a hidden job market, you can increase your chance of getting the job up to 300%.

In this section, the author shares his experience and useful tips to exploit hidden job market.

Here are some sources to get penetrating into a hidden job market: Friends; Family; Ex-coworkers; Referral; HR communities; Field communities; Social networks such as Facebook, Twitter…; Last recruitment ads from recruiters; HR emails of potential recruiters…

Interview questions and answers – free pdf download Page 26 of 30

Page 27: Top programming interview questions and answers job interview tips

Tip 4: Do-It-Yourself Interviewing PracticeThere are a number of ways to prepare for an interview at home without the help of a professional career counselor or coach or a fee-based service.

You can practice interviews all by yourself or recruit friends and family to assist you.

Useful material: 4career.net/free-ebook-75-interview-questions-and-answers

Interview questions and answers – free pdf download Page 27 of 30

Page 28: Top programming interview questions and answers job interview tips

Tip 5: Ask questionsDo not leave the interview without ensuring that you know all that you want to know about the position. Once the interview is over, your chance to have important questions answered has ended. Asking questions also can show that you are interested in the job. Be specific with your questions. Ask about the company and the industry. Avoid asking personal questions of the interviewer and avoid asking questions pertaining to politics, religion and the like.

Ref material: 4career.net/25-questions-to-ask-employers-during-your-job-interview

Interview questions and answers – free pdf download Page 28 of 30

Page 29: Top programming interview questions and answers job interview tips

Tip 6: Follow up and send a thank-you noteFollowing up after an interview can help you make a lasting impression and set you apart from the crowd.Philip Farina, CPP, a security career expert at Manta Security Management Recruiters, says: "Send both an email as well as a hard-copy thank-you note, expressing excitement, qualifications and further interest in the position. Invite the hiring manager to contact you for additional information. This is also an excellent time to send a strategic follow-up letter of interest."

Ref material: 4career.net/top-8-interview-thank-you-letter-samples

Interview questions and answers – free pdf download Page 29 of 30

Page 30: Top programming interview questions and answers job interview tips

Interview questions and answers – free pdf download Page 30 of 30