Monday 20 February 2017

interview in android , Android InterView Question And Answer





  An interview in android ,   best Answered .


 Raj  is having , 0 - 2  years , experience as a programmer , in  android

He is having a technical round , lets see how clearly he replies to questions.


 Interviewer Started by  asking : "   Explain the Aplatform  architecture of android. "

 
 

   Raj replied "
   

 Android is an open source, Linux-based  ,software stack   .
 Android is an  open  source, Linux-based software stack. It comprises of Linux Kernal ,  Hardware Abstraction Layer. Native Libraries, Android RunTime, Java APIs , System Apps.
Below Of Stack  is : The Linux Kernel : , Linux kernel  provides drivers for connecting to hardware.
  The hardware  abstraction layer (HAL) ,  provides a standard interfaces , that interact  with Kernal drivers , to access hardware  features.
 Android Run Time , is written , to  run multiple virtual  machines  , on  low-memory devices  , by executing DEX files .     
For devices running Android version  5.0 (API level 21) or higher, each app runs in its own process and with its own instance of the Android Runtime (ART).
Prior to Android version 5.0 (API level 21),  Dalvik was the Android runtime

 Native C/C++  Libraries 
Android components  such as ART and HAL, are built from native code that  require native libraries written in C and C++.  Android provides Java APIs  to use functionality of native  libraries to apps ..  Java API Framework  Java APIs form the building blocks you need to create Android apps by providing components and  services. System Apps
Android comes with , a set of core apps , for  email , SMS messaging ,  calendars,  internet browsing , contacts , and more. "


InterViewer : "good! very well explained. Can u explain activity  lifecycle ? "



Raj Replied "

 Yes Sure..
An activity has essentially four states:
 If an activity is in the foreground of the screen  , it is active or running.
 If an activity , has lost focus  , but is still visible , (like in case of dialog comes top), then it is paused.
 If an activity is completely  obscured by another activity, it is stopped. It still retains all state and member information.
 If an activity is paused or stopped, the system  can drop the activity  from memory by either asking it to finish, or simply killing its process.


So , when the activity  is first created its onCreate()  method   gets called .

   onStart()  get called after onCreate() when the activity is becoming visible  to the user.


After it onResume() is being called when the activity will start interacting with the user.

 onPause() is called when the system is about to start resuming another activity  or when its looses  focus like when some dialog comes top of it.


 onStop()  called when  the activity is no longer visible to the user,  because another  activity  has been resumed and is covering this one.

 onRestart() is called  if this activity is coming  back to interact .


 If the activity is  finished , the final  call activity will  recieve  is onDestroy().
That  completes whole activity cycle."


Interview : "Thats excellent !"


Interview : "

Lets say ,there are three  activities A , B , C each having button to  start activity  without finishing  in order
A start’s B,
B start’s C,
C start’s A.
Can  you show me what all  set of lyfecycle method gets  called  while navigation  from
 A to B,

 B to C,

 C to A
 "


 Raj Replied :

 "
 Ok.
When Activity A  started , its onCreate() , onStart(), onResume() , gets called in order
  When Activity  B  started , A : onPause() gets called , then  B:  onCreate() , onStart(), onResume() gets called in order
  When Activity  C  started , B : onPause() gets called then  C:  onCreate() , onStart(), onResume() gets called in order , then B: onStop()
   When again  Activity A started from C ,   As A was not  destroyed      So  first C: onPause()    gets called then     A:  onRestart() , onStart(), onResume() ,  gets called in order then   C: onStop() . "


   

   InterViewer : "  Thats  excellent ! "


InterViewer : "   What  is Service in android  and what are their types? "


Raj Replied : 


"A Service is an application component that can perform long-running operations   in the background, and it does not provide a user interface.
These are the three different types of services: Scheduled , Started , Bound

 A service is  scheduled when  an API such as the JobScheduler   , launches   the service.


 A service is started  when an application component (such as an activity) calls  startService().  


After service  started, it can  run in the background  indefinitely,  even if the component that started it is destroyed.
It is stopped by stopService() method. The service can stop itself by calling the  stopSelf() method.


  A service is bound when an   application component binds to it by calling bindService().
A bound service offers a  client-server interface that allows  components to interact with  the service, send requests,  receive result.
The client can unbind the service by calling the unbindService()  method.
The service cannot be stopped until all clients unbind the service. "



Inteviewer : " Good  Nicely explained. "



Inteviewer : " Can  you  explain   by any  real time  example   when to use  bindservice  or  start service . "


