Java : Given two unsorted arrays ,write a program to remove duplicates and merge it into sorted order


package com.qahumor;

import java.util.Iterator;
import java.util.TreeSet;

/*@author : qahumor 
 * Given two Unsorted Arrays a1 and a2, 
 * Remove duplicates and merged both into sorted order  
 * 
 */

public class TwoUnsortedArrayMergedAndSorted {

 public static void main(String[] args) {
  
  int[] a1 = {1,2,3,49,6,77,8};
  int[] a2 = {3,67,77,3,10,54};
  int[] a3;
  
  TreeSet<Integer> ts = new TreeSet<Integer>();

  for(int i = 0 ; i < a1.length;i++){
   ts.add(a1[i]);
  }
  
  for(int j = 0 ; j < a2.length ; j++){
   ts.add(a2[j]);
  }
  
  Iterator<Integer> it = ts.iterator();
  a3 = new int[ts.size()];
  int k =0;
  while(it.hasNext()){
   a3[k] = it.next();
   k++;
  }
  
  
  for(int p = 0 ; p < a3.length ; p++){
   System.out.print(a3[p]+",");
  }
 }

}

JAVA : Program to check a given string, if rotated is a palindrome or not

/* * @author : P programs
    * Check if a given string becomes palindrome after rotation or not.
    * Exp : mmo , aaplaaeep , travel
    *
    *We can check for the count of each character in a string , If the total count of 2 chars are equal to                
        1 then the string can't be palindrome.
 */

package pprograms;

import java.util.HashMap;
import java.util.Scanner;


public class CheckStringRotationPalindrome {

public static void main(String[] args) {


Scanner sc = new Scanner(System.in);

System.out.println("Enter a String ");
 
                String str = sc.next();
  HashMap<Character , Integer> hs = new HashMap<Character, Integer>();
int len = str.length();
int count = 0;

for(int i = 0 ; i < len ; i++ ){

if(hs.get(str.charAt(i))!=null){

hs.put(str.charAt(i), hs.get(str.charAt(i))+1);

}else{

hs.put(str.charAt(i), 1);

}
}

for(int i = 0 ; i < len ; i++ ){

if(hs.get(str.charAt(i))==1){
count ++;
if(count == 2){
break;
}
}
}

if(count ==1 ){
System.out.println("String can become palindrome after rotation");
}else{
System.out.println("String can't become palindrome even after rotation");
}
}
}

Android : How to download .apk file from playstore


Here is the simple procedure to download the .apk file from playstore or from mobile device.

Procedure 1: Downloading from google playstore


Step1 : Browse URL https://play.google.com/store?hl=en
Step2 : Search for your app which you want to download, for example facebook.
Step3 : Select and click on the appropriate facebook app from list available.
Step4 : Copy the URL from address bar as it contains the app package name , see the pic below

Step5: Browse URL http://apps.evozi.com/apk-downloader/
Step6: Paste the copied URL in step4 to textbox as shown below.
Step7: Click on Generate Download link and click on download button as shown with highlighted button in red.

Testing : Key information gathering before you start testing/involving in a new product



I have been testing product from more than 7+ years and seen people specially freshers or test-leads who recently started handling projects facing problem initially in information gathering of product . In IT industry as we all know that teams are spread across the globe who are working on similar project. And getting same/all information's about product at once is a big headache. Most the time meeting happens at a time which does not suits to your timing and you may miss some critical updates /schedule or information or didn't follow your mails because of some or the other reasons. Ultimately you won't be having all the required information's of product at one place as it spreads across your email. So based on my experience and the issue faced , I jotted down some key questions which we can ask to Project Managers or Stake holders or leads(in case of fresher) before we start testing/involving in a product.

1- Ask for product functional specification.

2- What are the new features added to product?(applicable for product having incremental release)

3- Availability of reading stuffs includes any product document ,admin guide ,videos, hands-on docs etc

4- Ask for project milestone which includes CC/FF/SI/RC/RTM date etc.

5- Supported language of the product(if your product supports MUI)

6- Supported platforms of the product i.e. OS(32 or 64 bit )/Browser/Versions/Mobile devices etc

7- Ask for build location , from which branch build should be picked like main branch, staging etc.

8- Is the build available via Testfairy, Jenkins or ask for share location where builds are kept.

9- Which tool is used to maintain the stories of new features like JIRA, AtTask etc , if you are following agile methodologies .

10- What is the target version of product

11- Ask for Upgrade scenario. For example

              11.1- build to build upgrade is supported or not.

              11.2- Upgrade from previous version is supported or not.

              11.3- downgrade to previous version is supported or not.

12- Previous version compatibility is supported or not. If your server version is new , can older version client connects to new server and vice-versa.

13- Area which needs more testing efforts.

14- Ask for bug reporting guidelines if any and you can narrow down to few things/parameters

            14.1- Found in release

            14.2- Target Release

            14.3- Developer contacts

            14.4- Severity guidelines of bug

15- Any 3rd parties software integration required etc

16- Automation scripts is available for this product or can this be automated etc.




These are some points which helps you to get started but I believe there will be many more such questions are present. I would to request you to share your experience in comment sections.

Android : How to connect your Android device over Wifi using ADB command for App debugging

How to connect your Android device over Wi-Fi using ADB command Sometimes it requires to connect your Android dev...