What We Are Learn On This Post
FICO Interview Questions: The most important part of preparing for an interview is practice. Knowing what job interview questions you might be asked is essential – that way, you can craft your answers well in advance, and feel confident in your responses when the pressure is on.
Wouldn’t it be great if you knew exactly what interview questions are asked for the Test Engineer, QA for Manual & Automation Positions, We can’t read minds, unfortunately, but we’ll give you the next best thing: a list of previously asked FICO interview questions and answers.
Post On: | FICO Interview Questions |
Post Type: | Interview Questions |
Published On: | www.softwaretestingo.com |
Applicable For: | Freshers & Experience |
Get Updates: | Software Testingo Telegram Group |
We have tried to share some of the manual testing interview questions, selenium interview questions & testing interview questions also, but we are recommending spending some quality time to get comfortable with what might be asked when you go for the FICO interview.
Still, we need you are love and support to make this platform more helpful to our fellow testers. So it would be great if you will share your recent interview questions and experience with us. You Can share those details by connecting us at softwaretestingo.com@gmail.com.
FICO Java Selenium Interview questions
What is the default package in Java?
Ans: java.lang is the default package.
Why we use interface? Why not an abstract class. What if I implement the same method in the interface and abstract then? Any difference?
Ans: When some of the functionalities are common among implementing a class, and some are class-specific, then we go for abstract class when all the functionalities are common to the implementing classes. Implementation is class-specific, then we go with an interface. An interface has all abstract methods, the class which implements the interface should implement all the methods, and abstract class is the class which has both abstract methods and concrete methods to implement the common functionalities.
So if there is a common method in the interface and the abstract class, and if the class implements the interface and can extend only one class if the method is abstract, then the subclass will add the functionality. So there won’t be any difference among them. In case the common method is concrete in the abstract class. When the class implements the interface having a common method and extends the abstract class, the subclass if implements the common method, then the method is overridden, if we want the abstract class method functionality then we can upcast while creating the object so that we can choose what we wish to while creating the object.
What are inner classes name them?
Ans: In Java, just like methods, variables of a class, too, can have another class as its member. Writing a class within another is allowed in Java. The class written within is called the nested class, and the class that holds the inner class is called the outer class. There are four types of inner classes: member, static member, local, and anonymous.
In public static void main(String arr[])… what if I replace public with private ……….. remove static ……..replace the void with string
Ans: We cannot execute the main method since it is not static. It will not get executed. If the main is public, JVM recognizes the main method outside the class Since the main is the function that acts as an execution point. The main function is called by the JVM, which is outside the class, so it must be declared as public. If we declare as private, then JVM will not be able to access it. Static is a kind of keyword used in java to specify that there is no need to create an instance of it.
As we know the main method also reside inside a class and to access the particular function of a class from outside the class (In this case from JVM), an instance of that particular class is needed, so to avoid these we simply put static to make access main method outside of class., so if we remove static we need to create an object to access the main method, so not possible to execute. the execution of the main method happens if the main does not return any value, i.e. void. If not, we get an error when the return type is string while executing it.
In hashmap, we have (key and value ) pair, can we store a value =(key, value ) again?
Ans: Yes, we can store in value =(key, value) again in the hash map the syntax is.
HashMap<String,HashMap<String,String>> countries=new HashMap<>(); countries.put("IN", incities); HashMap<String,String> incities=new HashMap<>(); incities.put("KAR","Bangalore"); incities.put("AP", "Hyderabad"); incities.put("TN","Chennai"); incities.put("MH", "Mumbai");
What is the variable scope in java (in class, in the method, in a static block)
Ans: scope of a variable in class if it is non-static and static variable then within the class, in the method it is within the method block, and in a static block within the block which is declared as static and it gets initialized when the static block gets executed before the main method.
What is the oops concept? explain them each with real-world examples
Ans: The oops concept is which allows creating an object to define a class and supports the abstraction: It is defined as the essential features of a system without or partially involved in complexity, this can be achieved by using abstract class and real-life interface example of
Abstraction is ATM Machine; All are performing operations on the ATM-like cash withdrawal, money transfer, retrieve mini-statement, …etc. But we can’t know the internal details about ATM. Polymorphism: A method of performing the different tasks based on different contexts, which is achieved as in method overloading and redefining a task or enhanced task in the subclass as in method overriding. In a classroom that time we behave like a student, when we are in the market at that time we behave like a customer when at home that time we behave like a son or daughter, Here one person present in different-different behaviors.
Inheritance: Inheriting all the properties of the parent class to the child class except private members. This can be achieved using the extends keyword, we can inherit all the static, nonstatic, final members. The real-life example of inheritance is his son inherits child and parents, all the properties of the father. Encapsulation: Binding the data members with member functions. Packing the data with member functions and hiding the data from the actual implementation can be achieved by making the data members as private and accessing the member functions through public getter and setter method.
A car as an example. What are the expectations of Car? Start the car. Accelerate the car. Accelerate more and more. Break. Move to reverse slowly. Stop. That’s it. To achieve this behavior, you are provided with some of the mechanisms. Ignition to start and stop the car. Gearbox, accelerator, and break to increase or decrease the speed of a car. You use this accelerator and break to achieve the desired speed of the car.
Write a program so that whenever you create an object. you get to know how many objects you have created
public class NumofObjects { static int cnt; NumofObjects() { cnt++; } public static void main(String[] args) { NumofObjects n=new NumofObjects(); new NumofObjects(); new NumofObjects(); NumofObjects n1=n; System.out.println("No of objects created is "+cnt); } }
What is singleton classes?
Ans: A singleton class is a class in which we can create one object at any time if we try to create more than one object the reference to the other object remains the same.
What is difference between .equals() , (==) and compare-to();
Ans: equals() is a method in Object class which when overridden will compare the values, by default it compares values in String and all the wrapper classes, otherwise it compares the address of the two reference variable.== is the relational operator which compares the values of two primitive type variables, but when used with reference variables compares address.compare-to():
The method compareTo() is used for comparing two strings. Each character of both the strings is converted into a Unicode value for comparison. If both the strings are equal, then this method returns 0 else. It returns a positive or negative value.
Check Also: Amazon Interview Questions
What is the difference between hashcode and equals?
Ans: Hashcode returns the reference variable address in the integer type, and when it is overridden, we can get the value. When the equals method is overridden, even the hash code should be overridden method when used without overriding, and it compares the address of the two objects. If it is overridden, then it is used to compare the values. It returns the Boolean value true or false accordingly.
Write a program to get a substring of string ex: java is good … so result: avails
public class SubstringEx { public static void main(String[] args) { String str="javais good ... so"; String rev=""; String str1=str.substring(0,6); System.out.println(str1); for(int i=str1.length()-1;i>=0;i--) { rev=rev+str1.charAt(i); } System.out.println(rev); } }
Write a program to reverse the string
public class ReverseString { public static void main(String[] args) { String s="Life is good"; System.out.println("Given string is "+s); StringBuffer sb=new StringBuffer(s); System.out.println("Reverse of a string is "+sb.reverse()); //using iteration String rev=""; for(int i=s.length()-1;i>=0;i--) { rev=rev+s.charAt(i); } System.out.println("String reverse using iteration is "+rev); } }
What is the use of a package?
Ans: This helps in the grouping of related types like classes and interfaces. We are avoiding name conflicts with classes related to the same or other projects in the same company. We can allow types within the package to have unrestricted access to one another yet still restrict access for types outside the package.
Why we use interface and abstract
Ans: When some of the functionalities are common among implementing a class, and some are class-specific, then we go for abstract class when all the features are common to the implementing classes. Implementation is class-specific, then we go with an interface.
We have 2 interfaces both have the print method, in my class, I have implemented the print method, how you will get to know that I have implemented the first interface and how you will use it .. if you want to use it
Ans: we can upcast interface to access their respective methods through the subclass. Since we are overriding in the subclass, we get the same output after upcasting any of the interfaces.
interface IDemo { void print(); } interface IDemo1 { void print(); } public class InterfaceDemo implements IDemo,IDemo1 { public static void main(String[] args) { InterfaceDemo i=new InterfaceDemo(); i.print(); ((IDemo)i).print(); ((IDemo1)i).print(); } @Override public void print() { System.out.println("Hello"); } }
What is the difference between the vector list and ArrayList?
Ans: Vector is synchronized by default, and ArrayList is not.we can make ArrayList also synchronized by passing an ArrayList object to the Collections.synchronizedList() method. Synchronized means it can be used with multiple threads without interference between the common resource used by the thread.
To get the element at a particular location from Vector, we use the elementAt(int index) function. This function name is very lengthy. In place of this in ArrayList, we have get(int index), which is very easy to remember and to use. Similarly, to replace an existing element with a new element in Vector, we use the setElementAt() method, which is again very lengthy.
In place of this, ArrayList has add(int index, object) method, which is easy to use and remember. Like this, they have more programmer-friendly and easy to use function names in ArrayList.
Difference between hashmap and hash table, what is synchronization, how it is achieved
Ans: Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for non-threaded applications, as unsynchronized Objects typically perform better than synchronized ones. Hashtable does not allow null keys or values. HashMap allows one null key and any number of null values.
One of HashMap’s subclasses is LinkedHashMap, so if you’d want predictable iteration order (which is insertion order by default), you could easily swap out the HashMap for a LinkedHashMap. This wouldn’t be as easy if you were using Hashtable. Synchronization: Synchronization in Java is the capability to control the access of multiple threads to any shared resource. Java Synchronization is a better option where we want to allow only one thread to access the shared resource. The synchronization is mainly used to To prevent thread interference. To avoid problems of consistency.
What is the use of the collection, when we use it
Ans: A collection – is called a container – is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a collection of strings, or a mapping of names to addresses. Collections are used in situations where data is dynamic. Collections allow adding an element, deleting an element, and host of other operations.
There are a number of Collections in Java, allowing us to choose the right Collection for the right context. Benefits are: we can focus on business logic development rather than implementing our collection classes. So, it reduces development efforts. Collection classes are already developed, so get proper quality classes, rather than creating your own. Reduced effort for code maintenance by using collection classes shipped with JDK in the util package.
What is the priority queue in the collection, what is the use, how you have used in your project
Ans: A priority queue class extends an abstract queue that implements a queue interface. It does not order the elements in FIFO manner It internally auto-sort Random display Dissimilar objects throw classcastexception null is not allowed in this collection
Where to use hashmap and hashtable
Ans: HashMap and Hashtable both are used to store data in key and value form. Both are using the hashing technique to store unique keys. HashMap is non synchronized. It is not threaded safe and can’t be shared between many threads without proper synchronization code. Hashtable is synchronized. It is thread-safe and can be shared with many threads. HashMap allows one null key and multiple null values. Hashtable doesn’t allow any null key or value. HashMap is a new class introduced in JDK 1.2.
Hashtable is a legacy class. HashMap is fast. Hashtable is slow. We can make the HashMap as synchronized by calling this codeMap m = Collections.synchronizedMap(hashMap); Hashtable is internally synchronized and no need to synchronize. Iterator traverses hashmap. Enumerator and Iterator traverse hashtable.
Iterator in HashMap is fail-fast. Fail-fast a fail-fast system is one that immediately reports at its interface any condition that is likely to indicate a failure. Fail-fast systems are usually designed to stop normal operation rather than attempt to continue a possibly flawed process. The enumerator in Hashtable is not fail-fast.
Where you have to use the concept of interface and abstract in your framework
Ans: we have used the concept of interface, while creating the autoconst interface which consists of all the final static variables declarations like CONFIG_PATH=”./config/config.properties”,REPORT_PATH=”./report/”; etc. We have used the abstract class as the base test class in our framework where which consists of initializing the log4j, and on creating the object, it will call all the methods present in the class as per the TestNG annotations, all the test scripts class extends this base test class.
Leave a Reply