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
Interview at IVY Comptech -
Majorly interview was around Garbage Collector in Java like -
a) When the Garbage collector runs?
b) What is the memory model in Java?
c) Design Garbage collector.

One question was around to code to reverse the words in a sentence like -
Input :- This is a Sentence
Output : sihT si a ecnetneS
Condition :- Dont use any loop or iterator.

One question to find middle node in the link list in one iteration.

1 or 2 normal questions were also asked but I don't remember them.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
I got another chance to have the interview at Ivy Comptech, in Jan 2022.
 Interview was taken by Himan Bayan.


 I always wonder why interviewers are afraid to share their video during the discussions, they will be expecting you to share your video but don't share their video, either they are not dressed or check the interview questions/answers over the internet.
 So one of these reasons can be possible here, as Himan didn't show coutesy to switch on his video.

 Interview was started to design the backend for MakeMyTrip to show the latest flight details from various airlines.
 So surely, this question was about handling the high volume of data quickly.
 But I don't know why he gave the example of Hotstar for handling of streams here..............?
 I am not sure if he was looking for certain words from me or some good working design, but it was sure that he was also not very clear about his question.

  Second question for coding which I messed up, as it was very common & straight one..
 Question : Find the indexes of the pair of numbers, from given array, whose sum is equal to the given number.
  What I messed in this straight question?
 I tried to apply HashSet here, Himan also asked how HashSet can help here...but I had already messed up my thinking.. :(
 Point to remember....
 HashSet can be used if we need to find that pair of numbers.
 But if we need to find the indexes of those numbers then we need to use HashMap where key will be the number & value will be Index.
  Rest it is straight, & it is the most efficient one which I can think of.

 Though using sorting & do binary search is a first way to solve, but it is not efficient one & if one needs to find the indexes
 of those 2 numbers then it's shape changes & now we need to worry about the actual indexes also. To solve it, you have 2 ways-
  1) You will be creating the objects for every number having 2 properties - value & index.
      Then you can store all those objects in the array or some List, then sort all those elements based on their values.
  2) Use a TreeMap with key as number & values as its index.
 Obviously (1) is going to be too heavy, so you will be prefering (2), now if using TreeMap then better to go for HashMap & avoid any sorting even.
Powered by Create your own unique website with customizable templates.