Friday, 12 April 2019

What is the difference between PUT and POST method? REST API interview questions? Most asked RestAPI Automation Interview questions?



PUT vs POST : An Example

Let’s list down when to use POST and when to use PUT :

GET     /user-management/users: Get all users
POST     /user-management/users: Create a new user

GET     /user-management/users/{id} : Get the user information identified by "id"
PUT     /user-management/users/{id} : Update the user information identified by "id"


It is good practice to use:

 - PUT for UPDATE operations.
 - POST for CREATE operations.

  • PUT is Idempotent 

Thursday, 7 March 2019

String Manipulation Interview questions? String concat,replace, substring, trim, lowercase, uppercase? Selenium, Automation core java interview questions?

Interview question for SDET 2023?

SDET Interview Question and Answers.  

Jenkins Interview Questions and Answers

Appium Interview Questions and Answers

Selenium Interview Questions and answers

GIT Interview Questions and Answer

 Pre-requisite: How to install JDK and set Java Home path in Windows and MacOs ?

Ans: Click here for Steps


In Java, a string is a sequence of characters. It is a data type used to store text-based information, such as names, addresses, and messages. Strings are represented by the class "String" in Java.


Why String is Immutable?

In Java, a string is immutable, meaning its value cannot be changed once it is created. Once a string object is created, its value cannot be altered.

The reason for this is to ensure that string objects are thread-safe and to improve performance. Since strings are widely used in Java, immutable strings help to prevent errors that can occur due to changes made to the string value by different threads simultaneously. This ensures that the value of the string remains constant throughout the program execution.

Also, immutable strings can be optimized by the Java Virtual Machine (JVM) for memory usage. Since immutable strings cannot be changed, the JVM can reuse existing string objects, rather than creating new ones each time a modification is made. This can result in better performance and reduced memory usage.

In summary, immutability of strings in Java is a design decision made for the purposes of thread-safety, performance, and memory optimization.


String Manipulation

public class StringManipulation {

    public static void main(String[] args) {
        // Strings are immutable
        String str3 = "java";
        str3.concat("oops");
        System.out.println(str3); // java

        // The result should be assigned to a new reference variable (or same
        // variable) can be reused.
        String concat = str3.concat("value2");
        System.out.println(concat); // value1value2

        // -----------------------String methods-------------------------------------
        String str = "abcdefghijk";

        // char charAt(int paramInt)
        System.out.println(str.charAt(2)); // prints a char - c

        // String concat(String paramString)
        System.out.println(str.concat("lmn"));// abcdefghijklmn

        System.out.println("ABC".equalsIgnoreCase("abc"));// true
        System.out.println("ABCDEFGH".length());// 8

        // String replace(char paramChar1, char paramChar2)
        System.out.println("012301230123".replace('0', '4'));// 412341234123

        // String replace(CharSequence paramCharSequence1, CharSequence
        // paramCharSequence2)
        System.out.println("012301230123".replace("01", "45"));// 452345234523

        // All characters from index paramInt
        // String substring(int paramInt)
        System.out.println("abcdefghij".substring(3)); // defghij
        // 0123456789

        // All characters from index 3 to 6
        System.out.println("abcdefghij".substring(3, 7)); // defg
        // 0123456789

        System.out.println("ABCDEFGHIJ".toLowerCase()); // abcdefghij

        System.out.println("abcdefghij".toUpperCase()); // ABCDEFGHIJ

        System.out.println("abcdefghij".toString()); // abcdefghij

        // trim removes leading and trailings spaces
        System.out.println(" abcd  ".trim()); // abcd
    }
}

Java Interview question Set-1:
SET-01 1-10

Java Interview question Set-2:

SET-02 10-20

Java Interview question Set-3:

SET-03 21-30


What are the two ways to create String?

There are two ways to create a string in Java:

  1. Using String literals - This is the most common and simple way of creating a string in Java. A string literal is a sequence of characters enclosed in double quotes. For example:

String str1 = "Hello World"; String str2 = "Java is awesome";

In this method, a new string object is created each time a string literal is assigned to a variable.

  1. Using String constructor - Another way of creating a string in Java is by using the constructor of the String class. This constructor takes a character array as its argument and creates a new string object with the same character sequence. For example:

char[] charArray = {'H', 'e', 'l', 'l', 'o'}; String str3 = new String(charArray);

In this method, we create a character array and pass it as an argument to the String constructor. This creates a new string object with the same character sequence as the character array.

It is important to note that the second method of creating a string using a constructor is less common than the first method, as it is more verbose and requires more steps.

 *******************************************************************

For any doubts or career guidance, reach out to me 

****************************************

TOP 15 BDD - CUCUMBER Interview Q&A


************************************************

✍️AUTHORLinkedIn Profile

************************************************

Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below,API TRaining Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
This includes classnotes, 300+ interview questions, 3 projects, Java Coding question set for product companies along with career guidance from FAANG employees for Automation and SDET.

For more details whatsapp : https://lnkd.in/dnBWDM33

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver

API Testing Interview Question Set:

https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

DevOps Interview Q&A:

https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

Kubernetes Interview Question Set

https://automationreinvented.blogspot.com/search/label/Kubernetes

Docker Interview Question Set

