├── APIAutomation
├── Day_03.md
├── Day_09.md
├── Day_15.md
├── Day_21.md
├── Day_27.md
├── Day_33.md
├── Day_39.md
├── Day_45.md
├── Day_51.md
├── Day_57.md
├── Day_63.md
├── Day_69.md
├── Day_75.md
├── Day_81.md
├── Day_87.md
├── Day_93.md
└── Day_99.md
├── Behavioral
├── Day_06.md
├── Day_12.md
├── Day_18.md
├── Day_24.md
├── Day_30.md
├── Day_36.md
├── Day_42.md
├── Day_48.md
├── Day_54.md
├── Day_60.md
├── Day_66.md
├── Day_72.md
├── Day_78.md
├── Day_84.md
├── Day_90.md
└── Day_96.md
├── Coding
├── Day_01.md
├── Day_07.md
├── Day_13.md
├── Day_19.md
├── Day_25.md
├── Day_31.md
├── Day_37.md
├── Day_43.md
├── Day_49.md
├── Day_55.md
├── Day_61.md
├── Day_67.md
├── Day_73.md
├── Day_79.md
├── Day_85.md
├── Day_91.md
└── Day_97.md
├── README.md
├── SQL
├── Day_04.md
├── Day_10.md
├── Day_100.md
├── Day_16.md
├── Day_22.md
├── Day_28.md
├── Day_34.md
├── Day_40.md
├── Day_46.md
├── Day_52.md
├── Day_58.md
├── Day_64.md
├── Day_70.md
├── Day_76.md
├── Day_82.md
├── Day_88.md
└── Day_94.md
├── Solutions
├── Dimpy
│ ├── Day_02_solution.md.txt
│ └── Day_62_Solutions.md
├── README.md
└── Vinuta
│ ├── Day_22_Solution.md.txt
│ └── Day_88_Solution
├── Testing
├── Day_05.md
├── Day_11.md
├── Day_17.md
├── Day_23.md
├── Day_29.md
├── Day_35.md
├── Day_41.md
├── Day_47.md
├── Day_53.md
├── Day_59.md
├── Day_65.md
├── Day_71.md
├── Day_77.md
├── Day_83.md
├── Day_89.md
└── Day_95.md
├── WebAutomation
├── Day_02.md
├── Day_08.md
├── Day_14.md
├── Day_22.md
├── Day_26.md
├── Day_32.md
├── Day_38.md
├── Day_44.md
├── Day_50.md
├── Day_56.md
├── Day_62.md
├── Day_68.md
├── Day_74.md
├── Day_80.md
├── Day_86.md
├── Day_92.md
└── Day_98.md
└── WeeklyPlans
├── README.md
├── Week_07.md
├── Week_08.md
├── Week_09.md
├── Week_10.md
├── Week_11.md
├── Week_12.md
├── Week_13.md
├── Week_14.md
├── Week_15.md
├── Week_16.md
└── Week_17.md
/APIAutomation/Day_03.md:
--------------------------------------------------------------------------------
1 | Complete the API challenge from https://github.com/djwester/api-testing-challenges
2 |
3 |
--------------------------------------------------------------------------------
/APIAutomation/Day_09.md:
--------------------------------------------------------------------------------
1 | ## Problem statement
2 | Explore and list down the end-points of https://angular.realworld.io
3 |
4 | ### Automate the following steps using APIs
5 | - Create New User
6 | - Login and generate token
7 | - Create/Edit/Delete Article
8 |
9 | ### Tools to be used
10 | - Chrome console to explore the end points
11 | - Postman/Restassured for automating the APIS
12 |
--------------------------------------------------------------------------------
/APIAutomation/Day_15.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | Identify the total amount when transactions type is debit and credit when userId = 1 and userName is John Oliver.
3 | End point to test - https://jsonmock.hackerrank.com/api/transactions
4 |
5 | ### Hint:
6 | Use pagination.
7 |
8 |
9 |
--------------------------------------------------------------------------------
/APIAutomation/Day_21.md:
--------------------------------------------------------------------------------
1 | ## Problem statement
2 | Build a REST API mock server that will allow to manage pricing individually on machines remotely with the following:
3 |
4 | Endpoints:
5 | - GET /pricing-models returns all of the pricing models available for the system also returns the default pricing model in prices.json
6 | - POST /pricing-models creates a new pricing model in the system returns the ID of the new pricing model to the caller
7 | - GET /pricing-models/:pm-id get an individual pricing model include the price configurations for the pricing model. If the pricing model isn't found by pm-id it responds with not found.
8 | - PUT /pricing-models/:pm-id updates an existing pricing model meta-data does not affect the pricing configurations for the pricing model
9 | - GET /pricing-models/:pm-id/prices returns the prices configured for a specific pricing model
10 | - POST /pricing-models/:pm-id/prices adds a new price configuration for a pricing model
11 | - DELETE /pricing-models/:pm-id/prices/:price-id removes a price configuration from a pricing model if the pricing model isn't found by pm-id it responds with not found. if the price configuration isn't found by price-id it responds with not found
12 | - PUT /machines/:machine-id/prices/:pm-id sets the pricing model for an individual machine to the one from pm-id. If the machine already has a pricing model, it is replaced by this one. If the machine isn't found by machine-id it responds with not found. If the pricing model isn't found by pm-id it responds with not found
13 | - DELETE /machines/:machine-id/prices/:pm-id removes the pricing model from the machine (unsets it)
14 | - GET /machines/:machine-id/prices return the pricing model and price configurations set for a given machine.If the machine does not have a pricing model configured then the default model from prices.json is returned.If the machine isn't found by machine-id it responds with not found.
15 |
--------------------------------------------------------------------------------
/APIAutomation/Day_27.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 |
3 | You are developing an mobile application which needs to use Spotify Create playlist feature. Write a consumer driven contract tests for the same if your application's functionality is as follows:
4 |
5 | 1) Create a user profile ( this is part of your mobile app)
6 | 2) Create a spotify playlist ( your mobile app is a consumer of Spotify )
7 | 3) Share the playlist with your friends ( this is part of your mobile app)
8 |
9 | Steps to follow:
10 | 1) Create a Spotify create playlist API blue print (you can mock the responses of actual api)
11 | 2) Create user profile creation API for your APP (mock API)
12 | 3) Create share playlist API for your APP (mock API)
13 | 4) Add consumer driven contract tests for the create playlist API
14 |
15 | Note: Use any supported tool as needed(example postman, pact, KarateDSL etc).
16 |
--------------------------------------------------------------------------------
/APIAutomation/Day_33.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | You need submit a form with unique data everytime. Assuming you are testing a post request having the following fields, use any faker library to generate the data.
3 | - First Name
4 | - Last Name
5 | - Email address
6 | - Start date (Today's or past date)
7 | - End date (Future date and difference should be atleast 30 days)
8 | - Country Code
9 | - Country Name (as per the country code)
10 | - Address (as per the country)
11 | - Phone Number (as per the country)
12 |
13 | Note: Please select the faker library available in the programming language you are using. Postman also support this (https://learning.postman.com/docs/writing-scripts/script-references/variables-list/)
14 | You can use mocked response to test your code
15 |
--------------------------------------------------------------------------------
/APIAutomation/Day_39.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Explore GraphQL
3 |
4 | ### Problem Statement
5 | URL to be used https://graphqlzero.almansi.me/api
6 |
7 | 1) Write a query request to create a new post with title and body
8 | 2) Write a query request to get the title and url of the photo along with get the title and id of the associated album.
9 | 3) Write a query request to get the detail of user with username, email and address.
10 |
11 | Hint: Please use the docs/schema available in the above link to create the GraphQL queries.
12 |
--------------------------------------------------------------------------------
/APIAutomation/Day_45.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Validate different Json responses with dynamic or optional fields.
3 |
4 | ### Problem Statement #1
5 | Validate response schema with optional field. For example the following two responses email field is optional.
6 |
7 | Response 1:
8 | ```
9 | {
10 | "id": 1,
11 | "first_name": "Test",
12 | "last_name": "1",
13 | "phone": 123456,
14 | "email": "test1@gmail.com"
15 | }
16 | ```
17 | Response 2:
18 | ```
19 | {
20 | "id": 2,
21 | "first_name": "Test",
22 | "last_name": "2",
23 | "phone": 5446456,
24 | }
25 | ```
26 | ### Problem Statement #2
27 | Validate response schema when nested json has optional field. For example the following scenario, state field under address is optional.
28 |
29 | Response 1:
30 | ```
31 | {
32 | "id": 1,
33 | "first_name": "Test",
34 | "last_name": "1",
35 | "address":
36 | {
37 | "address line 1": "test",
38 | "city": "Bangalore",
39 | "state": "Karnataka"
40 | }
41 | }
42 | ```
43 | Response 2:
44 | ```
45 | {
46 | "id": 2,
47 | "first_name": "Test",
48 | "last_name": "2",
49 | "address":
50 | {
51 | "address line 1": "test",
52 | "city": "Chennai",
53 | }
54 | }
55 | ```
56 | ### Problem Statement #3
57 | Validate responses when the value of a field is dynamic. For example id is dynamic and unique every time and should be a positive number.
58 |
59 | Response 1:
60 | ```
61 | {
62 | "id": 1,
63 | "first_name": "Test",
64 | }
65 | ```
66 | Response 2:
67 | ```
68 | {
69 | "id": 2,
70 | "first_name": "Test",
71 | }
72 | ```
73 |
--------------------------------------------------------------------------------
/APIAutomation/Day_51.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | OAuth2 - Scopes
3 |
4 | ### Problem Statement
5 | Craete a new app in Spotify and connect to the app using Authorization Code Flow and Client Credentials Flow from your automation script.
6 |
7 | ### Presetup
8 | - Create a developer account in spotify - https://developer.spotify.com/
9 | - Explore the authorization flows listed at https://developer.spotify.com/documentation/general/guides/authorization/
10 | - Create an sample app
11 | - Copy the secrets needed (like client credentials/secrets etc)
12 |
13 | ### Automation Script
14 | - Connect to spotify App from your automation script using the following two methods and generate the access tokem
15 | 1) Authorization Code Flow
16 | 2) Client Credentials Flow
17 | - After successful authorization get the list of markets where spotify is available using the access token generated in the first step. (https://developer.spotify.com/documentation/web-api/reference/#/operations/get-available-markets)
18 |
--------------------------------------------------------------------------------
/APIAutomation/Day_57.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Pojo classes in API testing framework
3 |
4 | ### Resources
5 | - https://medium.com/@shubameg48/serialization-and-deserialization-in-rest-assured-api-testing-6e676c9adefa
6 | - https://testautomationu.applitools.com/automating-your-api-tests-with-rest-assured/chapter6.html
7 | - https://www.jsonschema2pojo.org/
8 | - https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started#the-maven-plugin
9 |
10 | ### Problem Statement
11 | You need to create an utility in your API testing framework which will help you to autogenerate the pojo classes.
12 |
13 | Input to the utility - Folder path to sample json request/response files
14 |
15 | Output from the utility - Each json input file should be converted into a pojo class under outputpojo folder.
16 |
--------------------------------------------------------------------------------
/APIAutomation/Day_63.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Http Status codes
3 |
4 | ### Resources
5 | - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
6 | - https://docs.telerik.com/fiddler/knowledge-base/autoresponder#creating-autoresponder-rules
7 |
8 | ### Problem statement
9 | Open the URL https://home.openweathermap.org/users/sign_in and intercept the various requests using fiddler.
10 | Simulate different status codes from fiddler and validate the error messages from browser.
11 |
12 | ### Steps to follow
13 | - Open fiddler tool and start capturing traffic
14 | - Open the url mentioned above and click on submit button
15 | - Once the request is captured, select the response and go to the autoreponder tab
16 | - Click on Add rule
17 | - Select the response to be returned from the dropdown Local file to return
18 | - Select any status code from the dropdown for example 502_Unreachable.dat and save the changes.
19 | - Click on enable rules checkbox.
20 | - Go to the browser and refresh the page.
21 | - Validate you have seen the response as sent from fiddler.
22 | - Close fiddler and verify that web page is returning response as before.
23 | - Explore the different error codes in similar way.
24 |
25 | Notes: Fiddler Autoresponder can be used for this challenges.
26 |
--------------------------------------------------------------------------------
/APIAutomation/Day_69.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | - Buidling an API code base from scratch
3 | - Running the APIs locally
4 | - Understanding the API code flow for any scenario
5 | - Automating API chaining
6 |
7 |
8 | ### Prerequisite
9 | - Clone the Github repository https://github.com/osopromadze/Spring-Boot-Blog-REST-API
10 | - Build the setup locally
11 | - Run the entire setup at http://localhost:8080
12 |
13 | ### Problem statement 1
14 | Select any API for example Signup API (POST /api/auth/signup) and explore the source code to find out all the details to make that API request from any external tool/framework like postman or rest assured.
15 |
16 | ### Problem statement 2
17 | Automate the scenario - Get all comments which belongs to a post with specific postId
18 |
--------------------------------------------------------------------------------
/APIAutomation/Day_75.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Running API tests on container
3 |
4 | ### Problem Statement
5 | You need to run rest API tests on a docker container.
6 |
7 | ### Steps
8 | - Automate any simple rest API (local or public)
9 | - Start a docker container to rupport the framework you are using for automation like rest assured, postman or request etc.
10 | - Run the tests on locally running container.
11 |
12 | Note: We are not creating docker file. That exercise will be covered in another challenge.
13 |
14 | ### Resources
15 | - https://hub.docker.com/r/adityai/rest-assured-docker
16 | - https://hub.docker.com/r/postman/newman/
17 | - https://github.com/DannyDainton/postman-docker
18 |
--------------------------------------------------------------------------------
/APIAutomation/Day_81.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Create docker file for running API tests inside container.
3 |
4 | ### Problem Statement
5 | Create a docker file which will execute the entire API testing framework inside a docker container.
6 |
7 | ### Steps
8 | - Automate any simple rest API (local or public)
9 | - Run the tests inside docker container
10 |
11 |
12 | ### Resources
13 | - https://hub.docker.com/r/adityai/rest-assured-docker
14 | - https://github.com/DannyDainton/postman-docker
15 |
16 |
--------------------------------------------------------------------------------
/APIAutomation/Day_87.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Two api results comparison
3 |
4 | ## Problem statement
5 | You need to compare the results of current temparature returned by the following two service providers.
6 | - Service 1 - https://www.visualcrossing.com/weather/weather-data-services
7 | - Service 2 - https://openweathermap.org/
8 |
9 | You need to find out the APIs to be used by exploring the documentation.
10 |
--------------------------------------------------------------------------------
/APIAutomation/Day_93.md:
--------------------------------------------------------------------------------
1 | ## Leanring Goal
2 | File Upload
3 |
4 | ### Problem Statement
5 | Uplaod a local file to dropbox using API
6 |
7 | ### Hint
8 | https://riptutorial.com/dropbox-api/example/1356/uploading-a-file-via-curl
9 | https://developers.dropbox.com/oauth-guide
10 |
11 | Note: You need to generate the token first before uploading file.
12 |
--------------------------------------------------------------------------------
/APIAutomation/Day_99.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Testing simple kafka message
3 |
4 | ### References
5 | - https://www.geeksforgeeks.org/how-to-install-and-run-apache-kafka-on-windows/
6 | - https://towardsdatascience.com/how-to-install-apache-kafka-using-docker-the-easy-way-4ceb00817d8b
7 | - https://docs.oracle.com/en-us/iaas/Content/Streaming/Tasks/streaming-kafka-java-client-quickstart.htm
8 |
9 | ### Problem statement
10 | You need to test if a kafka message published by a producer is received by two clients.
11 |
12 | ### Steps to automate:
13 | 1. Install kafka and start the kafka browser and zookeeper(you can use docker)
14 | 2. Start consumer1 who is listening to a particular topic say "TOPIC 1"
15 | 3. Start the producer and publish a message "Hello" to the same topic "TOPIC 1"
16 | 4. Validate the consumer 1 received the message "Hello" from topic "TOPIC 1"
17 | 5. Start consumer2 who is listening to same topic "TOPIC 1"
18 | 6. Validate the consumer 2 also received the message "Hello" published on topic "TOPIC 1"
19 |
20 | ### Hints
21 | You can use any client like JAVA kafka client or framework like https://github.com/authorjapps/zerocode
22 |
--------------------------------------------------------------------------------
/Behavioral/Day_06.md:
--------------------------------------------------------------------------------
1 | ### Problem Statement
2 | One of existing team member is not comfortable with a new joiner in your team. The differences are openly visible in meetings. This person which is a critical resource and senior member in the team is requesting a team change due to that. As a lead/manager what steps are you going to take?
3 |
--------------------------------------------------------------------------------
/Behavioral/Day_12.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | You are asked to provide feedback about two team members to your manager. You have provided honest feedback based on your experience working with both of them, but find out later that the manager has not considered your feedback in right way.Interestingly, the person you have identified as needing improvement was promoted by your manager. How will you handle this?
3 |
--------------------------------------------------------------------------------
/Behavioral/Day_18.md:
--------------------------------------------------------------------------------
1 | ## Problem statement
2 | Sometimes, it's almost impossible to get everything done on your to-do list. What do you do when your list of responsibilities becomes overwhelming?
3 |
--------------------------------------------------------------------------------
/Behavioral/Day_24.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | Tell me about a time when you successfully explained a technical problem to a colleague or a customer who didn't have a tech background?
3 |
--------------------------------------------------------------------------------
/Behavioral/Day_30.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 |
3 | How do you bring personal development mindset into your team? Assume that you have mix of higher performers, average performers and need improvement performers in your team, how will you strategize a cusmomized personal development plan which can cater to the need of different people in the team? How are you going to motivate people falling under different categories of performance evaluation?
4 |
5 | Hint: Give example if you have already implemented something similar otherwise describe your approach of making a plan to achieve the same.
6 |
--------------------------------------------------------------------------------
/Behavioral/Day_36.md:
--------------------------------------------------------------------------------
1 | ## Problem Statements
2 | ### Category - Creativity
3 | - When have you brought an innovative idea into your team? How was it received? Explain with real time example.
4 | - When have you taken an existing process and used your own creativity to make it better?
5 |
--------------------------------------------------------------------------------
/Behavioral/Day_42.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Time Management
3 |
4 | ### Problem Statements
5 | 1. What's a typical day at work for you? How do you plan your day?
6 | 2. What productivity tools do you use and explain how they are useful?
7 | 3. Describe a time when you have successfully delegated tasks to your team and how that helped you and your team?
8 | 4. Would you describe yourself as an organized person? Provide examples.
9 | 5. How do you plan your work when you have multiple similar priority tasks? Provide examples.
10 |
--------------------------------------------------------------------------------
/Behavioral/Day_48.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Decision Making
3 |
4 | ### Problem Statement #1 - Technical solution
5 | You are responsible for selecting an automation testing tool for your team. You have good idea about what is the expectation from management and the budget you can spend. Explain how you are going to take this decision to select an specific tool and what will be the key factors that will influence your decision. For example: Cost vs Open source, code vs no code etc.
6 |
7 | ### Problem Statement #2 - People management
8 | Describe a time when you made a difficult decision related to people management. For example decision related to the root cause of high attrition rate in your team.
9 |
10 | ### Problem Statement #3 - Initiative
11 | Describe a time when your decision related to a new initiative was criticized by your team and manager. How did you overcome the situation?
12 |
13 |
14 | ### Tips for answering questions about decision-making
15 | - Describe your process
16 | - Provide an example
17 | - Discuss results of your decision
18 | - Deliver your answer confidently
19 |
--------------------------------------------------------------------------------
/Behavioral/Day_54.md:
--------------------------------------------------------------------------------
1 | ## Leanring Goal
2 | Leadership
3 |
4 | ### Problem statement #1
5 | Have you ever served as a coach or mentor to anyone, whether officially or unofficially? How did you provide them with guidance?
6 |
7 | ### Problem statement #2
8 | Name some situations in which a leader may fail. Tell me about a time when you failed as a leader.
9 |
10 | ### Problem statement #3
11 | What methods have you used to gain commitment from your team?
12 |
13 | ### Problem Statement #4
14 | Have you used delegation before as part of your work? Tell me about your approach to delegation.
15 |
--------------------------------------------------------------------------------
/Behavioral/Day_60.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Communication
3 |
4 | ### Problem statement #1
5 | You are leading a diverse team located in different locations in the world. For simplicity lets assume the following:
6 | - Team A - Location 1
7 | - Team B - Location 2
8 | - Team C - Location 3
9 |
10 | As a leader you are facing the following issues:
11 | 1) The teams are working remotely and sync up over calls whenever needed.
12 | 2) The teams are able to manage day to day communication using English, but what you could feel that Team B and Team C are more comfortable and productive if they use their respective native langauges for communication.
13 | 3) Each team has some unique skills which is a value addition to the overall team goals.
14 | 4) There is no unofficial communication/meet ups happening due to remote mode of working and different culturals backgrounds.
15 |
16 | Come up with a plan so that you can overcome the above limitations and facilitate the smooth interaction between the above 3 teams and buid a personal bonding between them irrespective of the diverse background each team member is coming from.
17 |
--------------------------------------------------------------------------------
/Behavioral/Day_66.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Teamwork
3 |
4 | ### Problem statement
5 | You have a project deadline to meet. One of your team member has applied for planned leave long time back. Now another one just informed you about an unplanned leave due to some family urgency. As a lead what action are you going to take so that you can support your team along with meeting the deadline.
6 |
--------------------------------------------------------------------------------
/Behavioral/Day_72.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Workpressure
3 |
4 | ### Problem Statement
5 | You have joined a new company. Your manager has shared following expectations with you the very first day of joining:
6 | - You need to be productive within a week's time and be ready to face clients directly.
7 | - You need to self learn all the product/project releated things, few documentations will be provided and product access will be provided for hands on experience.
8 | - You are going to lead a team of mixed experience (50 % freshers + 50% experienced).
9 | - Project has fixed and tight deadlines to meet.
10 |
11 | How are you handle this? How are you going to make sure work life balance is maintained for you and team in this situation?
12 |
13 |
--------------------------------------------------------------------------------
/Behavioral/Day_78.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Trust and Integrity
3 |
4 | ### Problem statement #1
5 | Your immediate lead has assigned you some work related tasks. After completing those, you came to know that he/she was actually showing the output of those tasks done by themself not by you. This happened multiple times. What action/steps you are going to take in this situation?
6 |
7 | ### Problem statement #2
8 | Your lead/manager asked you to tell the testing status of a module as completed but actually which was not done yet, to the client. How you are going to handle this situation?
9 |
--------------------------------------------------------------------------------
/Behavioral/Day_84.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Professional failures
3 |
4 | ### Problem Statement
5 | You are hired to lead a team. After joining you could figure it out that the team is really hard to manage. People are not open minded and ready to listen anything but follow what they like to. You could see both people as well as process problems in the system. You have tried out differt strategies which you know from your past experience but could not see any improvement after one year of time. The leadership team is not helping you and blaming you uncapable of handling things of your own.
6 |
7 | - Do you consider this as a failure in your career?
8 | - How are you going to come out from this situation?
9 | - Are you going to fight back or quit if things does not improve?
10 |
11 |
--------------------------------------------------------------------------------
/Behavioral/Day_90.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Greatest Accomplishment
3 |
4 | ### Problem statement
5 | Describe your proudest accomplishment in career with example.
6 |
7 | ### Hints
8 | - Make a list of accomplishments in your mind for examples:
9 | 1) Positive feedback from client/coworker/supervisor
10 | 2) Initialitve from your side related process improvements
11 | 3) Mentoring/helping others to achieve their goals
12 | 4) Certifications/trainings which helped you to deliver your goals.
13 |
14 | - Quantify the accomplishment on how it helped
15 | 1) Increased revenue/sales/profit
16 | 2) Reduced cost/expenses
17 | 3) Reduced time needed
18 | 4) Reduction in required resources
19 |
20 | - Choose the accomplishments most relevant to the job you are interviewing for by understanding the JD well.
21 | - Confirm any strength you have.
22 | - Be honest and truthful.
23 |
24 | Example: In a project, there were so many repetitive and time consuming tasks which can be easily done using tools. You have suggested a good tool and process to be followed which helped the team to be more productive.Regression testing time has been reduced to 2 days from 5 days.
25 |
--------------------------------------------------------------------------------
/Behavioral/Day_96.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Building professional relationships
3 |
4 | ### Problem statement
5 | Describe a time when you struggled to build a relationship with someone important at work. How did you eventually overcome that?
6 |
--------------------------------------------------------------------------------
/Coding/Day_01.md:
--------------------------------------------------------------------------------
1 | ### Problem #1
2 | - Topic: String
3 | - Difficulty Level: Easy
4 | - [Link to the problem](https://leetcode.com/problems/excel-sheet-column-title/)
5 | - [Similar problem](https://leetcode.com/problems/excel-sheet-column-number/)
6 |
7 | ### Problem #2
8 | - Identify the problem statement from the below code
9 | - Add comments to make the code more readable
10 | - Add test scenarios.
11 | ```
12 | public boolean isValidInput(String input)
13 | {
14 | String zeroTo255
15 | = "(\\d{1,2}|(0|1)\\"
16 | + "d{2}|2[0-4]\\d|25[0-5])";
17 |
18 | String regex
19 | = zeroTo255 + "\\."
20 | + zeroTo255 + "\\."
21 | + zeroTo255 + "\\."
22 | + zeroTo255;
23 |
24 | Pattern p = Pattern.compile(regex);
25 | if (input == null) {
26 | return false;
27 | }
28 | Matcher m = p.matcher(input);
29 | return m.matches();
30 | }
31 | ```
32 |
--------------------------------------------------------------------------------
/Coding/Day_07.md:
--------------------------------------------------------------------------------
1 | ## Problem 1
2 | #### Topic: Arrays, List, String
3 | #### Difficulty Level: Easy
4 | You are the receptionist at a hotel which has 10 floors, numbered from 0 to 9 and each floor has 26 rooms named from ‘A’ to ‘Z’. Being a receptionist your task is to handle booking queries.
5 | You get booking queries in the form of strings of size 3 where 1st character is ‘+’ means room is booked, or ‘-’ means room is freed. Second character represents the floor of the room i.e, ‘0’ to ‘9’. Third character represents the room name i.e, ‘A’ to ‘Z’.
6 | On booking of each room you collect 1 coin from the customer. After the end of all the booking queries you have to count the number of coins you collected.
7 | You may assume that the list describes a correct sequence of bookings in chronological order i.e., only free rooms can be booked, and only booked rooms can be freed.
8 |
9 | ### Example:
10 | Consider booking queries to be ["+1A", "+3E", "-1A", "+4F", "+1A", "-3E"]
11 | - +1A: Room A on the 1st floor is booked and you collected 1 coin.
12 | - +3E: Room E on the 3rd floor is booked and you collected 1 coin.
13 | - -1A: Room A on the 1st floor is freed.
14 | - +4F: Room F on the 4th floor is booked and you collected 1 coin.
15 | - +1A: Room A on the 1st floor is booked and you collected 1 coin.
16 | - -3E: Room E on the 3rd floor is freed.So you collected 4 coins.
17 |
18 | ### Input Format:
19 | List of strings representing booking queries.
20 |
21 | ### Output Format :
22 | Return an integer denoting the count of coins you collected.
23 |
24 | ### Constraints:
25 | - 0 <= N <= 6*10^2
26 | - |query.length| = 3
27 |
28 |
29 | ### Sample Input 1:
30 | ["+1A", "+3E", "-1A", "+4F", "+1A", "-3E"]
31 | ### Sample Output 1:
32 | 4
33 |
34 | ### Sample Input 2:
35 | ["+0A", "+0B", "+0C"]
36 | ### Sample Output 2:
37 | 3
38 |
39 | ## Problem 2
40 | ### Topic: Arrays and String
41 | ### Difficulty Level: Easy
42 | Write a function that converts HEX string to RGB string and write another fucntion to convert RGB string to HEX string.
43 | Note. You are not supposed to use any built in libraries.
44 |
45 | ### Sample Input string hex to rgb
46 | f4e3d8
47 | ### Sample output string
48 | RGB(244, 227, 216)
49 |
50 | ### Sample input RGB to hex
51 | [231, 55, 145]
52 | ### Sample output RGB to hex
53 | E73791
54 |
--------------------------------------------------------------------------------
/Coding/Day_13.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | Design a data structure to implement 2 stacks using a single array of size N. It should support the following operations:
3 | - Push (Stack_no(1 or 2) , element) - pushes an element into stack 1 or 2
4 | - Pop (Stack_no(1 or 2)) - removes an element from stack 1 or 2
5 | - Top (Stack_no(1 or 2) - prints the topmost element from stack 1 or 2
6 | - Search (Stack_no(1 or 2), element) - searches an element in stack 1 or 2
7 | - Size (Stack_no(1 or 2) - returns the number of elements present in stack 1 or 2
8 |
--------------------------------------------------------------------------------
/Coding/Day_19.md:
--------------------------------------------------------------------------------
1 | https://www.hackerearth.com/practice/data-structures/stacks/basics-of-stacks/practice-problems/algorithm/stakth-1-e6a76632/
2 |
--------------------------------------------------------------------------------
/Coding/Day_25.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | Implement an algorithm to determine if a string has all unique characters without using additional data structures.
3 | - Using Brute Force technique with Time Complexity: O(n2)
4 | - Using sorting based on ASCII values of the characters with Time Complexity: O(nlogn)
5 |
--------------------------------------------------------------------------------
/Coding/Day_31.md:
--------------------------------------------------------------------------------
1 | ## Remove Duplicates
2 |
3 | ### Problem #1
4 | Remove the the first occurances of duplicate chars from a given String
5 | Example:
6 | Input: s = "bcabc"
7 | Output: "abc"
8 |
9 | ### Problem #2
10 | Remove the the last occurances of duplicate chars from a given String
11 | Example:
12 | Input: s = "bcabc"
13 | Output: "bca"
14 |
15 | https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/
16 |
17 | ### Problem #3
18 | Remove duplicates from a sorted-array.
19 | Example:
20 | Input: nums = [1,1,1,2,2,3]
21 | Output: nums = [1,2,3]
22 |
23 | ### Problem #4
24 | Remove duplicates from an unsorted-array.
25 |
26 | Example:
27 | Input: nums = [5,5,9,9,9,1,1,1,2]
28 | Output: nums = [5,9,1,2]
29 |
30 | ### Problem #5
31 | Remove duplicate from a sorted LinkedList
32 | https://leetcode.com/problems/remove-duplicates-from-sorted-list/
33 |
34 | ### Problem #6
35 | Remove all adjacent duplicates from a string using stack
36 | Example:
37 | Input: s = "abbaca"
38 | Output: "ca"
39 |
40 | ### Problem #7
41 | Remove Duplicate Brackets from an string expression.
42 |
43 | Example:
44 | Input: (a + b) + (c + d))
45 | Output: (a + b) + (c + d)
46 |
--------------------------------------------------------------------------------
/Coding/Day_37.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Linear and Binary search
3 |
4 | ### Problem #1
5 | Write a program to find Smallest and second smallest element in an Array.
6 |
7 | ### Problem #2
8 | Write a program to find Largest and Second Largest element in an Array.
9 |
10 | ### Problem #3
11 | Find the missing number in an array.
12 |
13 | Example:
14 |
15 | input1 {7,5,6,1,4,2} and Output: 3
16 |
17 | input2 {5,3,1,2} and Output: 4
18 |
19 | ### Problem #4
20 | Search an element in a rotated and sorted array.
21 |
22 | Input {16,19,21,25,3,5,8,10}, To be search = 5
23 |
24 | Output : 5 (index of the element)
25 |
26 | ### Problem #5
27 | Find the minimum element in a sorted and rotated array
28 |
29 | Example:
30 |
31 | input {16,19,21,25,3,5,8,10};
32 |
33 | Output: 3
34 |
35 | ### Problem #6
36 | Find the number occurring an odd number of times in an array.
37 |
38 | Input {20, 40, 50, 40, 50, 20, 30, 30, 50, 20, 40, 40, 20}
39 |
40 | Ouptput = 50
41 |
42 | ### Problem #7
43 | You are given arrival and departure time of trains reaching to a particular station. You need to find minimum number of platforms required to accommodate the trains at any point of time.
44 |
45 | For example:
46 |
47 | arrival {1:00, 1:40, 1:50, 2:00, 2:15, 4:00}
48 |
49 | departure {1:10, 3:00, 2:20, 2:30, 3:15, 6:00}
50 |
51 | Output: 4
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Coding/Day_43.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Printing patterns using code.
3 |
4 | ### Problem #1
5 | Write a Program to print the following pyramid star pattern.
6 | ```
7 | *
8 | ***
9 | *****
10 | *******
11 | *********
12 | ```
13 | ### Problem #2
14 | Write a Program to print the following pyramid pattern using numbers.
15 |
16 | 1
17 | 2 3 2
18 | 3 4 5 4 3
19 | 4 5 6 7 6 5 4
20 | 5 6 7 8 9 8 7 6 5
21 |
22 | ### Problem #3
23 | Write a Program to print Diamond star pattern.
24 | ```
25 | *
26 | ***
27 | *****
28 | *******
29 | *********
30 | *******
31 | *****
32 | ***
33 | *
34 | ```
35 | ### Problem #4
36 | Write a Program to print Diamond number pattern.
37 | ```
38 | 1
39 | 123
40 | 12345
41 | 1234567
42 | 123456789
43 | 1234567
44 | 12345
45 | 123
46 | 1
47 | ```
48 | ### Problem #5
49 | Write a Program to print Palindromic pyramid pattern.
50 | ```
51 | 1
52 | 121
53 | 12321
54 | 1234321
55 | 123454321
56 | ```
57 | ### Problem #6
58 | Write a Program to print Floyd’s triangle.
59 |
60 | Floyd’s triangle, named after Robert Floyd, is a right angled triangle which is made up using natural numbers. It start from 1 and consecutively selects the next greater number in the sequence.
61 | In the Floyd’s triangle, there are n integers in the nth row and total of (n(n+1))/2 integer in the rows.
62 | ```
63 | 1
64 | 2 3
65 | 4 5 6
66 | 7 8 9 10
67 | 11 12 13 14 15
68 | ```
69 | ### Problem #7
70 | Write a Program to print Pascal triangle.
71 |
72 | Pascal triangle is the set of numbers arranged in the form of triangle.Each number in the row is the sum of the left number and right number on the above row. if a number is missing in the above row, it is assumed to be 0. the first row starts with number 1.
73 | ```
74 | 1
75 | 1 1
76 | 1 2 1
77 | 1 3 3 1
78 | 1 4 6 4 1
79 | ```
80 |
--------------------------------------------------------------------------------
/Coding/Day_49.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Two pointer technique
3 |
4 | ## Resources to explore
5 | - https://algodaily.com/lessons/using-the-two-pointer-technique
6 | - https://leetcode.com/articles/two-pointer-technique/
7 |
8 | ## Problem Statement 1#
9 | Reverse String
10 | - https://leetcode.com/problems/reverse-string/
11 |
12 | ## Problem Statement 2#
13 | Long Pressed Name
14 | - https://leetcode.com/problems/long-pressed-name/
15 |
16 | ## Problem Statement 3#
17 | Valid Palindrome
18 | - https://leetcode.com/problems/valid-palindrome/
19 |
20 | ## Problem Statement 4#
21 | Flipping an Image
22 | - https://leetcode.com/problems/flipping-an-image/
23 |
24 | ## Problem Statement 5#
25 | Reverse Words in a String
26 | - https://leetcode.com/problems/reverse-words-in-a-string-iii/
27 |
28 | ## Problem Statement 6#
29 | Reverse Only Letters
30 | - https://leetcode.com/problems/reverse-only-letters/
31 |
32 | ## Problem Statement 7#
33 | Count Binary Substrings
34 | - https://leetcode.com/problems/count-binary-substrings/
35 |
--------------------------------------------------------------------------------
/Coding/Day_55.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Matrix
3 |
4 | ### Reference links
5 | https://www.programiz.com/java-programming/multidimensional-array
6 |
7 | ### Problem Statement #1
8 | Transpose Matrix
9 | https://leetcode.com/problems/transpose-matrix/
10 |
11 | ### Problem Statement #2
12 | Count Negative Numbers in a Sorted Matrix
13 | https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix/
14 |
15 | ### Problem Statement #3
16 | Lucky Numbers in a Matrix
17 | https://leetcode.com/problems/lucky-numbers-in-a-matrix/
18 |
19 | ### Problem Statement #4
20 | Matrix Diagonal Sum
21 | https://leetcode.com/problems/matrix-diagonal-sum/
22 |
23 | ### Problem Statement #5
24 | Special Positions in a Binary Matrix
25 | https://leetcode.com/problems/matrix-diagonal-sum/
26 |
27 | ### Problem Statement #6
28 | Determine Whether Matrix Can Be Obtained By Rotation
29 | https://leetcode.com/problems/determine-whether-matrix-can-be-obtained-by-rotation/
30 |
--------------------------------------------------------------------------------
/Coding/Day_61.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Substring
3 |
4 | ### Problem Statement #1
5 | Number of Strings That Appear as Substrings in Word
6 | - https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word/
7 |
8 | ### Problem Statement #2
9 | Count Binary Substrings
10 | - https://leetcode.com/problems/count-binary-substrings/
11 |
12 | ### Problem Statement #3
13 | Longest Nice Substring
14 | - https://leetcode.com/problems/longest-nice-substring/
15 |
16 | ### Problem Statement #4
17 | Largest Substring Between Two Equal Characters
18 | - https://leetcode.com/problems/largest-substring-between-two-equal-characters/
19 |
20 | ### Problem Statement #5
21 | Longest Substring Without Repeating Characters
22 | - https://leetcode.com/problems/longest-substring-without-repeating-characters/
23 |
24 | ### Problem Statement #6
25 | Find All Anagrams in a String
26 | - https://leetcode.com/problems/find-all-anagrams-in-a-string/
27 |
28 | ### Problem Statement #7
29 | Permutation in String
30 | - https://leetcode.com/problems/permutation-in-string/
31 |
--------------------------------------------------------------------------------
/Coding/Day_67.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Sorting algorithm - bubble-sort
3 |
4 | ### Resources
5 | - https://www.freecodecamp.org/news/bubble-sort/
6 |
7 | ### Problem Statement #1
8 | https://www.hackerearth.com/practice/algorithms/sorting/bubble-sort/practice-problems/algorithm/min-max-difference/
9 |
10 | ### Problem Statement #2
11 | https://www.hackerearth.com/practice/algorithms/sorting/bubble-sort/practice-problems/algorithm/the-best-player-1/
12 |
13 | ### Problem Statement #3
14 | https://www.hackerearth.com/practice/algorithms/sorting/bubble-sort/practice-problems/algorithm/save-patients/
15 |
16 | ### Problem Statement #4
17 | https://www.hackerearth.com/practice/algorithms/sorting/bubble-sort/practice-problems/algorithm/balanced-partition-818edecd/
18 |
--------------------------------------------------------------------------------
/Coding/Day_73.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Sorting algorithm - Insertion Sort
3 |
4 | ### Resources
5 | - https://www.interviewbit.com/tutorial/insertion-sort-algorithm/
6 |
7 | ### Problem Statement #1
8 | Insertion Sort - https://www.hackerearth.com/practice/algorithms/sorting/insertion-sort/practice-problems/algorithm/insertion-sort-problem/
9 |
10 | ### Problem Statement #2
11 | Monk and Nice Strings - https://www.hackerearth.com/practice/algorithms/sorting/insertion-sort/practice-problems/algorithm/monk-and-nice-strings-3/
12 |
--------------------------------------------------------------------------------
/Coding/Day_79.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Sorting Algorithm - Selection Sort
3 |
4 | ### Reference
5 | - https://www.hackerearth.com/practice/algorithms/sorting/selection-sort/tutorial/
6 |
7 | ### Problem Statement #1
8 | https://www.hackerrank.com/contests/17cs1102/challenges/3c-implement-selection-sort
9 |
10 | ### Problem Statement #2
11 | https://www.hackerearth.com/practice/algorithms/sorting/selection-sort/practice-problems/algorithm/old-keypad-in-a-foreign-land-24/
12 |
--------------------------------------------------------------------------------
/Coding/Day_85.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Algorithm - Merge Sort
3 |
4 | ### Reference
5 | - https://www.hackerearth.com/practice/algorithms/sorting/merge-sort/tutorial/
6 |
7 | ### Problem statement #1
8 | https://www.hackerrank.com/contests/17cs1102/challenges/merge-sort-6
9 |
10 | ### Problem statement #2
11 | https://www.hackerearth.com/practice/algorithms/sorting/merge-sort/practice-problems/algorithm/sum-of-sum-of-digits-6/
12 |
--------------------------------------------------------------------------------
/Coding/Day_91.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Single responsibility principle
3 |
4 | ### Problem Statement
5 | 1. Identify the problems in the below code
6 | 2. Improve the code by applying single responsibility principle. You can add new interface/classes if required.
7 | ```
8 | public class Animal{
9 | private Integer id;
10 | private String name;
11 | private Connection con = null;
12 |
13 | public void saveAnimal(){
14 | // Save animal object to database
15 | }
16 |
17 | public Animal getAnimal(int id)
18 | {
19 | // get animal from database based on id
20 | Animal animal = null;
21 | //some code
22 | return animal;
23 | }
24 |
25 | public boolan validate()
26 | {
27 | return id!=null && id>0;
28 | }
29 |
30 | }
31 | ```
32 |
--------------------------------------------------------------------------------
/Coding/Day_97.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Basics of stack
3 |
4 | ### Problem Statement
5 | https://www.hackerearth.com/practice/data-structures/stacks/basics-of-stacks/practice-problems/algorithm/katrina-and-library-c2ed51f3/
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DailyPractice
2 | This repository will contain the daily challenges (coding and testing) for practice purpose.
3 |
--------------------------------------------------------------------------------
/SQL/Day_04.md:
--------------------------------------------------------------------------------
1 | ### Problem 1
2 | ```
3 | SELECT column, AGG_FUNC(column_or_expression), …
4 | FROM a_table
5 | INNER JOIN some_table
6 | ON a_table.column = some_table.column
7 | WHERE a_condition
8 | GROUP BY column
9 | HAVING some_condition
10 | ORDER BY column
11 | LIMIT 5;
12 | ```
13 | In what order does SQL run the clauses? Select the correct option from the list of choices below:
14 | 1. SELECT, FROM, WHERE, GROUP BY
15 | 2. FROM, WHERE, HAVING, SELECT, LIMIT
16 | 3. SELECT, FROM, INNER JOIN, GROUP BY
17 | 4. FROM, SELECT, LIMIT, WHERE
18 |
19 | ### Problem 2
20 | Given the table below, write a SQL query that retrieves the personal data about alumni who scored above 16 on their calculus exam.
21 |
22 | alumni
23 | | student_id | name | surname | birth_date | faculty |
24 | |------------|---------|---------|------------|----------------|
25 | | 347 | Daniela | Lopes | 1991-04-26 | Medical School |
26 | | 348 | Robert | Fischer | 1991-03-09 | Mathematics |
27 |
28 | evaluation
29 | | student_id | class_id | exam_date | grade |
30 | |------------|----------|------------|-------|
31 | | 347 | 74 | 2015-06-19 | 16 |
32 | | 347 | 87 | 2015-06-06 | 20 |
33 | | 348 | 74 | 2015-06-19 | 13 |
34 |
35 | curriculum
36 | | class_id | class_name | professor_id | semester |
37 | |----------|------------|--------------|-------------|
38 | | 74 | algebra | 435 | 2015_summer |
39 | | 87 | calculus | 532 | 2015_summer |
40 | | 46 | statistics | 625 | 2015_winter |
41 |
--------------------------------------------------------------------------------
/SQL/Day_10.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | You have the following table:
3 | | Year | Month | Sales |
4 | | --- | --- | --- |
5 | | 2021 | May | 2000 |
6 | | 2021 | Dec | 45678 |
7 | | 2021 | Jun | 43453 |
8 | | 2021 | July | 76767 |
9 | | 2021 | Jan | 2122340 |
10 | | 2021 | Nov | 79979 |
11 | | 2021 | Aprl | 553 |
12 | | 2021 | Aug | 53535 |
13 | | 2021 | Oct | 2689 |
14 | | 2021 | Feb | 97544 |
15 | | 2021 | Mar | 10000 |
16 | | 2021 | Sep | 24567 |
17 |
18 | Write a SQL Query to sort the data in ascending order of Month (Jan to Dec)
19 |
20 | ### Hint:
21 | You can use case statement
22 |
--------------------------------------------------------------------------------
/SQL/Day_100.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Parameterize SQL Query
3 |
4 | ### Problem statement 1
5 | How to dynamically pass values into IN Clause?
6 |
7 | EXample:
8 | Select * from
where somecoloumvalue in (value1, value2, ..., valuen)
9 |
10 | You need to come up with a query where you can pass dynamic parameter in the IN clause.
11 |
--------------------------------------------------------------------------------
/SQL/Day_16.md:
--------------------------------------------------------------------------------
1 | You have two SQL tables. The first one is called employees and it contains the employee names, the unique employee ids and the department names of a company.
2 |
3 | Example:
4 | | department_name | employee_id | employee_name |
5 | |-----------------|-------------|-------------------|
6 | | Sales | 123 | John Doe |
7 | | Sales | 211 | Jane Smith |
8 | | HR | 556 | Billy Bob |
9 | | Sales | 711 | Robert Hayek |
10 | | Marketing | 235 | Edward Jorgson |
11 | | Marketing | 236 | Christine Packard |
12 |
13 | The second table is named salaries. It holds the same employee names and the same employee ids and the salaries for each employee.
14 | Example:
15 | | salary | employee_id | employee_name |
16 | |--------|-------------|-------------------|
17 | | 500 | 123 | John Doe |
18 | | 600 | 211 | Jane Smith |
19 | | 1000 | 556 | Billy Bob |
20 | | 400 | 711 | Robert Hayek |
21 | | 1200 | 235 | Edward Jorgson |
22 | | 200 | 236 | Christine Packard |
23 |
24 | Write a query to get every department where the average salary per employee is lower than $500.
25 |
--------------------------------------------------------------------------------
/SQL/Day_22.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | You work for a startup that makes an online presentation software. You have an event log that records every time a user inserted an image into a presentation. (One user can insert multiple images.) The event_log SQL table looks like this:
3 |
4 | | user_id | event_date_time |
5 | |---------|-----------------|
6 | | 7494212 | 1535308430 |
7 | | 7494212 | 1535308433 |
8 | | 1475185 | 1535308444 |
9 | | 6946725 | 1535308475 |
10 | | 6946725 | 1535308476 |
11 | | 6946725 | 1535308477 |
12 |
13 | Write an SQL query to find out how many users inserted more than 1000 but less than 2000 images in their presentations!
14 |
--------------------------------------------------------------------------------
/SQL/Day_28.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 |
3 | You have the users tables with following columns:
4 |
5 | | user_id | username |
6 | |---------|-------------|
7 | | 1 | John Doe |
8 | | 2 | Jane Don |
9 | | 3 | Alice Jones |
10 | | 4 | Lisa Romero |
11 |
12 | training_details table having following columns:
13 |
14 | | user_training_id | user_id | training_id | training_date |
15 | |------------------|---------|-------------|---------------|
16 | | 1 | 1 | 1 | "2015-08-02" |
17 | | 2 | 2 | 1 | "2015-08-03" |
18 | | 3 | 3 | 2 | "2015-08-02" |
19 | | 4 | 4 | 2 | "2015-08-04" |
20 | | 5 | 2 | 2 | "2015-08-03" |
21 | | 6 | 1 | 1 | "2015-08-02" |
22 | | 7 | 3 | 2 | "2015-08-04" |
23 | | 8 | 4 | 3 | "2015-08-03" |
24 | | 9 | 1 | 4 | "2015-08-03" |
25 | | 10 | 3 | 1 | "2015-08-02" |
26 | | 11 | 4 | 2 | "2015-08-04" |
27 | | 12 | 3 | 2 | "2015-08-02" |
28 | | 13 | 1 | 1 | "2015-08-02" |
29 | | 14 | 4 | 3 | "2015-08-03" |
30 |
31 | Write a query to to get the list of users who took the a training lesson more than once in the same day, grouped by user and training lesson, each ordered from the most recent lesson date to oldest date.
32 |
--------------------------------------------------------------------------------
/SQL/Day_34.md:
--------------------------------------------------------------------------------
1 | ## Problem Statement
2 | Consider an orders table with the following structure:
3 |
4 | | OrderID | OrderDate | OrderPrice | OrderQuantity | CustomerName |
5 | |---------|------------|------------|---------------|--------------|
6 | | 1 | 12/22/2005 | 160 | 2 | Smith |
7 | | 2 | 08/10/2005 | 190 | 2 | Johnson |
8 | | 3 | 07/13/2005 | 500 | 5 | Baldwin |
9 | | 4 | 07/15/2005 | 420 | 2 | Smith |
10 | | 5 | 12/22/2005 | 1000 | 4 | Wood |
11 | | 6 | 10/2/2005 | 820 | 4 | Smith |
12 | | 7 | 11/03/2005 | 2000 | 2 | Baldwin |
13 |
14 | Write query to solve the following:
15 |
16 | 1. What is the count of total no of orders?
17 | 2. What is the count of the number of orders made by a customer with CustomerName - Smith?
18 | 3. What is the total value of all the orders?
19 | 4. What is the average number of items per order?
20 | 5. What is the average order price when the price is more than 200 and order month is July, 2005?
21 | 6. What is the minimum price paid for any of the orders?
22 | 7. What is the minimum price paid for any of the orders when orderQuantiy = 4?
23 | 8. What is the maximum price paid for any of the orders?
24 | 9. What is the maximum price paid for any of the orders when order id > 3?
25 | 10. What is the maximum price paid for any of the orders when order month is between May and Sep?
26 |
--------------------------------------------------------------------------------
/SQL/Day_40.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Export and Import database
3 |
4 | ### Problem statement
5 | 1. Import a new database from a backup file.
6 | 2. Create some test data for any of the newly created table and perform a bluk insert.
7 | 3. Create a back up of the modified database.
8 | 4. Write down the steps involved in a document.
9 |
10 | ### Hint for importing sample database
11 | SQLServer - If you are using SQL server, you can import AdventureWorks sample databases.
12 | https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver15&tabs=ssms
13 |
14 | MySQL - If you are using MySQL, here is the link to download sample database https://www.mysqltutorial.org/wp-content/uploads/2018/03/mysqlsampledatabase.zip
15 |
16 | More details can be found here - https://www.mysqltutorial.org/mysql-sample-database.aspx
17 |
18 | Oracle - https://www.oracletutorial.com/wp-content/uploads/2019/01/oracle-sample-database.zip
19 |
20 | More details can be found here - https://www.oracletutorial.com/getting-started/oracle-sample-database/
21 |
22 | ### Note:
23 | You can use any relational database to solve this challenge. You can use database IDE or commandline tools.
24 |
--------------------------------------------------------------------------------
/SQL/Day_46.md:
--------------------------------------------------------------------------------
1 | ## Leanring Goal
2 | SQL Joins
3 |
4 | ### Problem statement #1
5 | You have following two tables:
6 | ```
7 | CREATE TABLE `advisors` (
8 | `advisor_id` int(11) NOT NULL AUTO_INCREMENT,
9 | `first_name` varchar(255) NOT NULL,
10 | `last_name` varchar(255) NOT NULL,
11 | PRIMARY KEY (`advisor_id`)
12 | )
13 |
14 | CREATE TABLE `students` (
15 | `student_id` int(11) NOT NULL AUTO_INCREMENT,
16 | `first_name` varchar(255) NOT NULL,
17 | `last_name` varchar(255) NOT NULL,
18 | `advisor_id` int(11) DEFAULT NULL,
19 | PRIMARY KEY (`student_id`),
20 | KEY `advisor_id` (`advisor_id`),
21 | CONSTRAINT `students_ibfk_1` FOREIGN KEY (`advisor_id`) REFERENCES `advisors` (`advisor_id`)
22 | );
23 |
24 | ```
25 | Here is the sample data:
26 | ```
27 | SELECT * FROM students;
28 |
29 | +------------+------------+------------+------------+
30 | | student_id | first_name | last_name | advisor_id |
31 | +------------+------------+------------+------------+
32 | | 1 | Tanisha | Blake | 2 |
33 | | 2 | Jess | Goldsmith | NULL |
34 | | 3 | Tracy | Wu | 3 |
35 | | 4 | Alvin | Grand | 1 |
36 | | 5 | Felix | Zimmermann | 2 |
37 | +------------+------------+------------+------------+
38 | 5 rows in set (0.00 sec)
39 |
40 |
41 | SELECT * FROM advisors;
42 |
43 | +------------+------------+-----------+
44 | | advisor_id | first_name | last_name |
45 | +------------+------------+-----------+
46 | | 1 | James | Francis |
47 | | 2 | Amy | Cheng |
48 | | 3 | Lamar | Alexander |
49 | | 4 | Anita | Woods |
50 | +------------+------------+-----------+
51 | 4 rows in set (0.00 sec)
52 |
53 | ```
54 | 1. Pull all the information on students and their advisors, excluding the students who are not assigned to an advisor.
55 | Hint - Inner Join
56 |
57 | 2. Pull all the information on students and their advisors, including the students who are not assigned to an advisor.
58 | Hint - Left Join
59 |
60 | 3. Pull all the students who are assigned to advisors, plus a list of advisors not assigned to students
61 | Hint - Right Join
62 |
63 | ### Problem statement #2
64 | A small bakery that sells brownies, cookies, pies, and other delicious treats to customers online. It keeps records of all of its online sales in an SQL database that is automatically populated as customers place orders on its site.
65 |
66 | In the database, it has a customers table to keep track of customer contact information, and an orders table to keep track of various orders that those customers have placed. The schema of these tables is as follows:
67 |
68 | ```
69 | CREATE TABLE customers (
70 | customer_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
71 | first_name VARCHAR(255) NOT NULL,
72 | last_name VARCHAR(255) NOT NULL,
73 | email VARCHAR(255) NOT NULL,
74 | address VARCHAR(255) DEFAULT NULL,
75 | city VARCHAR(255) DEFAULT NULL,
76 | state VARCHAR(2) DEFAULT NULL,
77 | zip_code VARCHAR(5) DEFAULT NULL,
78 | );
79 |
80 | CREATE TABLE orders (
81 | order_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
82 | customer_id INT NOT NULL,
83 | order_placed_date DATE NOT NULL,
84 | FOREIGN KEY (customer_id) REFERENCES customers (customer_id)
85 | );
86 | ```
87 | It's the end of 2016, and the owner of the bakery wants to write an SQL query that finds the COUNT of orders placed in 2016 by customer e-mail address. She wants to ORDER the results by the COUNT of orders placed in 2016, descending, so that she can personally send thank-you e-mails to top customers by order volume.
88 |
89 | Can you write a query that will help the owner of the bakery to find the COUNT of all orders placed in 2016, by customer e-mail address, sorted descending?
90 |
--------------------------------------------------------------------------------
/SQL/Day_52.md:
--------------------------------------------------------------------------------
1 | ### Learning Goal
2 | Union/Unionall Sql
3 |
4 | ### Problem statement #1 (Union)
5 | From the following table, write a SQL query to find those salespersons generated the largest and smallest orders on each date. Return salesperson ID, name, order no., highest on/ lowest on, order date.
6 |
7 | Sample table Salesman:
8 |
9 | |salesman_id | name | city | commission |
10 | |-------------|------------|----------|------------|
11 | | 5001 | James Hoog | New York | 0.15 |
12 | | 5002 | Nail Knite | Paris | 0.13 |
13 | | 5005 | Pit Alex | London | 0.11 |
14 | | 5006 | Mc Lyon | Paris | 0.14 |
15 | | 5007 | Paul Adam | Rome | 0.13 |
16 | | 5003 | Lauson Hen | San Jose | 0.12 |
17 |
18 | Sample table Orders:
19 |
20 | | ord_no | purch_amt | ord_date | customer_id | salesman_id |
21 | |--------|-----------|------------|-------------|-------------|
22 | | 70001 | 150.5 | 2012-10-05 | 3005 | 5002 |
23 | | 70009 | 270.65 | 2012-09-10 | 3001 | 5005 |
24 | | 70002 | 65.26 | 2012-10-05 | 3002 | 5001 |
25 | | 70004 | 110.5 | 2012-08-17 | 3009 | 5003 |
26 | | 70007 | 948.5 | 2012-09-10 | 3005 | 5002 |
27 | | 70005 | 2400.6 | 2012-07-27 | 3007 | 5001 |
28 | | 70008 | 5760 | 2012-09-10 | 3002 | 5001 |
29 | | 70010 | 1983.43 | 2012-10-10 | 3004 | 5006 |
30 | | 70003 | 2480.4 | 2012-10-10 | 3009 | 5003 |
31 | | 70012 | 250.45 | 2012-06-27 | 3008 | 5002 |
32 | | 70011 | 75.29 | 2012-08-17 | 3003 | 5007 |
33 | | 70013 | 3045.6 | 2012-04-25 | 3002 | 5001 |
34 |
35 | ### Problem Statement #2 (Union All)
36 | In social network like Facebook or Twitter, people send friend requests and accept others’ requests as well.
37 | Table request_accepted holds the date of friend acceptance, while requester_id and accepter_id both are the id of a person.
38 |
39 | | requester_id | accepter_id | accept_date|
40 | |--------------|-------------|------------|
41 | | 1 | 2 | 2016_06-03 |
42 | | 1 | 3 | 2016-06-08 |
43 | | 2 | 3 | 2016-06-08 |
44 | | 3 | 4 | 2016-06-09 |
45 |
46 | Write a query to find the the people who has most friends and the number of friends. For the sample data above, the result is:
47 |
48 | | id | num |
49 | |----|-----|
50 | | 3 | 3 |
51 |
--------------------------------------------------------------------------------
/SQL/Day_58.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Wildcard and special operators
3 |
4 | ## References
5 | - https://www.w3schools.com/sql/sql_like.asp
6 | - https://www.w3schools.com/sql/sql_wildcards.asp
7 |
8 | ### Problem Statement #1 (LIKE operator and % wildcard)
9 | Write a query to retrieve the prod_id and prod_name fields from a table named Products if the prod_name contains the string 'bean bag'.
10 |
11 | ### Problem Statement #2 (LIKE operator and % wildcard)
12 | Write a query to retrieve the prod_id and prod_name fields from a table named Products if the prod_name start with 'Fish food' and ends with 'Local'.
13 |
14 | ### Problem Statement #3 (LIKE operator and % wildcar and _ wildcard)
15 | Select the column prod_name from the Products table where prod_name begins with any number of occurences of any character, followed by 'bean b', followed by a single instance of any character, followed by 'g', followed by any number of occurrences of any character.
16 |
17 | ### Problem Statement #4 (LIKE operator and % wildcard)
18 | Create SELECT statements that test the following strings against the search string 'j%_uery' (first one has the query and result)
19 |
20 | - 'jquery'
21 |
22 | Query - SELECT 'jquery' LIKE 'j%_uery';
23 |
24 | Result - 1
25 |
26 | - ' jquery' (note the leading space)
27 | - 'jquery ' (note the trailing space)
28 | - 'jQuery'
29 | - 'JoeQuery'
30 | - 'joeQuery'
31 |
--------------------------------------------------------------------------------
/SQL/Day_64.md:
--------------------------------------------------------------------------------
1 | ### Learning Goal
2 | SQL View
3 |
4 | ### Resources
5 | - https://www.sqlshack.com/sql-view-a-complete-introduction-and-walk-through/
6 | - https://towardsdatascience.com/10-examples-to-understand-sql-views-bcbc999a54e7
7 |
8 |
9 | ### Problem statement #1
10 | From the following table, create a view for those salespersons belong to the city 'New York'.
11 |
12 | |salesman_id | name | city | commission |
13 | |------------|------------|----------|------------|
14 | | 5001 | James Hoog | New York | 0.15|
15 | | 5002 | Nail Knite | Paris | 0.13|
16 | | 5005 | Pit Alex | London | 0.11|
17 | | 5006 | Mc Lyon | Paris | 0.14|
18 | | 5007 | Paul Adam | Rome | 0.13|
19 | | 5003 | Lauson Hen | San Jose | 0.12|
20 |
21 | ### Problem statement #2
22 | From the following table, create a view to count the number of customers in each grade.
23 |
24 | |customer_id | cust_name | city | grade | salesman_id |
25 | |------------|------------|----------|------------|--------------|
26 | | 3002 | Nick Rimando | New York | 100 | 5001|
27 | | 3007 | Brad Davis | New York | 200 | 5001|
28 | | 3005 | Graham Zusi | California | 200 | 5002|
29 | | 3008 | Julian Green | London | 300 | 5002|
30 | | 3004 | Fabian Johnson | Paris | 300 | 5006|
31 | | 3009 | Geoff Cameron | Berlin | 100 | 5003|
32 | | 3003 | Jozy Altidor | Moscow | 200 | 5007|
33 | |3001 | Brad Guzan | London | 100 | 5005|
34 |
35 | ### Problem statement #3
36 | From the following table, create a view to count the number of unique customer, compute average and total purchase amount of customer orders by each date.
37 |
38 | |ord_no | purch_amt| ord_date| customer_id| salesman_id|
39 | |---------| ----------| ----------| ----------- |-----------|
40 | |70001 | 150.5 | 2012-10-05| 3005 | 5002 |
41 | |70009 | 270.65 | 2012-09-10| 3001 | 5005|
42 | |70002 | 65.26 | 2012-10-05 | 3002 | 5001|
43 | |70004 | 110.5 | 2012-08-17 | 3009 | 5003|
44 | |70007 | 948.5 | 2012-09-10 | 3005 | 5002|
45 | |70005 | 2400.6 | 2012-07-27 | 3007 | 5001|
46 | |70008 | 5760 | 2012-09-10 | 3002 | 5001|
47 | |70010 | 1983.43 | 2012-10-10 | 3004 | 5006|
48 | |70003 | 2480.4 | 2012-10-10 | 3009 | 5003|
49 | |70012 | 250.45 | 2012-06-27 | 3008 | 5002|
50 | |70011 | 75.29 | 2012-08-17 | 3003 | 5007|
51 | |70013 | 3045.6 | 2012-04-25 | 3002 | 5001|
52 |
53 |
--------------------------------------------------------------------------------
/SQL/Day_70.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Finding duplicate records
3 |
4 | ### Problem Statement #1
5 | You have a table containing columns username, email and employeeid. Write a query to find out exact duplicate records in the table.
6 |
7 | ### Problem Statement #2
8 | Delete the duplicate records found using the above query keeping the latest record only.
9 |
10 | ### Prblem Statement #3
11 | Rewrite the above query using Rank function.
12 |
--------------------------------------------------------------------------------
/SQL/Day_76.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Change column value with a pattern
3 |
4 | ### Problem statement
5 | You need to pad zeros to the values from a column with number datatype.
6 |
7 | Example:
8 | - Change 1 to 0001
9 | - Change 2 to 0002
10 | - Change 3 to 0003
11 | - Change 10 to 0010
12 | - Change 100 to 0100
13 | - Change 1000 to 1000
14 |
15 | Maximum number of digits in the output = 4
16 |
--------------------------------------------------------------------------------
/SQL/Day_82.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Convert Rows to Columns in SQL
3 |
4 | ### Problem Statement
5 |
6 | ### Steps to follow
7 | 1. Create a database
8 | 2. create a table demo_table in the database.
9 | ```
10 | CREATE TABLE demo_table(
11 | NAME varchar(30),
12 | COLLEGE varchar(30),
13 | EXAM_DATE DATE,
14 | SUBJECTS varchar(30),
15 | MARKS int);
16 | ```
17 | 3. Insert data into the table
18 | 4. Convert the rows into column.
19 |
20 | ### Sample Input data
21 | | NAME | COLLEGE | ROLL NUMBER | SUBJECT | MARKS |
22 | |---------|---------|-------------|------------|-------|
23 | | ROMY | BVP | 0261150 | DBMS | 90 |
24 | | ROMY | BVP | 0261150 | NETWORKING | 87 |
25 | | ROMY | BVP | 0261150 | GRAPHICS | 95 |
26 | | PUSHKAR | MSIT | 0898888 | DBMS | 91 |
27 | | PUSHKAR | MSIT | 0898888 | NETWORKING | 90 |
28 | | PUSHKAR | MSIT | 0898888 | GRAPHICS | 78 |
29 |
30 | ### Sample Output data
31 | | NAME | COLLEGE | ROLL NUMBER | DBMS | NETWORKING | GRAPHICS |
32 | |---------|---------|-------------|------|------------|----------|
33 | | ROMY | BVP | 0261150 | 90 | 87 | 95 |
34 | | PUSHKAR | MSIT | 0898888 | 91 | 90 | 78 |
35 |
36 | ### Hint
37 | Use Pivot function
38 |
--------------------------------------------------------------------------------
/SQL/Day_88.md:
--------------------------------------------------------------------------------
1 | ## Learning Goal
2 | Sub Query
3 |
4 | ### Problem statement 1
5 | Write a SQL query to get the second highest salary from the Employee table (columns - id, salary).
6 |
7 | ### Hints
8 | - Using sub query
9 | - Using Correlated SubQuery
10 | - Using subquery and limit
11 | - Using top
12 |
13 | ### Problem statement 2
14 | Update the query to find the nth highest salary from the same table.
15 |
--------------------------------------------------------------------------------
/SQL/Day_94.md:
--------------------------------------------------------------------------------
1 | ### Learning Goal
2 | Date and time
3 |
4 | ## problem Statement
5 | Return the total number of comments received for each user in the last 30 days based on a current date given.
6 |
7 | Table name:
8 | fb_comments_count
9 |
10 | user_id - int
11 |
12 | created_at - datetime
13 |
14 | number_of_comments - int
15 |
16 | ### Hint
17 | - The current date is given therefore, we take the difference of created_at field with the current date.
18 | - Take only the comments that fall in the 30-day window.
19 | - Aggregate the number of comments by user_id.
20 |
--------------------------------------------------------------------------------
/Solutions/Dimpy/Day_02_solution.md.txt:
--------------------------------------------------------------------------------
1 | public static void main(String[] args) throws InterruptedException {
2 | WebDriver driver = new ChromeDriver();
3 | driver.get("https://generic-ui.com/demo");
4 | driver.manage().window().maximize();
5 |
6 | //Clicking on the dropdown to select number of rows
7 | driver.findElement(By.xpath("//div[@class='gui-select-container']")).click();
8 | Thread.sleep(2000);
9 |
10 | //Selecting row count as 100
11 | driver.findElement(By.xpath("//div[normalize-space()='100 Rows']")).click();
12 |
13 | //Executing javascript command to get the size of the grid
14 | String gridSizeCommand = "var grid = document.getElementById(\"gui-grid-1\");"+
15 | "return grid.__ngContext__[46].length;";
16 | JavascriptExecutor js = (JavascriptExecutor)driver;
17 | Object result = js.executeScript(gridSizeCommand);
18 | System.out.println("No of records selected = " + result);
19 |
20 | //Executing javascript command to get the data from grid
21 | List