Programmer Interview: top 42 questions and answers by phone (I)

Source: Internet
Author: User
: This article mainly introduces the Programmer Interview: the top 42 questions and answers in the telephone interview (I). If you are interested in the PHP Tutorial, please refer to it. This year is July 2015. in the past few years, electronic Interview (Telephone interview) is the most popular way to screen candidates for programmer positions. It makes it easy for both employers to understand each other. candidates do not need to go to the location of the employer in the future, and the interviewer does not need to make additional arrangements. This is the second part of my article about programmer interviews. I got feedback that the first part is too coding-intensive. many programmers want me to list a similar list of electrical problems. In order to smoothly enter the next round through the electric plane, you must answer all the questions related to your work requirements well. In most of the electrical aspects for Java and C ++ developers, you will not only encounter problems with the corresponding programming language, but also encounter other technical problems, for example, SQL, XML, UNIX, generic programming, object-oriented programming, data structures and algorithms, network, coding, and other aspects of work. Due to the variability of the programmer's job-seeking power, you need special skills to present yourself as the interviewer expects.

It is important to remember that when answering an electrical problem, key points should be raised as early as possible, and key answers should always be given. Because the interviewer's questions often cover a wide range of topics, they prefer key answers, rather than empty talk like "OK, I know. In a face-to-face interview, you will have a chance to explain the problem in depth. By the way, this is not a fixed rule. based on the interviewer's response to your answer, you can understand what kind of answer he expects. If he asks you more, you should say more. But if he jumps to the next question immediately, you should answer the question clearly and concisely. In this article, I will share with you some common interesting programming problems that have been adapted for electrical surfaces. Most of these are from the electrical aspects of technology companies, including Barclays, Citi, Nomura and other banks, and companies that provide services such as Infosys, TCS, CTS, Tech Mahindra, and HCL. As I mentioned before, interview questions are randomly selected, but most of them are based on basic knowledge, because they are what the interviewer wants to examine on the electrical surface. Although most of these questions are for junior developers (2 to 5 years of experience), senior and senior programmers can still use them as their own interview questions. If you are an interviewer, you can use these questions to quickly screen candidates for development positions. I will provide a brief answer here and provide a link to the detailed answer.

The following is a list of almost 42 electrical questions for programmers. These questions can be used to examine any programmer, developer, software engineer, test and Operation engineer because they are based on the basic knowledge of programming. But they are most suitable for programmers and developers. By the way, if you are a Java developer and are looking for a Java electrical question, go to the list. This list is more common for all programmers, including Python, Ruby, Perl, and C # developers.

1. How long does it take to retrieve elements from hash tables, binary trees, and linked lists? What if you have millions of records?

The hash table requires O (1) time, the binary tree requires O (logN) (N is the number of nodes in the tree), and the linked list requires O (N is the number of nodes in the linked list ). If the data structure works normally (for example, the hash table does not have or only has a small number of conflicts, and the binary tree is balanced), millions of records do not affect the efficiency. If the job is abnormal, the efficiency will decrease as the number of records increases.

2. what is the difference between Overriding and Overloading? (Detailed answer)

Overwrite is determined at runtime, and reload is determined at compilation. In addition, the overwrite and reload mechanisms are different. for example, in Java, the signature of the reload method must be different from that of the original method, but the overwrite signature must be the same.

3. What is the difference between a fork process and a new thread?

When you fork a process, the new process will execute the same code as the parent process, but in a different memory space. But when you generate a thread in an existing process, it generates a new code execution route, but shares the same memory space.

4. what is a critical section? (Answer)

The critical section is a piece of code and is very important. it can only be executed by one thread at a time in multiple threads. The semaphore or mutex can be used to protect critical zones. In Java, you can use the synchronized keyword or ReentrantLock to protect the critical section.

5. what is the difference between the value type and the reference type? (Answer)

Value types are more optimized types and are always immutable, such as the original Java int, long, double, and float. The reference type points to an object, which may be variable or unchanged. You can also say that the value type points to a value, and the reference type points to an object.

6. what is the heap and stack in the process? (Detailed answer)

In the same process, there are two different memory regions. In Java, the stack is used to store original values and reference types pointing to objects, but the objects are always created in the heap. An important difference between heap and stack is that the heap memory is shared by all threads, but each thread has its own stack.

7. what is version control? (Answer)

Version control is software used to store code and manage code library versions, such as SVN, CVS, Git, Perforce, and ClearCase. They are highly efficient in comparing code, reviewing code, and constructing from previous stable versions. All professional developers use a version control tool. Otherwise, you cannot effectively manage code, especially if 20 developers work on the same code library. Version control tools play an important role in maintaining code library consistency and handling code conflicts.

8. what is a strong programming language? (Answer)

In a strongly typed language, the compiler ensures the correctness of the type. for example, you cannot store numbers in the String type, and vice versa. Java is a strongly typed language, so there are various data types (such as int, float, String, char, and boolean ). You can only store compatible values in the corresponding type. On the contrary, weak type languages do not require type checks during compilation, which are processed based on context values. Python and Perl are examples of two common weak-type programming languages. you can save strings composed of numbers in the numeric type.

9. can I describe the differences between valid (valid) XML and well-formed XML?