Raj Replied  :

" Yes Sure ! ,
Suppose, I want to play  music in the background , so call startService() method.
But I want to get information of the current song being played,
I will bind the service that provides information about  the current song.  "


InterViewer : " Ohh! Very ,  Good  Example "


InterViewer : "Ok Tell Me , What is the difference between , Service  and Intent Service. "


Raj Replied  :

" Service  is the base class for all services.
Once the service is started, the onStartCommand  , method in the service is called.
It passes in the Intent object from the  startService(intent) call.
If startService(intent) is called while the service is  running, each time  its  onStartCommand() is also called.
Therefore  it's important to create a new thread each time in onStartCommand  in which the service can complete all of its work for that particular intent recieved.



While   IntentService  is a subclass of Service , Creates a work queue ,  that passes , one intent at a time ,  to your onHandleIntent() implementation, so you never have to worry ,  about  multi-threading. "


InterViewer : "  Very Nice. Now tell me , What is an  Intent  in android ? "


Raj Replied  

:" An Intent is a messaging object  ,used to request an ACTION  to performed by  application component such as Activy , Service , Broadcast Reciever  etc. "


InterViewer : "  Very Nice.  And whats the difference between Implicit Intent and  Explicit Intent  ? "


Raj Replied  :

" Explicit intents specify  the component to start by its name (that is , fully-qualified class  name)
 for example :  you can start a  any new activity   by its name or start a service  by its name  to download a file in  the background.

 Implicit Intents do not directly  specify the  Android components which should be called , it only specifies action to be  performed , which also  allows a component from another app to handle it . "
 

InterViewer : "  Very Nice. what  is   Broadcast Reciever in Android ? "


Raj Replied  :

"    Broadcast receivers  are components in the application that listen  for  broadcasts and take some action.
              for example, building a broadcast receiver to listen  for the battery getting low  broadcast event in order to inform the user  that unsaved data  should be saved quickly
.
"



InterViewer : "  Good! , and how many ways app can send Broadcast ? "


Raj Replied  :

"    Android provides three ways ,      for apps to send broadcast:
    first is  sendOrderedBroadcast ,

  second is thorugh  sendBroadcast   method , 

 third is through  LocalBroadcastManager     method sendBroadcast .
     The sendOrderedBroadcast   method sends  broadcasts to one   receiver at a time.
As each receiver executes  in turn, it can propagate a result to the next receiver, or it  can completely abort the broadcast  so that it won't be passed to other receivers.


 The sendBroadcast method  sends broadcasts to all receivers  in an undefined order.


  The LocalBroadcastManager method sendBroadcast , sends broadcasts to receivers that are in the same app as the sender. If you don't need to send broadcasts  across apps, use local broadcasts.
  "


InterViewer :
"   Good!  , You  Have Very Well Answerd to  All Your Question. "

Thursday 26 January 2017

why did you leave your last job ? experience interview reply



Interviewer Asked : 

"Why did you leave your last job ?  "  


Remember 

 Interviewer  Asked this question :   because  interviewer is likely looking for:
     

Did he leave for a good reason?  the interviewer will wonder if they can trust you to be responsible, loyal, and reasonable.  

  Did he leave  because of performance or integrity issues.  

Did he leave for positive reasons or because he felt slighted or unappreciated?



Candidate Reply :

"I have been at my company for three years now and have learned a lot from working with excellent developers and creative peoples .  In that period , i have been promoted many times and has been appreciated for my efforts and excellent problem solving skills. I have been thinking for a while that I’d like to work for a bigger company with more opportunities for growth. This position really appeals to me , because of my successful background in development and research  and to work with team to bring out more innovative products."


Things to Understand is :

First, this candidate reminds the interviewer that he has had a respectable tenure at his firm and has been promoted .

Next, he shares a positive reason for wanting to leave — he wants to take on new challenges, he wants to stretch himself. 


So interviewer finds positive reason for leaving last job


Sunday 22 January 2017

Tell me something about your self interview , best interview introduction




Interviewer Asked :

"Tell me something  about your self "

Ultimate goal for this interview is to find out enough about you to decide if you’re a good fit for the job opening that he is being paid to fill.


Candidate Reply :

" I have more than 5 years of experience in product development  as a programmer .   I have been part  of Research  and development  and  and excellently comes out with solution for given complex problem .  i have also been in a team of product strategy in bring out product to market and making different channels to make reach product to  different users  and users engagement. I’m a person who thrives in a fast-paced environment so right now I’m looking for an opportunity  to apply my technical exp and my creative problem solving skills at an innovative software company like this one."


