Google Acoustic Test

Source: Internet
Author: User
1. What is PWM? 2. What are the functions of USB Based on the transmission rate? 3. What is the role of volatile? 4. Correction: char * P = "hello"; char * q = "world"; char * k = strcat (p, q); last programming question, 20 points.




Pulse Width Modulation (PWM), short for "Pulse Width Modulation, it is a very effective technology that uses the digital output of a microprocessor to control analog circuits. It is widely used in many fields from measurement, communication to power control and transformation. USB 1.x( including 1.0, 1.1): use full speed mode (FS: 12 Mb/s) and low speed mode (LS: 1.5 Mb/s ). For example, the mouse and keyboard run on low-speed devices, while the printer and scanner run in full-speed device mode with a transmission speed bottleneck of 12 Mb.
USB 2.0 increases the data transmission speed between devices to 480 Mbps, faster than USB 1. X is 40 times, but the initial speed of USB2.0 is only 240 Mbps, but the technical team has improved the speed to 480 Mbps through hard work.


What is the meaning of the keyword volatile and three different examples are given. A variable defined as volatile means that this variable may be unexpectedly changed, so that the compiler will not assume the value of this variable. Precisely, the optimizer must carefully re-read the value of this variable every time when using this variable, rather than using the backup stored in the register. The following are examples of volatile variables: 1 ). hardware registers of parallel devices (for example, Status Registers) 2 ). the non-automatic variable (non-automatic variables) 3) that will be accessed in an interrupted service subroutine ). variables shared by several tasks in multi-threaded applications 1. difference between struct and class
In terms of definition, there are two differences:
(1) The default permission is inherited. Unless otherwise specified, the inheritance from class is handled by private inheritance; the inheritance from struct is handled by public inheritance.
(2) default access permissions of members. By default, Class Members have private permissions, while struct has public permissions by default.
2. output result questions (both Google and the soft controller are tested)
Void main ()
{
Int A = 10, B, c, d;
B = A ++;
C = ++;
D = 10 * A ++;
Printf ("B, c, d: % d, % d, % d \ n", B, c, d );
}
10 11 100
In general, the meaning of X ++ is to divide the statement containing X ++ into two parts, for example:
A = x ++;
This statement can be viewed as follows:
A = X;
X = x + 1;
Because the work logic of adding 1 can be considered to be executed after the statement containing X ++ is completed.
++ X is relatively simple. Simply look at it as (x = x + 1). For example:
A = ++ X;
It can be viewed
A = (x = x + 1 );
The actual code can be written in this way, no difference.


