0% found this document useful (0 votes)
11 views

Coding Round - Interviewer's RuleBook

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Coding Round - Interviewer's RuleBook

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Begin the interview

1. Make sure that interviewer and interviewee cameras are ON.


2. Always ask candidates about their total experience, latest project, technology stack and
current role.
3. Capture no. of years experience for java, spring boot, microservices, design,
docker/kubernetes in feedback form. [For L2 & L3]
4. Good to ask 2-3 java related questions.
5. Ask the candidate to share the entire screen and open IDE. DO NOT SHARE CODING

🙂
PROBLEM UNTIL YOU SEE WORKING IDE OR CANDIDATE CONFIRMS TO USE
ONLINE JAVA TOOL.
6. When a problem is shared in a written form over chat, there are good chances that the
candidate will post the same on different websites while sharing his interview
experience. It is always good to give requirements verbally. It also helps to judge how
many requirements a candidate captures in the first go and whether they ask or repeat
the requirements again to get confirmation from the interview panel. If something is
missed by the candidate, please repeat that specific requirement part again. - As
discussed during discussion, POCs have decided to share problems over chat.
7. There are cases where a recruiter schedules a coding round for a candidate, in this case
the recruiter should inform this to the interviewer. Interviewer can also check with the
candidate during the interview whether it is their first coding round or second. Ask the
candidate if this is his first round or not. Many times its possible this may be this second
round and already attempted this question in that case choose to start with Optional
Question Extension & more coding questions from Infohub.
8. In the case of the REDO coding round, the interviewer must ask a different problem.
9. Interviewer should capture or ask the candidate to share the code and output once the
interview is complete. As this is must to include in the feedback form.

The coding problem is distributed in 2 Parts.

Problem Statement - Part 1


You can share below problem statement with candidate

Write a function, add, which adds two large numbers together and returns their sum:
// Returns sum of two numbers
String add(String a, String b)

- Inputs to the add function are two numbers, represented as strings


- Output of the add function is a single string representing the sum of the inputs
- Only positive integers need to be supported
- Input numbers can be very large, with 100 digits or more.
- This negates the ability to convert the entirety of the strings to integers and simply add
them together in a 32-bit system.

Do not share in chat anything below this with the Candidate, This is for the interviewer's
reference only.

Explain below things to candidates verbally


- Interview time is 60 mins
- Above problem has a second part also which will be asked once a candidate is able to
solve the current problem.
- Don’t make use of any existing BigInteger packages or other construct which allows you
to convert the entire input numbers to integers, natively add them, and convert back to
strings. The point of this problem is to implement addition on a digit-by-digit basis.
- Internet use for syntax is OK but please don’t copy solutions.
- Ask candidates to Think out loud! Describe your approach and discuss changes as new
information surfaces
- Test-Driven Development is preferred. It is highly recommended to create a test runner
function, assertAdd, which takes 3 inputs and displays whether the add function returns
the third parameter when invoked with the first two parameters
Below syntax to test and scenario, do not share all at once with candidate, share it one by one
and only after candidate says he is done with coding and the problem is solved.

// Asserts 'add' operating correctly


void assertAdd(String a, String b, String expectedSum)

Sample Inputs and Outputs:

// Basic Test
assertAdd("1", "5", "6");
assertAdd("301", "5", "306");

// Carryover test
assertAdd("7", "8", "15");
assertAdd("144", "89", "233");
assertAdd("1", "999", "1000");

// Large integer test


assertAdd("8944394323791464", "14472334024676221", "23416728348467685");

// Larger than long test