Things to understand is
 He starts by describing an impressive recent project that HR can assume is very  relevant to the work required  in the open position. Next, he spends time talking
about why he is  interested in this company/role, using the terms fast-paced, creative,
 problem solving, and innovative.
 This is great if those words are used in the job description and/or company values.



Wednesday 18 January 2017

Where Do You See Yourself in Five Years , interview answer



Where Do You See Yourself in Five Years? - best reply to Interviewer


 Interviewer Asked , Where do you see your self in five years ?


 Remember , Interviewer wants to know about his career goals because she want’s to hire someone who is motivated, proactive, and likely to stick around and work hard if hired.


 candidate reply :   

" My goal right now is to find a position at a company where I can grow and take on new challenges over time. Ultimately, I’d like to assume more management responsibilities and get involved in product strategy. But most importantly, I want to work for an organization where I can build a career." 


 As This answer offers some insight into the candidate’s goals and interests (becoming a manager, being involved in product strategy) so it’s not too generic. This response also strongly expresses a desire for a long-term career with the company.


 So Interviewer , finds him very positive for this position.



Sunday 1 January 2017

Lifting Glass Of Water Without Touching it. ...... tcs interview , bank interview , mnc interview , iim interview



A panel of three interviewers siting in an interview room.


 One of interviewer after few questions asked .....

      " Lift the glass of water in front of you without touching it. "



Candidate Said :

"Sir I can't see any glass of water in front of me..(calmly) "

Interviewer  

"We three interviewers can see it why can't you. "

Candidate Said :

" Sorry sir but I really can't see it.(very calmly)"

Interviewer  :

 (bit frustrated) "Are you blind?  When three of us can see it why the hell you can't...."

Candidate Said :

 " (Calmly again.. ) Sorry sir.. Believe me I can't see any glass of water."

Interviewer  :

  "  (The frustrated interviewer holding the glass of water and lifting it says) Can't you see this glass of water and starts to laugh with other two interviewers. haha....     "

Candidate Said :

"Sir The glass of water is lifted without me touching it. Thank you. "

.............................

Interviewer were impressed ,... finally they select him too.

Monday 26 December 2016

Interview By Boss to Select One From Poster , TCS interview , SSC Interview



Asked to Select One Of these ... interview by boss

 Boss is taking screening round 


 Boss Asked

"Take a look at the poster behind me.
    "Notice there is a beautiful girl, a bottle of expensive wine, and an expensive car; if you could only choose one of the three items, which would you choose and why? "

Candidate briefly looked at the poster. 


 CAndidate replied : 

    " I will choose the car because if I can afford a Ferrari I can definitely afford the bottle of wine and I’ll always attract beautiful girls with a lifestyle like that."


     Boss Said ,

 "Nice to see your decision. You are good in decision. Great. "


 He was selected . for his good decision and clear explanation.



Tuesday 20 December 2016

Interview Question : Finding Number Of Cars in City


Finding Total Number Of Cars ..... interview


Interview was going on .... then one interviewer asked :


One Interviewer Asked: Assume that the population of Delhi is 2 crores (20 million)


How many number of car are there in Delhi City?


...........................................................

( Candidate) she get it quickly that this is a type of guesstimate. 


There is no correct/incorrect answer in this case and the interviewer usually wants to see thought process in such question.

Candidate Replied : 


As the population of Delhi is 2 crores (20 million)

Let the average family size in Delhi be 4 So the number of households can be estimated to be 50 lakhs (20/4 million)

Now, let us assume that only 50 - 60% of the population can afford a car.

 For simplicity, assume that 50% of the families owns one or more cars.
So 25 lakh households own 1 or more cars

Let us assume that of these, 75% own only 1 car , 20% own 2 cars and 5% own 3 cars (assuming no household has more than 3 cars)


So households with 1 car = 18.75 lakh(1.875 million) 2 car = 5 lakh (500,000) 3 car = 1.25 lakh ( 125,000)


So total number of cars in delhi can be estimated as 18.75 + 5*2 + 1.25*3 = 32.5 lakh which can be rounded off to 32 lakh (3.2 million)


So we can estimate that the number of cars in Delhi to be 32 lakh (3.2 million).

------------------------------------------------------------------------------------------------------------

Interviewer gave her good scores for her thought process

Search Any topic , section , query