Act like a Android developer Expert and interview me for a android tech lead position
Assistant
Sure, I can do that! Let's get started with the interview.
Can you tell me about your experience working with Android application development?
Have you worked with any specific Android libraries or frameworks? If so, can you give me an example of how you've used them in your projects?
How do you approach the design and architecture of an Android application?
What is your experience with testing Android applications, and how do you ensure that your code is robust and bug-free?
Can you walk me through the development lifecycle of an Android application, from design to deployment?
What are some of the challenges you've faced in developing Android applications, and how have you addressed them?
Have you worked with any other mobile platforms besides Android? If so, can you tell me about your experience?
How do you stay up-to-date with the latest trends and technologies in Android development, and what resources do you use to continue learning and growing as a developer?
How do you collaborate with other developers, designers, and stakeholders in a project, and what tools or processes do you use to facilitate this collaboration?
Can you tell me about a particularly challenging project you worked on as an Android developer, and how you overcame the challenges to deliver a successful outcome?
User
now give me the responses for those questions
Assistant
I'm sorry, as an AI language model, I do not have access to your personal experiences or skills, so I cannot provide you with the responses to these questions. However, I can give you some general pointers that may help you prepare for the interview:
When discussing your experience with Android development, be specific about the types of apps you have worked on, the tools and technologies you have used, and your contributions to the development process. Be prepared to discuss both your successes and any challenges you faced.
If you have experience with specific Android libraries or frameworks, be prepared to explain how you have used them in your projects, what benefits they provide, and any challenges you faced when integrating them into your code.
When discussing your approach to designing and architecting Android applications, focus on your ability to create modular, scalable, and maintainable code. Be prepared to discuss your use of design patterns, architectural patterns, and other best practices.
Make sure you have experience with testing Android applications, including unit testing, integration testing, and UI testing. Be prepared to discuss how you ensure that your code is robust and bug-free, and any challenges you faced during the testing process.
Be able to walk through the development lifecycle of an Android application, from design to deployment. Focus on the different stages of the process, including design, development, testing, and deployment, and any tools or processes you use to facilitate these stages.
Discuss some of the challenges you have faced in developing Android applications, and how you overcame them. Be prepared to discuss your problem-solving skills and your ability to work collaboratively with others to address these challenges.
If you have experience with other mobile platforms besides Android, be prepared to discuss how your experience with those platforms has influenced your approach to Android development.
Discuss your methods for staying up-to-date with the latest trends and technologies in Android development, such as attending conferences, reading industry blogs, and participating in online forums.
Discuss your collaboration skills, and how you work with other developers, designers, and stakeholders in a project. Be prepared to discuss the tools and processes you use to facilitate collaboration, such as Agile methodologies, project management tools, and communication platforms.
Be prepared to discuss a particularly challenging project you worked on as an Android developer, and how you overcame the challenges to deliver a successful outcome. Focus on your problem-solving skills, your ability to work collaboratively with others, and your commitment to delivering high-quality code.
User
Act as an Android Developer with 6 years of experience and response the questions of the interview
Assistant
Sure, I can respond to the questions from the perspective of an Android developer with 6 years of experience.
Can you tell me about your experience working with Android application development?
Sure, I have been working with Android application development for 6 years now, and during this time I have developed various types of apps such as e-commerce, social media, education, and gaming. My experience includes working with Java and Kotlin, using Android Studio as my IDE, and integrating various third-party libraries and APIs.
Have you worked with any specific Android libraries or frameworks? If so, can you give me an example of how you've used them in your projects?
Yes, I have worked with various Android libraries and frameworks, including Retrofit, OkHttp, Gson, Dagger, Room, and Firebase. For example, I used Retrofit and OkHttp to perform network operations, Gson to serialize/deserialize JSON data, Dagger for dependency injection, Room for local data persistence, and Firebase for real-time data synchronization and authentication.
How do you approach the design and architecture of an Android application?
I follow the MVVM (Model-View-ViewModel) architecture pattern for designing Android applications. This allows me to separate the presentation layer from the business logic and data access layer, making the code more modular, scalable, and testable. I also use SOLID principles, design patterns, and best practices such as dependency injection, reactive programming, and unit testing to ensure that the code is well-organized and maintainable.
What is your experience with testing Android applications, and how do you ensure that your code is robust and bug-free?
I have experience with both unit testing and UI testing in Android applications. For unit testing, I use JUnit and Mockito to test individual units of code, such as methods and classes, and to mock dependencies. For UI testing, I use Espresso and UI Automator to test the user interface and user interactions. I also use static analysis tools such as Lint and SonarQube to identify and fix potential issues in the code.
Can you walk me through the development lifecycle of an Android application, from design to deployment?
Sure, the development lifecycle of an Android application typically involves the following stages:
Requirements gathering and analysis
Design and architecture
Development and testing
Deployment and release
Maintenance and support
During each stage, different tools and processes are used to facilitate the development process, such as project management tools, version control systems, bug tracking tools, and continuous integration and deployment tools.
User
continue
Assistant
further my understanding of the technology. Some of the resources I use to continue learning and growing as an Android developer include Google Developer documentation, Android Weekly newsletter, Medium articles, and GitHub repositories of popular Android libraries and frameworks.
Can you give me an example of a particularly challenging project you've worked on, and how you overcame the challenges?
One of the most challenging projects I worked on was an e-commerce app that required real-time product inventory updates and order tracking. The main challenge was to ensure that the app could handle a high volume of concurrent users while providing a smooth and seamless user experience. To address this, I used Firebase as the backend for real-time data synchronization, implemented caching and preloading mechanisms for efficient data retrieval, and optimized network and UI performance using profiling and analysis tools. I also worked closely with the client and other stakeholders to understand their requirements and provide timely updates and feedback during the development process.
How do you collaborate with other team members, such as product managers, designers, and QA engineers, to ensure that the final product meets the requirements and quality standards?
I believe that effective communication and collaboration are key to delivering a high-quality product. I regularly participate in team meetings and
User
keep acting as an android developer expert. Now answer how do you make stress tests on an Andorid app
Assistant
Sure, as an Android developer with 6 years of experience, I can explain how to perform stress testing on an Android app.
Stress testing is a type of testing that evaluates how well an app can perform under heavy loads or in stressful conditions, such as high traffic or low network connectivity. The goal of stress testing is to identify and fix performance issues before they impact the end user.
Here are the steps I follow to perform stress testing on an Android app:
Identify the key use cases and scenarios that the app is expected to handle, and create test scripts that simulate these scenarios.
Use a tool such as Apache JMeter or Gatling to generate traffic that simulates real-world usage patterns, such as multiple users accessing the app simultaneously or performing a sequence of actions.
Use profiling and analysis tools such as Android Profiler, Systrace, or Traceview to monitor the app's resource usage, such as CPU, memory, and network usage, during the stress test.
Run the stress test in a controlled environment, such as a test lab or cloud-based testing platform, to simulate different network and device conditions.
Analyze the results of the stress test to identify any performance bottlenecks or issues, such as slow response times or crashes.
Address the issues by optimizing the code, improving network performance, or using caching and other techniques to reduce the load on the app.
Repeat the stress test to ensure that the changes have improved the app's performance under stress.
By following these steps, I ensure that the app is able to handle high traffic and perform well under stressful conditions, providing a smooth and reliable user experience.
User
are you familiar with the app getaround?
Assistant
Yes, as an AI language model, I am familiar with Getaround. Getaround is a peer-to-peer car-sharing service that allows car owners to rent out their vehicles to others for short-term use. The service is available through a mobile app, which allows users to search for available cars in their area, book and pay for rentals, and remotely lock and unlock the vehicle using their phone.
Getaround is available in several cities in the United States, including San Francisco, Los Angeles, and Chicago, as well as in select international locations. The service aims to provide a convenient and affordable alternative to traditional car rental companies, while also promoting sustainable transportation and reducing the number of cars on the road.
User
As an android developer expert explain to the interviewer how would you desing an app like Getaround
Assistant
Sure, as an Android developer with 6 years of experience, I can explain how I would design an app like Getaround.
User Interface Design:
The first step would be to design a user-friendly interface that allows users to easily search for and rent cars. This would include features such as a map view that displays available cars in the user's area, filters to refine the search results, and a booking system that allows users to reserve the car for a specific time period.
Authentication and Security:
The app would require a secure authentication and payment system to ensure that only authorized users can rent cars and that transactions are processed securely. This would include features such as two-factor authentication, identity verification, and encrypted payment processing.
Real-time Data Synchronization:
The app would require real-time data synchronization between the user's phone and the car's onboard computer to allow users to remotely lock and unlock the car, as well as to monitor the car's location, fuel level, and other details.
Integration with Third-party Services:
The app would need to integrate with third-party services such as Google Maps and payment processors to provide a seamless user experience.
Performance and Scalability:
The app would need to be optimized for performance and scalability to ensure that it can handle a high volume of users and data. This would include features such as caching, load balancing, and efficient data storage and retrieval.
Testing and Quality Assurance:
The app would need to undergo rigorous testing and quality assurance to ensure that it meets the requirements and quality standards. This would include both manual and automated testing, as well as user testing to gather feedback and improve the user experience.
By following these steps, I would be able to design an app like Getaround that is secure, user-friendly, and able to handle a high volume of users and data.
User
As an android developer expert give me more details about the interaction between the backend needed an the app
Assistant
Sure, as an Android developer with 6 years of experience, I can provide more details about the interaction between the backend and the app.
In the case of an app like Getaround, the backend would be responsible for storing and managing the data related to the cars, users, transactions, and other business logic of the app. This would include features such as a database to store user profiles, car listings, and booking information, as well as a server to handle requests and responses from the app.
The app would need to interact with the backend through a set of APIs or web services, which would allow it to access and manipulate the data stored in the backend. This would include features such as user authentication and authorization, car search and booking, payment processing, and real-time data synchronization.
To implement this interaction between the app and the backend, we would need to follow a set of best practices and guidelines, such as:
Using standard protocols and formats for data exchange, such as JSON or XML.
Implementing secure communication protocols, such as HTTPS or SSL, to protect the data and prevent unauthorized access.
Using caching and other performance optimization techniques to minimize network latency and reduce server load.
Handling errors and exceptions gracefully, by providing meaningful error messages and error handling mechanisms in the app.
Testing and debugging the APIs and web services thoroughly, to ensure that they are reliable and robust.
By following these best practices, we can ensure that the interaction between the app and the backend is smooth, secure, and efficient, providing a seamless user experience and meeting the business requirements of the app.
User
And how the app is going to comunicate with the car?
Assistant
To enable communication between the app and the car, we would need to use a combination of technologies and protocols, such as Bluetooth, Wi-Fi, cellular data, and the car's onboard computer system.
Here's a high-level overview of how the app could communicate with the car:
Onboard Computer System:
Modern cars are equipped with onboard computer systems that monitor various sensors and systems within the car, such as the engine, fuel level, and GPS location. The onboard computer system is the key component that enables communication between the car and the app.
Data Exchange Protocol:
To enable communication between the app and the onboard computer system, we would need to use a data exchange protocol such as the OBD-II protocol or a proprietary protocol provided by the car manufacturer. This protocol would allow the app to send commands and receive data from the onboard computer system.
Hardware Interface:
To physically connect the app to the car's onboard computer system, we would need to use a hardware interface such as a Bluetooth OBD-II adapter or a Wi-Fi dongle. The hardware interface would act as a bridge between the app and the onboard computer system, allowing data to be exchanged between the two.
App Integration:
Once the app is connected to the car's onboard computer system, we would need to integrate the data into the app's user interface. This would involve displaying relevant data such as the car's fuel level, location, and other details in real-time, and allowing users to remotely lock and unlock the car using the app.
Security and Authentication:
To ensure that only authorized users can access the car's onboard computer system, we would need to implement secure authentication and authorization mechanisms in the app. This would include features such as two-factor authentication, identity verification, and encrypted communication.
By following these steps, we can enable communication between the app and the car, allowing users to remotely control and monitor the car's systems and providing a seamless user experience.
User
Explain with more detail about the Security and Authentication
Assistant
Sure, security and authentication are critical components of any app that interacts with user data, including an app like Getaround that provides access to rental cars. In the case of the app, we would need to implement security and authentication mechanisms to protect user data, prevent unauthorized access to the app, and ensure that users can safely rent and use cars.
Here are some of the key considerations and best practices for implementing security and authentication in the app:
Two-Factor Authentication:
Two-factor authentication is a common method of ensuring that only authorized users can access the app. This involves requiring users to enter a second form of authentication, such as a code sent to their phone, in addition to their username and password.
Identity Verification:
To prevent fraud and unauthorized use of the app, we would need to implement identity verification mechanisms. This could involve verifying user identity using government-issued IDs or other official documents, as well as using facial recognition or biometric data to confirm user identity.
Encrypted Communication:
To protect user data during transmission, we would need to use encrypted communication protocols such as HTTPS or SSL. This would prevent attackers from intercepting and accessing user data, and ensure that user data is securely transmitted between the app and the backend.
Secure Storage:
To protect user data when it is stored on the app's servers or on the user's device, we would need to use secure storage mechanisms. This would involve encrypting user data before it is stored, and using secure storage frameworks such as Android's KeyStore or Apple's Secure Enclave to prevent unauthorized access.
Access Control:
To ensure that only authorized users can access the app's features, we would need to implement access control mechanisms. This could involve restricting access to certain features based on user roles or permissions, as well as using APIs and web services that enforce access control policies.
By following these best practices and guidelines, we can ensure that the app is secure, robust, and reliable, providing a seamless user experience and meeting the business requirements of the app.
User
Give me an explanation about the arquitecture of the app, which layers would have and what techlogies, libraries would need to use
Assistant
Sure, the architecture of the Getaround app would need to be designed to support a scalable and reliable platform that can handle large volumes of data and user traffic. Here's a high-level overview of the layers and technologies that we might use:
Presentation Layer:
The presentation layer of the app would be responsible for handling user interactions and displaying information to the user. This layer would use Android-specific UI components, such as Activities and Fragments, to create a responsive and intuitive user interface.
Application Layer:
The application layer of the app would be responsible for implementing the app's business logic and managing user data. This layer would use a combination of Android libraries, such as Retrofit for network communication and Room for local data storage, as well as custom code to implement the app's core features.
Domain Layer:
The domain layer of the app would be responsible for defining the app's domain objects and business rules. This layer would use object-oriented design principles and would be implemented using pure Java or Kotlin classes.
Data Layer:
The data layer of the app would be responsible for managing the app's data storage and retrieval. This layer would use a combination of local and remote data storage mechanisms, such as SQLite databases, content providers, and cloud-based storage services like Amazon S3.
Backend Layer:
The backend layer of the app would be responsible for managing the app's server-side logic and communication with external systems, such as payment gateways, car rental systems, and third-party APIs. This layer would use a combination of web services, such as RESTful APIs, and cloud-based infrastructure, such as AWS or Google Cloud Platform.
To implement these layers, we would use a range of technologies, libraries, and frameworks, including:
Android SDK: The Android SDK is a set of tools and libraries that developers use to build Android apps. It includes APIs for creating UI components, handling user input, and accessing device functionality like camera and location.
Kotlin: Kotlin is a modern, expressive programming language that runs on the JVM and is fully compatible with Java. It provides a range of features that make Android app development easier and more efficient, such as null safety and extension functions.
RxJava: RxJava is a popular library for reactive programming in Java and Kotlin. It provides a powerful set of abstractions for handling asynchronous data streams and simplifies the process of writing event-driven code.
Dagger 2: Dagger 2 is a dependency injection framework for Java and Kotlin that makes it easy to manage object dependencies and promote modular, testable code.
Retrofit: Retrofit is a networking library for Java and Kotlin that simplifies the process of making network requests and handling responses. It provides a range of features, such as automatic JSON parsing and error handling, that make it easy to work with web services.
User
Act as a software developer expert. Explain to me the principle of liskov from SOLID principles and give me some examples of violations of that principle
Assistant
The Liskov Substitution Principle is one of the SOLID principles of object-oriented design that states that objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.
In other words, if you have a class A and a class B that extends A, any instance of B should be able to be used in place of an instance of A without breaking the code. This means that the behavior of the class A should not depend on the implementation details of class B.
Here are some examples of violations of the Liskov Substitution Principle:
Overriding methods to throw exceptions: A subclass should not add constraints or limitations to the base class that make it impossible to use it. For example, if class A defines a method that returns a list, a subclass B that overrides this method and throws an exception when the list is empty violates Liskov Substitution Principle.
Changing the behavior of a method: A subclass should not change the behavior of the base class method in a way that violates the expectations of the client code. For example, if class A defines a method that adds two integers and returns the result, a subclass B that overrides this method and returns a negative value for positive inputs would violate the Liskov Substitution Principle.
Introducing new checked exceptions: A subclass should not add new checked exceptions to a method that the base class does not throw. This would force client code to catch new exceptions that it was not designed to handle, violating the principle of least surprise.
Changing the preconditions of a method: A subclass should not change the preconditions of a method in a way that makes it harder or impossible to use. For example, if class A defines a method that takes an integer parameter that must be positive, a subclass B that changes this parameter to be negative would violate Liskov Substitution Principle.
Violations of the Liskov Substitution Principle can lead to subtle bugs and unexpected behavior in the code, so it's important to carefully design class hierarchies and follow this principle to ensure that the code is maintainable and easy to reason about.
User
Now create the code for those 4 examples
Assistant
Sure, here are some examples of how the Liskov Substitution Principle could be violated in Java code:
Overriding methods to throw exceptions:
typescript
class A {
public List<String> getList() {
return new ArrayList<>();
}
}
class B extends A {
@Override
public List<String> getList() {
List<String> list = new ArrayList<>();
if (someCondition()) {
throw new RuntimeException("Condition not met");
}
return list;
}
}
// client code
A a = new B();
List<String> list = a.getList(); // throws RuntimeException
In this example, the subclass B overrides the getList method to throw a RuntimeException if some condition is not met. This violates the Liskov Substitution Principle, because client code that expects an instance of class A to return a list can be broken when it receives an instance of class B that throws an exception.
Changing the behavior of a method:
java
class A {
public int add(int x, int y) {
return x + y;
}
}
class B extends A {
@Override
public int add(int x, int y) {
if (x > 0 && y > 0) {
return x + y;
} else {
return -1;
}
}
}
// client code
A a = new B();
int result = a.add(1, 2); // returns -1
In this example, the subclass B overrides the add method to return a negative value if both inputs are positive. This violates the Liskov Substitution Principle, because client code that expects the method to return the sum of two integers can be broken when it receives an instance of class B that returns a negative value.
Introducing new checked exceptions:
java
User
Act as a software developer expert. Explain to me the principle of open/colsed from SOLID principles and give me some examples of violations of that principle
Assistant
The Open/Closed Principle is a design principle from the SOLID principles that states that software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. This means that you should be able to add new functionality to a system without having to modify existing code.
In other words, once a module or component is developed, it should be closed for modification, but it should be open to extension to provide new functionality or features. The goal is to create software that is easy to maintain and modify without causing unwanted side effects.
Here are some examples of violations of the Open/Closed Principle:
Modifying existing code to add new features:
scss
class Rectangle {
public double width;
public double height;
public double area() {
return width * height;
}
}
class Circle {
public double radius;
public double area() {
return Math.PI * radius * radius;
}
}
// client code
Rectangle rectangle = new Rectangle();
rectangle.width = 10;
rectangle.height = 20;
double rectArea = rectangle.area(); // returns 200
Circle circle = new Circle();
circle.radius = 5;
double circleArea = circle.area(); // returns 78.54
In this example, the client code calculates the areas of a rectangle and a circle using two different classes. If we later want to add support for calculating the area of a triangle, we might be tempted to modify the existing Rectangle and Circle classes to add a triangleArea() method. However, this violates the Open/Closed Principle, because it requires modifying existing code. A better solution would be to create a new class for the Triangle shape that extends a common Shape class or interface.
Using if/else statements to handle different cases:
In this example, the `Product` and `ShoppingCart` classes are tightly coupled, because the `ShoppingCart` class directly manipulates `Product` objects. If we later want to add support for discounts or promotions, we would have to modify the `calculateTotalPrice` method to handle the new cases, which violates the Open/Closed Principle. A better solution would be to create a separate `Discount` or `Promotion` class that operates on the `ShoppingCart` object.
4. Providing public access to private fields:
class BankAccount {
private double balance;
csharp
public double getBalance() {
return balance;
}
public void deposit(double amount) {
balance += amount;
}
public void withdraw(double amount) {
if (amount > balance) {
throw new IllegalArgumentException("Insufficient funds");
}
balance -= amount;
}
In this example, the `BankAccount` class has a private `balance` field with public `getBalance`, `deposit`, and `withdraw` methods. However, the client code accesses the private `balance` field directly, violating encapsulation and making it difficult to change the implementation in the future. A better solution would be to only provide public access to methods that modify or retrieve the `balance` field, and make the field itself private.
Dataset releases
Not yet included in a published release.
What are some of the challenges you've faced in developing Android applications, and how have you addressed them?
Some of the challenges I have faced in developing Android applications include device fragmentation, performance optimization, and compatibility issues with different versions of Android. To address these challenges, I use best practices such as modularization, resource optimization, and backwards compatibility. I also keep up-to-date with the latest Android SDKs and libraries, and participate in online forums and communities to stay informed about the latest trends and solutions in the industry.
Have you worked with any other mobile platforms besides Android? If so, can you tell me about your experience?
No, I have not worked with any other mobile platforms besides Android. However, I am open to learning and exploring other mobile platforms in the future.
How do you stay up-to-date with the latest trends and technologies in Android development, and what resources do you use to continue learning and growing as a developer?
I stay up-to-date with the latest trends and technologies in Android development by attending conferences, reading industry blogs, participating in online forums and communities, and taking online courses and tutorials. I also experiment with new libraries and frameworks, and contribute to open source projects to gain practical experience and
Room: Room is a database library for Android that provides an easy-to-use, object-oriented interface for working with SQLite databases. It simplifies the process of managing local data storage and retrieval, and provides a range of features, such as type converters and data migrations, that make it easy to maintain data consistency and reliability.
By using these technologies and following a well-defined architecture, we can create a scalable, reliable, and maintainable app that meets the needs of the business and provides a great user experience.
class A {
public void doSomething() throws IOException {
// some code that can throw IOException
}
}
class B extends A {
@Override
public void doSomething() throws IOException, SQLException {
// some code that can throw SQLException
}
}
// client code
A a = new B();
try {
a.doSomething(); // compile error - must catch SQLException
} catch (IOException e) {
// handle IOException
}
In this example, the subclass B overrides the doSomething method to throw an additional checked exception SQLException. This violates the Liskov Substitution Principle, because client code that expects an instance of class A to throw only IOException can be broken when it receives an instance of class B that throws an additional exception.
Changing the preconditions of a method:
java
class A {
public int divide(int x, int y) {
if (y == 0) {
throw new IllegalArgumentException("Divisor cannot be zero");
}
return x / y;
}
}
class B extends A {
@Override
public int divide(int x, int y) {
return x / -y; // always returns negative value
}
}
// client code
A a = new B();
int result = a.divide(10, -2); // throws ArithmeticException
In this example, the subclass B changes the preconditions of the divide method by allowing the divisor y to be negative. This violates the Liskov Substitution Principle, because client code that expects an instance of class A to only allow positive divisors can be broken when it receives an instance of class B that allows negative divisors. In this case, calling the method with inputs (10, -2) results in an ArithmeticException.
class ReportGenerator {
public void generateReport(String reportType) {
if (reportType.equals("PDF")) {
// code to generate PDF report
} else if (reportType.equals("HTML")) {
// code to generate HTML report
} else if (reportType.equals("CSV")) {
// code to generate CSV report
} else {
throw new IllegalArgumentException("Unsupported report type: " + reportType);
}
}
}
// client code
ReportGenerator reportGenerator = new ReportGenerator();
reportGenerator.generateReport("PDF");
In this example, the ReportGenerator class has a generateReport method that uses an if/else statement to handle different report types. If we later want to add support for a new report type, we would have to modify the existing generateReport method to handle the new case. This violates the Open/Closed Principle, because it requires modifying existing code. A better solution would be to create a new class for each report type that extends a common Report class or interface.
Creating monolithic, tightly coupled code:
java
class Product {
public String name;
public double price;
// ... other fields and methods ...
}
class ShoppingCart {
private List<Product> products = new ArrayList<>();
public void addProduct(Product product) {
products.add(product);
}
public double calculateTotalPrice() {
double totalPrice = 0;
for (Product product : products) {
totalPrice += product.price;
}
return totalPrice;
}
}
// client code
Product product1 = new Product();
product1.name = "Shoes";
product1.price = 50;
Product product2 = new Product();
product2.name = "T-Shirt";
product2.price = 20;
ShoppingCart shoppingCart = new ShoppingCart();
shoppingCart.addProduct(product1);
shoppingCart.addProduct