My Android Interview Road (II: New START)

Source: Internet
Author: User

Do not forget to always beginner's mind side

Just from the preaching will come back is a group of start-up organizations to do the propaganda meeting (VC to the host) a lot of people have difficulty in the resume and received the Beijing company phone call me phone interview (I hope to work in Beijing-) arranged the next specific time in short today from the early written test to the night busy bad yo

Don't find a job never know how hard it is to find a job it's like when you really want to fix the water pipe and find that I can bear the smell of crap. How can someone fix the plumbing?

Knowing yourself is an important step to knowing that your short board is great for learning. I'm not a Daniel, not an all-powerful Shen. But I know what I need to add.

Do not forget beginner's mind square to always last night do not know why think of this sentence anyway feel said to say the bull X also I write this blog also hope that a lot of people help me to find my problem has a problem I can be scolded stupid x can be scolded technical brain residue as long as I have some improvement on myself enough I love this world

Or that sentence do not forget beginner's mind Android is bound to go on so now start at the first interview I was asked the most one question

Is it-------------> "What is the relationship between process and thread"

Process and thread what exactly is I don't put Baidu know posted up

First of all, I'm going to talk about my thoughts.

Processes are used to process tasks such as giving a list of processes to the process to find the name Aifunwo.

Process thought I went to such a long list how to find AH send their men to the main line is like the staff, such as there are three lines Cheng three people together to find this unfortunate call Aifunwo

(Do not know the metaphor is inappropriate if inappropriate, please disregard-)

CPU---> This is the core of the computer. He'll count. (Load Compute tasks)

But it's an ordinary person who can only run one thing at a time

Process---> This is the only thing that the CPU can run one at a time.

When a process is running, other processes are not running

Thread---> A process can have many threads they work together to complete a task

The memory space of the process is shared for the threads they share these resources

But some of the shares are conditional and have only one thread to make a few threads with someone else who wants to use it.

To prevent people waiting to jump in the queue. And that's going to add a lock, like a room in a line, lock the door to prevent others from entering.

This lock is called a mutex to prevent multiple threads from writing a piece of memory at the same time

There are a few people with that how to do it in the doorway to put a few keys into the person to take a lock door to the door until the key wood there will not be able to enter the only brother to wait for

These keys are called semaphores to ensure that multiple threads do not conflict

    

The above is a summary of the process and thread explanation:

(Above and below are plagiarism Nanyi's blog "A simple explanation of process and thread" http://www.ruanyifeng.com/blog/2013/04/processes_and_threads.html)

  

1. The operating system allows multiple tasks to run concurrently in multiple processes

2. Allows tasks to be divided into different parts to run in multithreaded form

3. The operating system provides a coordination mechanism to allow a process to share resources between threads and processes on the one hand, and also to prevent conflicts between processes and processes and between threads and threads on the other.

  

In short, I can be proud of the interviewer to speak out my point of view (the first interview when stuttered know not to say-)

After this question, some interviewers ask me about the interprocess communication. Do you know how to communicate?

“.......”

Operating system teacher I'm sorry for you--

The way of interprocess communication is divided into pipeline shared memory semaphore signal Socket Message Queue

How do I use the inter-process communication in Android?

"In what I've done, intercepting a person's phone calls need to be passed to the dialing process to hang up the phone."

"This stuff is called Aidl (Android Interface defination Language) Android Interface Definition language (wood misspelled bar--| | )“

The interviewer must laugh at my English silently--because I'm not fluent.

Google can do it.

What about the thread?

Interviewer why is your so diao? Let me catch my breath.

"Communication between threads this is the message delivery mechanism MessageQueue, Loop, Handler."

"Handler handles the received message and the message queue that is sent MessageQueue each thread has a looper used to read the message in MessageQueue"

Yes, OK, okay.

PS: Said ok OK also can the interviewer with the hammer phone I also finally he returned to the desktop when found not to see a few eyes in the end still haven't seen the real machine hey (<---Say I wrote a hammer of the soft text)

    

Let's just point out my mistakes--

I thanked the gods first.

Wrote for a long time not to write the day is a new beginning ^_^

My Android Interview Road (II: New START)

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.