Nitin Agrawal
Contact -
  • Home
  • Interviews
    • Secret Receipe
    • InterviewFacts
    • Resume Thoughts
    • Daily Coding Problems
    • BigShyft
    • Companies
    • Interviews Theory
  • Programming Languages
    • Java Script >
      • Tutorials
      • Code Snippets
    • Reactive Programming >
      • Code Snippets
    • R
    • DataStructures >
      • LeetCode Problems >
        • Problem10
        • Problem300
      • AnagramsSet
    • Core Java >
      • Codility
      • Program Arguments OR VM arguments & Environment variables
      • Java Releases >
        • Java8 >
          • Performance
          • NasHorn
          • WordCount
          • Thoughts
        • Java9 >
          • ServiceLoaders
          • Lambdas
          • List Of Objects
          • Code Snippets
        • Java14 >
          • Teeing
          • Pattern
          • Semaphores
        • Java17 >
          • Switches
          • FunctionalStreams
          • Predicate
          • Consumer_Supplier
          • Collectors in Java
        • Java21 >
          • Un-named Class
          • Virtual Threads
          • Structured Concurrency
      • Threading >
        • ThreadsOrder
        • ProducerConsumer
        • Finalizer
        • RaceCondition
        • Executors
        • Future Or CompletableFuture
      • Important Points
      • Immutability
      • Dictionary
      • Sample Code Part 1 >
        • PatternLength
        • Serialization >
          • Kryo2
          • JAXB/XSD
          • XStream
        • MongoDB
        • Strings >
          • Reverse the String
          • Reverse the String in n/2 complexity
          • StringEditor
          • Reversing String
          • String Puzzle
          • Knuth Morris Pratt
          • Unique characters
          • Top N most occurring characters
          • Longest Common Subsequence
          • Longest Common Substring
        • New methods in Collections
        • MethodReferences
        • Complex Objects Comparator >
          • Performance
        • NIO >
          • NIO 2nd Sample
        • Date Converter
        • Minimum cost path
        • Find File
      • URL Validator
    • Julia
    • Python >
      • Decorators
      • String Formatting
      • Generators_Threads
      • JustLikeThat
    • Go >
      • Tutorial
      • CodeSnippet
      • Go Routine_Channel
      • Suggestions
    • Methodologies & Design Patterns >
      • Design Principles
      • Design Patterns >
        • TemplatePattern
        • Adapter Design Pattern
        • Proxy
        • Lazy Initialization
        • CombinatorPattern
        • Singleton >
          • Singletons
        • Strategy
  • Frameworks
    • Apache Velocity
    • React Library >
      • Tutorial
    • Spring >
      • Spring Boot >
        • CustomProperties
        • ExceptionHandling
        • Custom Beans
        • Issues
      • Quick View
    • Rest WebServices >
      • Interviews
      • Swagger
    • Cloudera BigData >
      • Ques_Ans
      • Hive
      • Apache Spark >
        • ApacheSpark Installation
        • SparkCode
        • Sample1
        • DataFrames
        • RDDs
        • SparkStreaming
        • SparkFiles
    • Integration >
      • Apache Camel
    • Testing Frameworks >
      • JUnit >
        • JUnit Runners
      • EasyMock
      • Mockito >
        • Page 2
      • TestNG
    • Blockchain >
      • Ethereum Smart Contract
      • Blockchain Java Example
    • Microservices >
      • Messaging Formats
      • Design Patterns
    • AWS >
      • Honeycode
    • Dockers >
      • GitBash
      • Issues
      • Kubernetes
  • Databases
    • MySql
    • Oracle >
      • Interview1
      • SQL Queries
    • Elastic Search
  • Random issues
    • TOAD issue
    • Architect's suggestions
  • Your Views

Technical Interview at Verizon Media

I happened to be at Verizon Media for the technical discussion & below I will just give the information about the technical discussion there -

1st Round -
Question 1 : You are given array of random integers & you know that it can contain integers 1-50 only. Now you need to find
                    the missing numbers from that array.
Follow-up Questions I asked : Can the numbers be repeated in the provided array? Ans : Yes
                                                Are all 1-50 number expected in the array? Ans : Yes
                                                Is their performance or complexity constraint for the solution? Ans : No but can't use the
                                                Collection API
The method code I wrote as below -

public class MissingNumbers {
 public static void main(String[] args) {
  int[] array = {1, 4, 3, 8, 9, 11, 15, 18, 20, 14, 4, 3, 8};
  int[] result = find(array, 20);
  for(int i : result) {
   if(i == 0)
    break;
   System.out.println(i);
  }
 }
 
 public static int[] find(int[] array, int size) {
  boolean[] found = new boolean[size];
  int length = array.length;
  int[] result = new int[size];
  
  for(int i = 0; i < length; i++) {
   found[array[i]-1] = true;
  }
  
  int k = 0;
  for(int i = 0; i < size; i++) {
   if(!found[i]) {
    result[k] = i+1;
    k++;
   }
  }
  return result;
 }

}
Now the resulting array will have the missing integers & as soon as you hit '0', then it means no need to check more in the array. Instead of Boolean type array one can use Byte array, but will not cause much difference.
Then the question was on 'Default' 'Access Specifier'.
Next question was on Singleton Design pattern.

2nd Round -
Question 1 : You are given a 2 dimensional matrix of integers having both positive & negative integers. Now you have to find
                     the matrix where sum of all its numbers is minimum in all the possible matrices possible from given matrix.
Answer : I was not able to find the matrix but wrote the code to find the minimum sum of all number in the sub-matrix.
               Will try to post the code for this here.

Question 2 : Write the code to create the pool of threads i.e. custom code like of Executor in Java.
Answer : It was not possible to write the code, but I just gave a brief idea on it.
Powered by Create your own unique website with customizable templates.