brunch

You can make anything
by writing

C.S.Lewis

by 이승현 Jun 03. 2016

안드로이드 면접 질문 #06

Android interview questions

Skillgun


Android receiver/content provider interview questions and answers


http://skillgun.com/android/advanced-android/interview-questions-and-answers



Question #01

What is empty process in android and what is its priority?

(empty process? 우선순위는?)

                              

   

Answer

Empty process - is an application which user is frequently visiting and closing. (Which resides in memory even after killing). To launch frequently visited app fastly, even after destroying that app, it will be still in memory so that loading time will be reduced and user feels more comfortable. That is called as empty process. its priority is 5 (Empty_Process). this is the last and least priority of an application or a process.

(Empty 프로세스는 유저가 자주 열고 닫는 어플리케이션이다. (종료 후에도 메모리에 남아있다). 자주 방문하는 앱을 빠르게 실행시키기 위해, 앱이 파괴된 후에도, 메모리에 남아 로딩 시간을 줄이고 유저가 더 편하게 느끼도록 한다. empty process라 부르고 우선순위는 5이다. 가장 마지막이고 제일 낮은 우선순위를 가지는 어플리케이션 또는 프로세스이다.)


When android device goes out of memory, to reclaim some memory android will start killing all the processes starting with least priority process. Empty process is the most susceptible process to be killed in case of low memory.

(안드로이드 기기의 메모리가 부족할 때, 메모리를 확보하기 위해 우선순위가 낮은 프로세스들을 종료하기 시작한다. Empty 프로세스는 우선순위가 가장 낮기 때문에 메모리 부족으로 인한 kill에 가장 취약하다.)


Question #02

Can I have more than one application in a given task?

(주어진 task에 하나 이상의 어플리케이션을 가질 수 있나?)

                              

   

Answer

- Task is a collection of apps that user traverse when performing some task.

(Task는 유저가 어떤 작업을 할 때 실행하는 앱들의 모음이다.)


eg: while sending message, he starts with messaging application, and may move to gallery or camera to attach some photo that message. in this scenario messaging and gallery are two different apps. but for user he is doing single task only.

(message를 보낼 때, messaging 어플리케이션을 시작하고 사진 message를 보내기 위해 gallery나 카메라로 이동 해 사진을 첨부할 것이다. 이 시나리오에서 messaging과 gallery 두 개는 서로 다른 app이다. 그러나 유저는 단지 하나의 task만 하고 있다.)


Question #03

Can I have more than one process in a given task?

(주어진 task에 하나 이상의 프로세스를 가질 수 있나?)

                              

   

Answer

Apps and process is same. Task is a collection of one or more applications. App means process, so task can contain multiple processes.

(App과 프로세스는 같다. Task는 하나 이상의 어플리케이션들의 모음이다. 앱은 프로세스를 의미하기 때문에 task는 여러 개의 프로세스를 가질 수 있다.)


Question #04

Do all the activities and services of an application run in a single process?

(어플리케이션의 모든 엑티비티와 서비스들은 하나의 프로세스에서 실행시킬 수 있나?)

                              

   

Answer

Activities, services and other components of an applications runs in single process. there can be some situations where we can allow a component of application to run in a different process. but this is possible only if user id of those two different processes are same.

(어플리케이션의 엑티비티, 서비스 그리고 다른 component들은 하나의 프로세스에서 실행할 수 있다. 어플리케이션의 component는 다른 프로세스에서 실행될 수 있는 상황이 있을 수 있다. 그러나 다른 두 프로세스들의 user id가 동일한 경우에만 가능하다.)


Question #05

What is sleep mode in android? What will happen to CPU once screen (LCD) light goes off?

(sleep mode? 화면이 꺼지면 CPU에는 어떤 일이 일어나는가?)

                              

   

Answer

There is small difference in power consumption when you compare a phone with laptops. Laptops most of the times runs on direct power through charger. (Mostly we carry charge with laptop). Mobiles mostly run on battery power. (Rarely we carry charger with us). By keeping this in mind, android has designed in a such a way that, phone will not consume battery power if user is not interacting with the phone.

(폰과 노트북 사이에 전력 소모는 작은 차이가 있다. 노트북은 대부분 충전기의 전원을 통해 작동합니다. (대부분 충전기를 휴대한다.) 모바일은 대부분 배터리 전원을 통해 실행한다.(거의 충전기를 휴대하지 않는다.) 이 점을 염두에 두고, 안드로이드는 사용자가 폰과 상호작용하지 않으면 배터리 전원을 소모하지 않도록 설계했다.)


This is to increase battery back up time for user. Thats why when LCD screen power is off (that means user is not interacting with phone), with in fraction of seconds CPU will also go to a mode (sleep mode) where it does minimal work and saves battery power. When CPU is in sleep mode, it accepts commands only from RIL (radio interface layer) which is basically sms and call functions, and alarms. Other than this CPU will stop executing other applications functions.

