ACE CA
BAN USER- 0of 0 votes
AnswersAs a member of the cab finder app team, you are tasked with implementing a CabFinder class that has the following minimal public interface:
- ACE CA in United States
class CabFinder implements CabStatusListener {
/**
* Initiates CabFinder. Called only once per app startup.
* @app An application object providing services implemented by
* the rest of the application.
* @maxCabs Nearest number of cabs that can be returned to the user
*/
public void initialize(CabApp app, int maxCabs) {
//Insert code here...
}
/**
* Gets nearest cabs within 1km of the current user’s location.
* These must be the *nearest possible* @maxCabs in the 1km area.
* @return An unordered list of the nearest cabs.
*/
public Cab[] getNearestCabs() {
//Insert code here...
}
/**
* Asynchronous Callback per CabStatusListener (see below). Called when the position of a cab has changed.
*/
void onCabPositionChanged(Cab cab) {
//Insert code here…
}
/**
* Asynchronous Callback per CabStatusListener (see below). Called when a cab’s availability changes.
* @cab The cab whose availability has changed
* @isAvailable true if the cab is now available, false otherwise
*/
void onCabAvailabilityChanged (Cab cab, boolean isAvailable) {
//Insert code here…
}
}
Supporting Classes:
Here are the classes and utilities that are available for your use (you are not required to write any implementation for these classes)
/**
* Coordinates on a 2D map with a one meter granularity.
*/
class Position {
public int x;
public int y;
}
interface Cab {
/**
* Unique identifier of a cab.
*/
int getID();
/**
* Gets the current position of the cab
*/
Position getCabPosition();
/**
* Returns whether or not the cab is available
*/
boolean isAvailable();
}
/**
* Provides services implemented by the rest of the Cab Application.
*/
interface CabApp {
/**
* Gets the current location of the user
*/
Position getUserPosition();
/**
* Returns an iterator that gives access to the list of all cabs in the city
*/
Iterator<Cab> getCabs();
/**
* Registers a CabStatusListener object for change notifications of cab object data.
*/
void register(CabStatusListener listener);
}
/**
* The CabStatusListener interface
*/
interface CabStatusListener {
/**
* Called when the position of a cab has changed.
* @cab The cab object
*/
void onCabPositionChanged(Cab cab);
/**
* Called when a cab’s availability changes.
* @cab The cab object
* @isAvailable true if the cab is available, false otherwise
*
*/
void onCabAvailabilityChanged (Cab cab, boolean isAvailable);
}| Report Duplicate | Flag | PURGE
Java
- 1 Answer Best resource to understand asymptotic analysis or time complexity.
I am having a hard time understanding the calculations for time complexity/asymptotic analysis. I tried referring possible algorithm books I could i.e. Cormen, Steven Skiena and few others. I just don't want to memorize the time complexity of every algorithm to clear the interviews, but wish to understand how to come up with the time complexity.
- ACE CA April 27, 2015
Please let me know what is the best way to learn and understand time complexity.| Flag | PURGE - 0 Answers Writing code on white board/paper.
I am looking for a job switch and hence preparing for my interviews. Now working in an organization, I am very much used to IDE's. I have given a few online interviews and I find it difficult to write the code without using any IDE. Even writing down a simple program of linked list. Also usually the interviewers doesn't allow you to write the code using an IDE first and then paste it online.
- ACE CA November 21, 2014
How do you guys practice for such interviews? Do you practice the code on paper first?| Flag | PURGE - 1 Answer Writing code on white board/paper.
I am looking for a job switch and hence preparing for my interviews. Now working in an organization, I am very much used to IDE's. I have given a few online interviews and I find it difficult to write the code without using any IDE. Even writing down a simple program of linked list. Also usually the interviewers doesn't allow you to write the code using an IDE first and then paste it online.
- ACE CA November 21, 2014
How do you guys practice for such interviews? Do you practice the code on paper first?| Flag | PURGE - 0 Answers Writing code on white board/paper.
I am looking for a job switch and hence preparing for my interviews. Now working in an organization, I am very much used to IDE's. I have given a few online interviews and I find it difficult to write the code without using any IDE. Even writing down a simple program of linked list. Also usually the interviewers doesn't allow you to write the code using an IDE first and then paste it online.
- ACE CA November 21, 2014
How do you guys practice for such interviews? Do you practice the code on paper first?| Flag | PURGE - 0 Answers Writing code on white board/paper.
I am looking for a job switch and hence preparing for my interviews. Now working in an organization, I am very much used to IDE's. I have given a few online interviews and I find it difficult to write the code without using any IDE. Even writing down a simple program of linked list. Also usually the interviewers doesn't allow you to write the code using an IDE first and then paste it online.
- ACE CA November 21, 2014
How do you guys practice for such interviews? Do you practice the code on paper first?| Flag | PURGE - 0 Answers Writing code on white board/paper.
I am looking for a job switch and hence preparing for my interviews. Now working in an organization, I am very much used to IDE's. I have given a few online interviews and I find it difficult to write the code without using any IDE. Even writing down a simple program of linked list. Also usually the interviewers doesn't allow you to write the code using an IDE first and then paste it online.
- ACE CA November 21, 2014
How do you guys practice for such interviews? Do you practice the code on paper first?| Flag | PURGE - 5 Answers Need advice on programming languages to use for interview.
Hi,
- ACE CA May 08, 2014
I have been working as an iOS developer since last couple of years and haven't been doing much with Java and C++. I worked on some projects in school 2 years back using c++ and so its still refresh in my mind. However its been 8 years now since I touched Java.
I tried writing code in objective c for some of the company interviews and I felt like the interviewer were not much happy with it. They told me that they don't know objective c and hence along with my code logic I had to explain them little bit about the language as well.
Does it matter which language you code in as long as it's an OO language? Does the company have language preferences or should C++ work for most of the interviews?
My plan is to brush up my C++ knowledge and start practising the coding problems using C++. I wish to learn Java to learn developing Android apps, but I think it would be nice to get sharp in atleast 1 language first along with clearing out mu data structure basics.| Flag | PURGE - 1 Answer Where to start?
Hello, I am looking to change the job and not sure from where should I start? I am presently working as a software developer and am looking forward for a challenging job in some big organizations in US itself. Right now I am kind of off with the basics as I am not using it on daily basis for my present job. I have already been through 2 interviews, one with Google and other with Amazon and both were coding interviews dealing with time complexities as well and I did worst in both of them in terms of choosing a correct way to solve the problem. Few people suggested me to start reading 'Cracking the Coding interview' and similar books but I am still confused as to whether should I directly start with those books or read and clear my basics first since its too long I have been through them? Could someone please help suggest me a good plan to start with?
- ACE CA January 13, 2014| Flag | PURGE
You have to write code for it too? If it's just the test case in words then you can check for:
- ACE CA October 21, 2014- the 16 digits on credit card number.
- 3 digit cvv number.
- valid zip code for the credit card.
- Option to select master, visa, american express or other service providers works properly.
- The credit card number is a valid combination of number i.e. it cannot be a series of 16 digit number such as 1111 1111 1111 1111 or 4444 4444 4444 4444.