XML with the correct format has a root element. all labels are correctly closed, attributes are correctly defined, and their values are correctly enclosed by quotation marks. On the other hand, valid XML can be verified based on an XSD file or schema. Therefore, an XML file may be in the correct format but not valid (because it contains tags not allowed by the mode ).

10. what is the difference between DOM and SAX syntax analyzer? (Detailed answer)

DOM syntax analyzer stores memory, loads the entire XML file into the memory, and creates a DOM tree for syntax analysis. The SAX syntax analyzer is an event-based syntax Analyzer. Therefore, it performs syntax analysis on XML documents based on received events (such as start tag, end tag, attribute start, and attribute end. According to their analysis method, DOM syntax analyzer does not apply to large XML files because it occupies a large amount of memory space and your process may exhaust the memory. You should use SAX to analyze large files. For small files, DOM is often much faster than SAX.

11. what is the relationship between threads and processes? (Detailed answer)

A process can have multiple threads, but a thread is always a unique process. Two processes cannot share memory space unless they intentionally communicate with each other through the shared memory. But the two threads of the same process always share the same memory.

12. what does immutable class mean? (Detailed answer)

If the status of a class cannot be changed after it is created, it is immutable. For example, String in Java. Once you create a String, such as "Java", you cannot change its content. Any changes to this String (for example, converting to uppercase and connecting to another String) will create a new object. Immutable objects are useful in parallel program design because they can be shared between processes without worrying about synchronization. In fact, the entire function is a programming model built on an immutable object.

13. why do you want to create a simulated (mock) object? (Answer)

Simulated objects are useful when testing an independent unit in the software. In fact, both stub and simulation are powerful tools for creating automated unit tests. Suppose you are writing a program that shows the currency exchange rate, but there is no URL that can be connected. now, if you want to test your code, you can use a simulated object. In the Java world, there are many frameworks that can generate powerful simulation objects for you, such as Mockito and PowerMock.

14. what is SQL injection?

SQL injection is a security vulnerability that allows intruders to steal data from the system. Any system that obtains input from the user without any verification to create an SQL query may be attacked by SQL injection. In such a system, intruders can input SQL code instead of data to obtain additional data. Many instances are obtained by attackers using this vulnerability, such as user IDs, passwords, and personal information. In Java, you can use Prepared statements to avoid SQL injection.

15. what is the difference between inner join and left join in SQL? (Answer)

In SQL, there are two main connection types: internal connection and external connection. The outer connection includes the right outer connection and the left outer connection. The main difference between inner join and left join is that records matching both tables in inner join are selected, and records matching both tables in the left join are selected, all records in the left table are selected. Pay attention to queries that contain "all". They often require left connections. for example, you can write an SQL query to find all departments and their employees. If you use an internal connection to process this query, you will miss an empty department without any work.

16. what does V in MVC mean? (Answe)

In MVC mode, V is a View ). A view is what you see, such as a webpage. This is a very important web application development and design pattern. it is based on the separation of concerns principle, so that different modules can be modified independently without affecting other modules. In the world of Java, there are many open-source frameworks that provide the MVC mode, such as Struts 2 and Spring MVC. By the way, M represents the Model and C represents the Controller ). A model is an actual business object, such as a user, employee, or order. a controller is used to distribute requests to the correct processing unit.

17. what is the difference between a class and an object? (Detailed answer)

Class is the design map used to create objects. A class includes code and behavior, and an object includes state and behavior. To create an object, you must create a class that expresses the object structure. Classes are also used to map objects in the memory. in Java, JVM completes this job for you.

18. what is loose-coupling )?

Sparse coupling is a software feature that is worth pursuing, so that modifications to one part of the software will not affect other parts. For example, in a loosely coupled software, changes to the UI layout should not affect the back-end class structure.

19. what is the difference between composition, aggregation, and association? (Detailed answer)

Association means that two objects are interrelated. Combination is a form of association. an object consists of multiple objects, but they must coexist. for example, the human body is composed of various organs, and independent organs cannot survive, they must play a role in the body. Aggregation is also a form of association, indicating the collection of objects. for example, a city is the aggregation of residents.

20. what is the difference between interfaces and abstract classes? (Detailed answer)

This is the most typical issue for all programmers. The interface is the purest abstract form, and there is nothing specific. An abstract class is a combination of abstract and specific things. This difference may be different in different languages. for example, in Java, you can extend multiple interfaces, but only inherit one abstract class. For more details, see detailed answers.

21. what is unit test? (Answer)

Unit testing is a way to test the functionality of independent units (rather than the entire application. There are many tools for unit testing in different languages. For example, in Java, you can use JUnit or TestNG to write unit tests. Unit tests often run automatically during building or in a continuous environment (such as Jenkins.

Get free LAMP Brothers original PHP Tutorial CD/the elaborate PHP Essentials edition, details consulting official website Customer Service: http://www.lampbrother.net

PHPCMS secondary development http://yun.itxdl.cn/online/phpcms/index.php? U = 5

Develop http://yun.itxdl.cn/online/weixin/index.php? U = 5

Mobile internet server development http://yun.itxdl.cn/online/server/index.php? U = 5

Javascript http://yun.itxdl.cn/online/js/index.php course? U = 5

CTO training camp http://yun.itxdl.cn/online/cto/index.php? U = 5

The above introduces the Programmer Interview: Top 42 (I) of the telephone interview Q & A, including some content. I hope my friends who are interested in PHP tutorials can help me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.