https://automationreinvented.blogspot.com/Docker

Linux Interview question Set

https://automationreinvented.blogspot.com/search/label/Linux

Automation Testing/SDET Framework Design

https://automationreinvented.blogspot.com/search/label/FrameworkDesign

Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java

GIT Interview Question Set:

https://automationreinvented.blogspot.com/2021/09/top-40-git-interview-questions-and.html

Coding Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Mobile Testing Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:

https://automationreinvented.blogspot.com/search/label/Python


 


 


Wednesday, 6 March 2019

How to sort hashmap? sorting with collections? Hashmap sorting with key?

This is a common interview question asked in most of the companies for people with 3+ years of experience in Automation:

public class hashmapsort {

    public static void main(String[] args) {

         HashMap<Integer, String> hmap = new HashMap<Integer, String>();
         hmap.put(1, "Java");
         hmap.put(13, "C");
         hmap.put(2, "Python");
         Map<Integer, String> map = new TreeMap<Integer, String>(hmap);
         System.out.println(" Sorting:");
         Set set2 = map.entrySet();
         Iterator iterator2 = set2.iterator();
         while(iterator2.hasNext()) {
              Map.Entry m2 = (Map.Entry)iterator2.next();
              System.out.print(m2.getKey() + ": ");
              System.out.println(m2.getValue());
         }
    }
}


Note: To sort with values need to do using comparator, will do that in my next post.

Tuesday, 5 March 2019

What are the most used API status codes? RestAPI Interview question? API status Codes?

200:  OK

201:  Created

204:  No Content

400:  Bad Request

401: Unauthorized

403: Forbidden

404: Not Found

302: Redirect

405: Method Not Allowed

422: Unprocessable Entity

417: Expectation failed

500: Internal Server Error


*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Monday, 4 March 2019

How to get the count of elements in an array? Duplicate Elements in array? Count of duplicate elements in array?Collection Interview Questions

This is one of the mostly asked interview question.

package CountElements;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class findduplicate {
    public static void main (String args[]) {
        String str2 = "findduplicateelementsinarray";
        String[] ary = str2.split("");
     ArrayList<String> list = new ArrayList<String>(Arrays.asList(ary));
 //Set does not allow duplicate elements
     Set<String> str1 = new HashSet<String>();{
     for ( String str21 : list) {
         if (str1.add(str21) == false) {
             System.out.println(str21 + " occurs: " + Collections.frequency(list, str21) +": is the Duplicate Element");
         }else if (Collections.frequency(list, str21) < 2) {
             System.out.println(str21 + " occurs: " + Collections.frequency(list, str21));
         }
     }
   
}}
}

*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions





Note: Ask me questions in the comment section, or any doubts on the above post.

Click To Learn most asked Interview question
Java questions:
Most asked Java Interview Questions

Wednesday, 19 September 2018

What is Automation Test Estimation? Estimation Template/Excel sheet representation of estimation sheet/interview qus for 5+ years of exp/Describe estimation format for client before starting design of test scripts?

Automation Test Estimation:

Estimation for automation is most important thing when u have more than 4 years of exp in testing.
So as we dont have any particular tool for this so many of us confused what could be standard format

In interview for exp automation tester this is a very imp aspect to know or learn, expected qus:
  •  What are automation estimation factors
  •  AutomationEstimationTemplate
  •  What are the standards should be used while preparing estimation

So to answer all those qus below I am sharing a very comprehensive and the best suitable standardized  AutomationEstimationTemplate:

Note: Don't refer the data













Wednesday, 8 August 2018

How to start your career with Automation?Step by step guide to know where to start and what are the area need to focus/want to learn automation/manual tester/fresher tips

There is a common question in everyone's mind who are just 1-2 years of experience or someone who has joined a mnc as a manual tester just to start their career.But they want to do something with automation or want to learn the technology and as all say to be a "Coder".

Below are some very important points to keep in mind when you try to shift your technology:

STEP-1:
Learn scripting and programming language:
 Don't focus on automation tools, coz tools will come and go but the design pattern and framework structure is common for almost all the tools in the market. So better to learn a OOPS language so that you can cope up with any tool or framework.

STEP-2: 
Linux/Unix:
Next step will be learning Linux/Unix OS. No one will say to learn Linux or Unix for automation but trust me if you want start your automation career then now a dayz and going forward all major technology will work on Ubuntu or Linux. So be well equipped with these, and if you don't know docker but you are very good with Ubuntu then they are going to hire you for sure.

STEP-3:
SQL/Database:
Third thing which is most important is learning database, you must think that it is only needed for database testing but automation means validation of data and when we talk about data then the first thing that comes to our mind is database. Learn SQL thoroughly so that you can cope up with the market efficiently.

STEP-4:
TOOL/Technology:
So now we are ready to select a automation tool which we want to learn. In market there are n number of tools and it is better to learn the tool which will be there in market for a longtime, so below I have mentioned some of the automation technology according to the priority:

1. Selenium webdriver
2. API Automation
3. Test Complete
4. UFT
5. Coded UI



So here I have given a brief idea, going further I will add individual topic on each technology.
 

*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

All Time Popular Posts

Most Featured Post

𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀?

❓ 𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀? The issue isn’t your logic—it’s the lack of pattern recogniti...