Nitin Agrawal
Contact -
  • Home
  • Interviews
    • InterviewFacts
    • Resume Thoughts
    • Companies >
      • InvestmentBanks >
        • ECS
        • Bank Of America
        • WesternUnion
        • WellsFargo
      • ProductBasedCompanies >
        • CA Technologies
        • Model N India
        • Verizon Media
        • Oracle & GoJek
        • IVY Computec
        • Samsung
        • ClearWaterAnalytics
        • ADP
        • ServiceNow
        • Pubmatic
        • Expedia
        • Amphora
        • CDK Global
        • Delphix
        • Fractal Enterprises LLP
        • CDK Global
        • Tide-Banking
        • Epic
      • ServiceBasedCompanies >
        • ASG World Wide Pvt Ltd
        • Paraxel International & Pramati Technologies Pvt Ltd
        • MitraTech
        • Intelizest Coding Round
        • ZeMoSo
    • Interviews Theory
  • Programming Languages
    • Java Script >
      • Tutorials
      • Code Snippets
    • Reactive Programming >
      • Code Snippets
    • R
    • DataStructures >
      • LeetCode Problems
      • AnagramsSet
    • Core Java >
      • Codility
      • Java14
      • Threading >
        • ThreadsOrder
        • ProducerConsumer
        • Finalizer
        • RaceCondition
        • Executors
      • Important Points
      • Immutability
      • Dictionary
      • Sample Code Part 1 >
        • PatternLength
        • Serialization >
          • Kryo2
          • JAXB/XSD
          • XStream
        • MongoDB
        • 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 >
        • Decorator
        • Proxy
        • Lazy Initialization
        • CombinatorPattern
        • RequestChaining
        • Singleton >
          • Singletons
  • Frameworks
    • AngularJS
    • Apache Velocity
    • Spring >
      • Spring Boot >
        • Issues
      • Quick View
    • Rest WebServices >
      • Interviews
      • Swagger
    • Cloudera BigData >
      • Ques_Ans
      • Hive
      • Apache Spark >
        • 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 >
      • Design Patterns
    • AWS >
      • Honeycode
  • Databases
    • Oracle >
      • Interview1
      • SQL Queries
    • Elastic Search >
      • StudySources
  • Random issues
    • TOAD issue
    • Architect's suggestions
    • ApacheSpark Installation
  • Your Views
I once, met a person who attended the coding test for Samsung.
It was one coding problem to be completed in 4 hours.
Such problems are not tough generally but issue for me comes to put my mind in these problems for straight 1-4 hours.
As I say that these problems are not that tough & you can come up with some logic & algorithm which seems to solve it.
But real issue comes here to think about the corner cases which may require some tweak in your logic.
Here in Samsung they are looking to execute 50 test cases against your code, if your code clears all those 50 cases then only you will get the call for further interviews.
And here I wonder if the developer will be thinking about all the possible cases then no tester or QA will be required in such organisations. And all the products from such organisations will be working perfectly correct in first attempt itself.
But any how it is their process, I can't complaint on that.
So suggestions to the candidates appearing for such coding tests -
a) Check how the code will be tested or the criteria to shortlist the code.
b) If some person will be checking your code then always add the proper comments to help the reviewer to understand your
    logic. Else if it is tested like in Samsung, then don't waste a single minute to write the comments, rather put that time to
    think different test cases.
c) If some person will be reviewing your code then use sensible names for variables & methods to make it easier to
    understand, else give any name you want to use.
d) If some person reviews then you may not to think much about the test cases, just concentrate to make it work for general
    scenarios, comments in code
& formatting of the code, as it is highly possible that you have discussions on your code
    later.
e) If the condition is like in Samsung, then you need to decide if you can sit for continuous 3-4 hours coding for the problem
     & thinking about different scenarios also.

Problem & approach is here, I took to solve the problem & not sure if it covers the corner cases.
You can further improve the solution, as I will not be testing it extensively.
It will really be helpful for others also, if you can post the improved solution here or can suggest the changes.
Powered by Create your own unique website with customizable templates.