<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mohan8727</title>
    <description>The latest articles on DEV Community by mohan8727 (@mohan8727).</description>
    <link>https://dev.to/mohan8727</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F572634%2Fe202b28d-8495-4cbf-a373-f8921f9203a4.png</url>
      <title>DEV Community: mohan8727</title>
      <link>https://dev.to/mohan8727</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohan8727"/>
    <language>en</language>
    <item>
      <title>Usage of Inbuilt Functions In Coding Interview's </title>
      <dc:creator>mohan8727</dc:creator>
      <pubDate>Sun, 07 Feb 2021 08:00:27 +0000</pubDate>
      <link>https://dev.to/mohan8727/usage-of-inbuilt-functions-in-coding-interview-s-4kc9</link>
      <guid>https://dev.to/mohan8727/usage-of-inbuilt-functions-in-coding-interview-s-4kc9</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OBUuLdUt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o4l7qftsbwp88cq3mfkz.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OBUuLdUt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o4l7qftsbwp88cq3mfkz.jpeg" alt="images (3)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At a high level, candidates are allowed to use as many built-in functions as they like, as long as it doesn’t make the solution trivial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Multiply two large numbers A and B. 1 &amp;lt;= A, B &amp;lt;= 10^300&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Intent:&lt;/strong&gt; The interviewer wants to see how the number will be stored in memory (array vs. list), how operations like carry-over will be performed, etc…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A language like Java has in-built libraries that make coding the solution trivial.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BigInteger x = new BigInteger(“1234…”); 
BigInteger y = new BigInteger(“9876…”); 
BigInteger result = x.multiply(y);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These libraries will &lt;strong&gt;not&lt;/strong&gt; be allowed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution 2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On the other hand, you may use in-built libraries to store the number. Like an ArrayList.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List&amp;lt;Integer&amp;gt; digits = new ArrayList&amp;lt;&amp;gt;(); 
while(number &amp;gt; 0){ 
    digits.add(number % 10); 
    number = number / 10; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Despite using an ArrayList over building a custom list (with node and tail pointer), this is allowed. Because the requirement of testing the candidate’s logic, coding, and communication skills are met.&lt;/p&gt;

&lt;p&gt;Lastly, third-party libraries are a strict no for most interviews. It’s best to clarify with the interviewer when in doubt.&lt;/p&gt;

&lt;p&gt;All the best!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