(이는 배터리 백업 시간을 증가시켰다. LCD 화면 전원을 끄고(사용자가 폰과 상호작용하지 않는다는 걸 의미한다.) 수초 이내에 CPU 또한 최소한의 작업을 수행하고 배터리 전원을 아끼기 위해 sleep mode로 가는 이유이다. CPU가 sleep mode 일 때, 오직 sms, call, alarm 같은 기초적인 RIL로부터 온 명령만을 수행한다. 이 이외의 다른 응용 프로그램의 실행은 중지한다.)


Note : If any application wants CPU time for its emergency work when CPU is in sleep mode, then it can request CPU time by using WAKE LOCKS.

(CPU가 sleep mode일 때, 긴급한 작업을 위해서는 WAKE LOCKS를 이용해야 한다.)


For eg : MP3 application has to keep playing songs in its service, even though user has turned off LCD screen. That means MP3 application's service has requested CPU time by using WAKE LOCKS.

(MP3 어플리케이션은 LCD 화면이 꺼져있더라도, 서비스에서 노래를 계속 연주해야 한다. 즉 MP3 어플리케이션의 서비스는 WAKE LOCKS을 이용해 CPU 이용을 계속 요청했다는 것을 의미한다.)


Question #06

When phone is in sleep mode, what are the two components that will keep running even though phone is in sleep mode?

(sleep 모드이더라도 계속 실행 중인 component 2가지는?)

                              

   

Answer

Complete RIL layer( SMS, Data pockets, and Calls) & alarms will be still running even in sleep mode also.

(RIL layer 전체와 alarm은 sleep 모드일 때도 계속 실행 중일 것이다.)


Question #07

If I want to write one application for both phones and tablets, what should I use in my UI?

(하나의 어플리케이션을 폰과 태블릿에서 동시에 쓰고 싶으면 어떤 UI를 써야 하나?)

                              

   

Answer

1. Use fragments where ever it is possible.

(Fragment를 써라.)


2. Use Dps instead of pixels.

(픽셀 대신 DPs를 써라.)


3. Use xhdpi images as well.

(xhdpi 이미지들을 써라.)


4. avoid giving margins based on pixels, rather use margins with respect to parent.

(픽셀을 기반으로 margin을 주지 말고, 부모에 대한 margin을 써라.)


5. Use SPs for font sizes.

(폰트 사이즈에는 SPs를 써라.)


6. Use 9 patch images always.

(항상 9 patch 이미지들을 써라.)


Question #08

What is android ndk?

(ndk?)

                              

   

Answer

i. The NDK is a toolset that allows you to implement parts of your ANDROID app using native-code languages such as C and C++.

(NDK는 C, C++ 같은 native 코드 언어를 이용하여 안드로이드 앱을 개발하도록 하는 toolset이다.)


ii. using native code on Android generally does not result in a noticable performance improvement, but it always increases your app complexity. In general, you should only use the NDK if it is essential to your app.

(일반적으로 안드로이드에서 native 코드를 이용하여 눈에 띄는 성능 향상이 일어나지 않지만 항상 앱의 complexity를 증가시켜 준다. 일반적으로 꼭 필요한 경우에만 NDK를 써야 한다.)


iii. A good example for using NDK can be a CPU intensive works which doesn't allocate much memory like signal processing, physics simulation etc.

(NDK를 사용하는 좋은 예는 신호 처리, 물리 시뮬레이션처럼 많은 메모리를 할당하지 않는 CPU 집약적인 작업이 될 수 있습니다.)


Question #09

Which of the important device characterstics that you should consider as you design and develop your application?

(어플리케이션을 설계하고 개발할 때 중요시해야 하는 기기 특성은?)

                              

   

Answer

i. Screen Size and Density (스크린 사이즈와 밀도)

ii. Input Configurations (입력 구성)

iii. Platform Version (플랫폼 버전)

iv. Device Feature (기기 특징)


Question #10

What are the characteristics of Loaders?

(Loader의 특징들은?)

                              

   

Answer

i. They provide asynchronous loading of data.

(데이터 비동기 로딩을 제공한다.)


ii. They are available to every activity and fragment.

(모든 activity와 fragment에서 쓸 수 있다.)


iii. They monitor the source of their data and deliver new results when the content changes.

(데이터의 소스를 관찰하고 content에 변화가 생기면 새로운 결과를 알려준다.)


iv. They automatically reconnect to the last loader's cursor when being recreated after a configuration change. Thus they don’t need to requery their data.

(configuration 변화로 인해 재생성되면 자동으로 마지막 loader의 cursor로 재연결한다. 따라서 데이터를 다시 쿼리 할 필요가 없습니다.)


Question #11

What is JNI?

(JNI?)

                              

   

Answer

Java Native Interface that enables Java to call native application written in C, C++.

(C, C++로 작성된 native 어플리케이션을 호출할 수 있는 Java Native Interface.)





매거진의 이전글 안드로이드 면접 질문 #05
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari