Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

Wissen Interview Experience

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Round 1: Online test

Consisted of MCQs based on Java – predict the output, multi-threading, etc.
Two programming questions –

  • Implement functions of an interface – used HashMap where key (or value) was a custom class – had to implement hashCode() and equals() method too.
  • Given a wooden log and a function which returns weight of log based on distance (say x) from the left side of the log. Weight of log is uneven (i.e. midpoint from left side doesn’t necessarily have weight = half of full log) so task is to find point from left side of log where the weight is exactly half. Approach was similar to binary search. Couldn’t solve due to less time, but it was mentioned in the rules that even if problem isn’t solved the algorithm can get you points.

Two SQL questions – one was using JOIN and another was using nested query.

Got a call for next round after a week.

Round 2: Telephonic interview 

  • Tell me about yourself.
  • Compile time vs run-time polymorphism – compile time is overloading and run-time is overriding
  • Immutable object – what is it, how to make object immutable (final class) and how to ensure that immutability is there if mutable object is used in the immutable class (return clone of original object).
  • Hashmap (how it works), concurrent hashmap (how it works), treemap (complexity of search – I said O(logn) and explained that implemented as rb tree which gives guaranteed O(logn) performance in worst case).
  • ArrayList vs LinkedList – if there is no mechanism for indexing, how will you search an element (iterate through list) and which one will lead to faster search (i said arraylist).
  • Reverse a LinkedList – gave basic solution using two lists, he asked for more but I couldn’t give the ans.
  • Wait vs sleep in threading – sleep doesn’t change the state of the thread, if thread is running it remains running. He asked for explanation, I explained using producer-consumer example. (I was wrong, sleep does change the state of the thread from RUNNING to THREAD_WAITING. Difference is that sleep doesn’t release lock on the resources).
  • Given a list of strings, create a 2D array such that each row will store all anagrams of a string. I gave him brute force solution, but he wanted something optimized, I couldn’t do it.

Round 3: Telephonic interview

  • Tell me about yourself.
  • Abstract vs Interface. Do you know default method in interface? – I said no. It is basically some features introduced in Java 8.
  • What is polymorphism? Give real life example of polymorphism – for overriding, withdraw from current and savings account, for overloading, deposit by cheque and cash.
  • What is serialization? I told him concept but she started asked about internals – I tried to answer but couldn’t. She told me that if you know the concept only, tell her in advance so that she doesn’t ask about the internals.
  • Given class A with a static printContent method, and class B which extends A and overrides printContent method. In main, A obj1 = new B(); obj.printContent(); A obj2 = null; obj2.printContent() – tell what the output will be. (Both printContent() calls will print “A”).
  • Final, finally and finalize keywords – I couldn’t tell about finalize (finalize is (a method) used to perform clean up processing just before object is garbage collected.).
  • What does it mean by immutable class (can’t inherit)? Given class Person with name and list of subjects. Make class immutable – in list getter function, return the clone of list.
  • Exception vs error – I sucked in this one since I hadn’t studied about it for a long time. (See this).
  • ArrayList vs LinkedList – searching vs insertion.
  • TreeSet vs HashSet, ConcurrentHashMap vs Hashtable.
  • HashMap vs TreeMap. Given a class Employee with a member name and this class is used as key in both HashMap and TreeMap. What method we will need to add to Employee class. I said hashCode() and equals() – but she asked whether hashCode and equals is required for TreeMap, I thought and said no, we need to implement Comparable and override compareTo method for TreeMap. Explain internal working of HashMap. I got confused when she asked whether hashcode is applied on both key-value or just key – I later said just key and continued with it. If hashcode is overrided such that it always return 1, how will it effect HashMap – I said only 1 bucket will be used and search time will be linear in worst case.
  • SQL query – given tables student with (student id, name), course with (course id, name) and studentcourse with (primary id, student id, course id). Give the names of students who have enrolled for more than 3 courses. First I gave solution with nested query, then she asked for another method, so I tried using join but got stuck at the point where we have to count the courses.
  • Problem solving question 1 – Given a linked list, delete a node from that given the reference of that node. It should be in O(1). I tried, but couldn’t do it. Solution: Copy the contents of next node in current node and delete the next node.
  • Problem solving question 2 – What is stack? Implement a queue using stack.

Round 4: F2F interview

  • Since I had worked with C++ and they knew C++ had OOPS, so they asked me to tell about various OOPS concepts: Polymorphism, Inheritance, Abstraction, Encapsulation, Data Hiding.
  • Lots of (confusing) questions on abstract class vs interface.
  • Explain polymorphism, compile time vs runtime polymorphism, overloading and overriding examples (and lots of confusing questions based on that like can static methods be overrided, etc).
  • Exceptions and its types. They gave a piece of code in which base class function throwed IOException and derived class function throwed Exception and functions were overridden functions, so they asked what will be the output?
  • Object class and its methods. Default implementation of hashcode and equals. Importance of hashcode – I gave example of HashMap, so they asked about its working.
  • SQL queries – nested query (to find second max value in column) and inner join.
  • Problem solving:
    Given an array, you have to find the nearest value (on its left side) to an element. Let the nearest element to first element of array (arr[0]) be -1.
    E.g. 1 3 2 3 5 4
    the output will be -1 1 1 2 3 3. Hint use stack.
  • Design question: Implement pattern lock. They have hint to use some mathematical operation to compare two patterns. I initially thought of using Hash function, but later I thought XOR operation would be better. So, I used bit manipulation (BitSet in java) to index each dot and set ith bit if ith dot comes in pattern. (Later, I wasn’t sure if I was correct).
  • ArrayList vs LinkedList – which is faster in terms of insertion, searching and deletion.
  • Given numbers from 1-100, how will you sort them? Quicksort (nlogn). But since range is given (and is small), we can use Counting sort.
  • Given an array find max 10 elements (order doesn’t matter). Use heaps. They asked to optimize further. I wasn’t able to think of any way, so they suggested to keep size of heap as 10. I initially thought of max heap, but later they again gave hint that why not try min heap. Using min heap insert first 10 elements, find min, remove min element, insert next element, find min, and so on. Repeat for len(arr) – 10 times, remaining will be max 10 elements.
My Personal Notes arrow_drop_up
Last Updated : 05 Aug, 2019
Like Article
Save Article
Similar Reads