assertAdd("222232244629420445529739893461909967206666939096499764990979600
","1","222232244629420445529739893461909967206666939096499764990979601");

Problem Statement - Part 2


You can share the below problem statement with Candidate. Required for L2+ Roles, optional
for L1 as time permits

Extend your solution to allow commas for readability in the input and add commas in the output
as appropriate (ex: 33,560). Large numbers should include separators every 3 digits for
readability

● Large numbers should include separators every 3 digits for readability, ( comma ‘,’ is
preferred)

Share below information with candidate only if they ask for specific additional information or related
queries

● Previous test cases with output > 999 are allowed to fail due to missing commas
● Formatting should be for a US audience (ex: 1,000,000); European number formatting (ex:
1.000.000) need not be supported

Do not share anything below this with the Candidate, This is for the interviewer's
reference only.

// Basic comma test


assertAdd("1,234", "1,234", "2,468");

// Comma with final carry test


assertAdd("701,408,733", "433,494,437", "1,134,903,170");
assertAdd("9,234", "1,234", "10,468");

// No commas in the inputs, but with carry that forces a comma


assertAdd("999", "1", "1,000");

// No leading comma test


assertAdd("444", "555", "999");
assertAdd("317,811", "514,229", "832,040");
// Large integer test
assertAdd("8,944,394,323,791,464", "14,472,334,024,676,221",
"23,416,728,348,467,685");

Observations & Notes required in feedback


Below questions will help derive notes / opinion on Level of candidate’s coding skill knowledge.

- Ask the approach candidate starts with, Ask him to think out or say out loud what
approach / logic he will use to solve the problem.
- If candidate is not able to think loud on each steps then once the problem is solved ask
on each steps implementation and purpose of it
- You can give a few hints and help candidates but not for all steps only if they are stuck
and do share it in your feedback on area’s he improved / solved after your hint.
- You can give candidate 10-15 mins extension if you feel he is on right track and only Unit
Test cases are pending
- If a candidate is not able to write a unit test case for Problem 1, he/she does not quality
further
- If a candidate is not able to solve Part 1 of problem then he/she does not quality further
- If a candidate is able to solve Part 1 but not able to solve Part 2 then recommend level is
L1 for candidate
- If a candidate is able to solve both Part 1 & Part 2 then use of the below table will help
you determine the level.

Candidates addressing certain cases without prompting or exhibiting certain behaviors can be an
indicator of experience and level.

● L1
○ Iterates over numbers from right-to-left
○ Converts string to number (and vice-versa) on a digit-by-digit basis
○ Accounts for the carry between digits
● L2
○ Understands that large input numbers will exceed max-int and will negate the use
of wholesale conversion between String and Int
○ Accounts for inputs of different length
● L3
○ Accounts for the final carry after loop iteration

- Candidate’s that are able to complete Problem 1 & 2 below table will help you to
recommend final feedback.
Candidates addressing certain cases without prompting or exhibiting certain behaviors can be an
indicator of experience and level.

● L1
○ Removes commas from input and adds commas to output appropriately for basic
comma test case
● L2
○ Understands that the original large number test will now fail without commas
○ Adds comma for final carry test case
○ Omits leading comma for 3/6/9... digit results
● L3
○ Separates the parsing and formatting of commas from core calculation logic

Optional Question Extensions


This extension should take ~15 mins to solve, ask the candidate if he is able to complete Part 1
& Part 2 successfully and still has 5-10 mins to complete.

Nth Fibonacci Number

When To Use What level of candidate is this appropriate for? Should this section be
used to validate specific competencies?

● Looking to validate algorithmic thinking and performance


trade-off considerations

Problem Statement In technical terms, describe exactly what the candidate should produce.
This section may include a method signature for coding problems.

● Use the function you wrote to compute the nth number of the
Fibonacci series: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55…
● Implement two functions:

// Returns the n-th Fibonacci number

String fibonacci(int n);

// Asserts 'fibonacci' operating correctly


void assertFibonacci(int n, String
expectedResult);

Requirements Information marked as [Withhold] should be understood by the


Gathering interviewer but withheld from candidates until they ask to clarify the
requirement.

● [Provide] The series begins with two 1’s


● [Provide] For every positive integer n >2:

fibonacci(n) = fibonacci(n-1) +
fibonacci(n-2)

● [Withhold] The series is 1-indexed and all inputs are guaranteed


to be positive integers

Test Cases

// Basic Fibonacci Tests

assertFibonacci(1, "1");

assertFibonacci(3, "2");

assertFibonacci(31, "1,346,269");

// Performance Test

assertFibonacci(100,
"354,224,848,179,261,915,075");
Expectations by Level Candidates addressing certain cases without prompting or exhibiting
certain behaviors can be an indicator of experience and level.

● L3
○ Anyone who completes this in addition to the required
extensions in a ~35 minute coding block should be
recognized as a blazing fast coder
○ Solution has algorithmic complexity of O(n) (naive
recursive approach will timeout around n=45)
● L4 TT
○ When prompted, can name the algorithmic complexity
of O(2^n) for the naive recursive implementation

FAQs
1. Can I ask java questions?
Ask 2-3 java related questions before sharing the coding problem.
● If a candidate mentions more than one java version in his experience. Ask about
the new features in the latest version mentioned.
● If a candidate has experience in java8 only, ask questions on heap memory
change and how Strings & Objects are stored in memory.
● How much time do they spend on coding on a daily basis? 60% or 80% or so.

2. Candidate looks familiar with an add two large number problem and wrote correct
code within 15 min.
It is common that candidates are already familiar with the DSA problems. Consider
below points to judge a candidate:
● Did the candidate explain his approach when asked before coding?
● Is code written in a clean manner or easily readable?
● Did candidate make right choices to use data type to solve this problem:
Example: to build String output which is continuously changing in a for loop, it is
good to use StringBuilder. String is the last choice. StringBuffer is the second
choice. If a candidate did not use StringBuilder, drop a hint if they can use any
other class which is a better option to build output. If not, then directly ask the
difference between String, StringBuilder and StringBuffer.
● Ask all the extensions of the problem.
● Ask the Time Complexity of each problem. Mention that in the feedback form.
● Once they are done with all extensions within 45-50 min, the panel should ask
candidates to make that code production ready. No hints should be given here.
Let’s purely judge on what candidates think of prod ready code.
● Give more weightage to other traits like Thinking out loud, requirement gathering,
communication, potential resume, attitude.

3. Candidate needed many hints during the interview but was able to code problems.
Should I select a candidate for the next round?
● It is okay to give hints but the number of hints should be 2-3 only. More hints
implies the candidate does not have critical thinking traits and needs assistance
from time to time.
● It is alway good to mention what hints you provided to candidates in the feedback
form.

You might also like