Some irresponsible tests and articles may mention statements like I = I ++, which do not actually conform to the C/C ++ syntax. This is an undefined operation, undefined behaviour, the compiler can determine the actual result based on the situation, or even directly report an error.
I ++ and I both add I to 1. The difference is that the return value of I ++ is the value before 1, and the return value of ++ I is the value after 1.
3. Differences between references and pointers
After a pointer variable points to an object, it indirectly operates on the variable it points. When pointers are used in a program, the program has poor readability. The reference itself is the alias of the target variable, and the reference operation is equivalent to the operation of the target variable.
4. Function of ifconfig (manually start, observe and modify network interface parameters, including IP addresses and MTU size)
Ifconfig is a command used in Linux to display or configure network devices (network interface cards. Example of configuring the IP address of the NIC: ifconfig eth0 192.168.0.1 netmask 255.255.255.0
In the following example, D is not in the scope of the ifconfig command.
A. Configure the local loopback address
B. Configure the IP address of the NIC.
C. Activate the network adapter
D. Load the NIC to the kernel.
5. Int main (INT argc, char * argv [])
{
Struct A1
{
Int I1;
Int I2; // 4
Char C1;
Char C2; // 2
};
Struct A2
{
Int I3;
Char C3;
Char C4;
Int I4;
};
Struct A3
{
Char C5;
Short S1;
Short S2;
Char C6;
};
Printf ("% d, % d, % d \ n", sizeof (A1), sizeof (A2), sizeof (A3); // The answer is 12, 12, 8


Return 0;
}
6. Union {int I; char C; long l;} date;
Struct
{
Int I1;
Date D;
Char C1;
} T;
Printf ("% d \ n", sizeof (t) + max (date ));
The specific questions may not be remembered. This is generally the case.
7. What is the difference between a process and a thread?
A process is a running activity of a program with certain independent functions. A process is an independent unit for the system to allocate and schedule resources.


A thread is an entity of a process. It is the basic unit for CPU scheduling and scheduling. It is smaller than a process and can run independently. the thread itself basically does not have system resources, and only has a few resources (such as program counters, a set of registers and stacks) that are essential for running ), however, it can share all resources of a process with other threads of the same process.


One thread can create and withdraw another thread. multiple threads in the same process can be concurrently executed.


8. Models in software development
The waterfall model divides the software life cycle into six basic activities, including planning, demand analysis, software design, programming, software testing, and operation and maintenance, they also define a fixed order of top-down and interconnection, like waterfall flow, falling down step by step.
Rapid Prototype Model)
The first step of the rapid prototyping model is to build a rapid prototype to realize the interaction between the customer or the future user and the system. the user or the customer evaluates the prototype and further refine the Needs of the software to be developed.
By gradually adjusting the prototype to meet the customer's requirements, developers can determine what the customer's real needs are. The second step is to develop the customer's satisfied software products based on the first step.
Incremental Model)
In an incremental model, software is designed, implemented, integrated, and tested as a series of incremental components, each component is composed of code fragments that provide specific functions formed by multiple interacting modules. incremental models do not deliver a complete product that can run at each stage, but deliver a subset of products that meet customer needs.
Spiral Model)
The waterfall model and quick prototype model are combined to emphasize the risk analysis neglected by other models, which is especially suitable for large-scale and complex systems.
Fountain Model)
Also known as the object-oriented survival model and the OO Model)
Compared with the traditional structured survival model, the fountain model has more incremental and iterative properties, and each stage of the survival can overlap with each other and repeatedly, in addition, the sub-lifetime can be embedded throughout the entire life cycle of the project. Just like the water sprayed up and down, it can fall in the middle or at the bottom.
Intelligent Model (four generations Technology (4gl)
A smart model has a set of tools (such as data query, report generation, data processing, screen definition, code generation, high-level graphical functions, and workbooks ), each tool enables developers to define certain features of software at a high level and automatically generate the Software Defined by developers into source code.
Hybrid Model)
A process development model is also called a hybrid model or a meta-model. It combines several different models into a hybrid model, it allows a project to develop along the most effective path. This is the process development model (or hybrid model ). In fact, some software development units use several different development methods to form their own hybrid models.
Advantages and disadvantages of various models
The waterfall model document-driven system may not meet customers' requirements.
Quick prototype models that focus on meeting customer needs may result in poor system design, low efficiency, and difficult to maintain
Early feedback on Incremental Model Development is timely and easy to maintain. Open Architecture is required, which may result in poor design and low efficiency.
Risk-driven risk analysis personnel with spiral model must be experienced and well trained
9. What are the conditions for deadlock and how to avoid it?
1) mutex condition: A process schedules and uses the allocated resources. That is, a resource is only occupied by one process within a period of time. If there are other processes requesting resources at this time, the requester can only wait until the processes occupying the resources are released after use.
2) request and retention conditions: the process has maintained at least one resource, but has put forward new resource requests, and the resource has been occupied by other processes. At this time, the request process is blocked, however, you cannot release other resources that you have obtained.
3) Non-deprivation condition: resources obtained by a process cannot be deprived until they are used up. They can only be released after use.
4) loop wait condition: When a deadlock occurs, there must be a process-a circular chain of resources, that is, a process set {P0, P1, P2 ,???, P0 in PN} is waiting for resources occupied by P1; P1 is waiting for resources occupied by P2 ,......, PN is waiting for resources occupied by P0.
In the process of dynamic resource allocation, some methods are used to prevent the system from entering the insecure state, thus avoiding deadlocks.
10. output result:
Unsigned int I = 20;
Int J =-30;
If (I + j> 0)
Printf ("positive! \ N ");
Else
Printf ("not positive! \ N ");
32-bit CPU design for the 11.32-bit Operating System
12. The process has three states: C.
A preparation, execution, and exit
B. Exact state, fuzzy state, and random state
C running, ready, and waiting
D. Manual, auto-dynamic, and free state


13. Terminate the command and operation a that a foreground process may use.
A kill
B <Ctrl>; + c
C shut down
D halt


14. modify the program's incorrect question. If the program is incorrect, correct the question. If the program is correct, describe the function (soft control)
Void * Fun (char * SRC, int Len)
{
Char Dest [1024];
Memcpy (DEST, SRC, Len );
Return DEST;
}
15. How many SPI buses are there?
The basic signal line of Motorola's SPI bus is three transmission lines, namely Si, so, sck. The transmission rate is determined by the clock signal sck. Si is the data input and so is the data output.
16. output result analysis
# Include <stdio. h>
Class base
{
Public:
Base (int I );
~ Base ();
PRIVATE:
Int m_ I;
};
Base: Base (int I): m_ I (I)
{
Printf ("Step % d \ n", I );
}
Base ::~ Base ()
{
Printf ("Step % d \ n", m_ I );
}
Base base1 (5 );
Void main ()
{
Printf ("Step 1 \ n ");
Base * A = new base (4 );
Delete;
}
17. For some pointer questions, give a variable A, define integer variables, pointer variables, and so on.
18. Evaluation of Interrupt subroutines

Google Acoustic Test

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.