Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [interview-questions]

This tag is for questions that came up in an interview.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Tic-tac-toe vanilla js

I'm trying to improve my interview skills so I wrote one of the typical assignments - tic-tac-toe game. The main goals are: time limit: 30 minutes - 1h use only vanilla js I'll attach source but I ...
-3
votes
0answers
22 views

Unable to Understand a Coding Program [on hold]

Find HCF and LCM possibility length pairs from any single number Example: ...
0
votes
0answers
27 views

Most Efficient way to return merged string [closed]

Im stacked on this interview question. Most Efficient way to return merged string ...
0
votes
2answers
55 views

Choosing between 2 Fibonacci alternatives [closed]

Task: Return the fibonacci value at a given index. e.g: input: 6, return: 8. Algorithm 1: ...
3
votes
1answer
44 views

Algorithm to find the Array Balance Point

Task: Find the balance point of an array; return the index that if you break the array into left and right at that point will ...
8
votes
1answer
169 views

FizzBuzz in Csharp

For my first CodeReview, I would like to present my FizzBuzz solution in C#. My design has all of the rule logic about when to display what in separate classes through an interface. This design should ...
7
votes
3answers
524 views

Inventory coding interview exercicse

This past week, I had a coding interview where I have failed badly. The feedback that I get from the recruiter was that my code reminded the team of older ways of coding in C#. This led them to ...
2
votes
1answer
85 views

LeetCode: Greatest Common Divisor of Strings C#

https://leetcode.com/problems/greatest-common-divisor-of-strings/ For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or more times) ...
5
votes
3answers
227 views

C# Bowling Game interview test

I recently interviewed for a software engineering job that requires at least one year of C# and experience with the Microsoft stack. Even though I made it clear at the outset that I had zero ...
1
vote
2answers
93 views

Unit tests for anagram finder

I did this test for a job and the feedback was: "while many were added to test private methods, they did not do anything to ensure the public interface worked correctly, edge cases were missed" But ...
2
votes
1answer
114 views

LeetCode: Rotting Oranges in C#

https://leetcode.com/problems/rotting-oranges/ Please review for coding style in 40 minutes job interview. In a given grid, each cell can have one of three values: the value 0 representing an ...
6
votes
4answers
201 views

Building a toy from Lego toys

I recently attempted a coding problem, but my solution was not well received during the interview (modified slightly to reduce Google-ability). Suppose a child has several Lego blocks, and wants to ...
8
votes
2answers
682 views

Analyzing records of London Underground outages

You have a file that describes historic data of the London Underground showing dates when stations have been unavailable. The file contains these fields, separated by a pipe character: Date: ...
3
votes
2answers
107 views

Parcel size classifier [closed]

I submitted a technical assignment for a job interview process and I am stressing out wondering if my submission was any good. I would like to learn and be a better developer, so please give me ...
5
votes
1answer
85 views

Decode ambiguous Morse code

Stumbled upon this interview question: Given a morse encoded sentence with no spaces or separation between letters or words and a list of words contained in the message, decode it. This was my ...
5
votes
1answer
61 views

An alternative algorithm for sorting a stack using only one additional stack

From "Cracking the Coding Interview": Write a program to sort a stack in ascending order (with biggest items on top). You may use at most one additional stack to hold items, but you may not copy ...
2
votes
1answer
107 views

Modelling a Call Center in Java (multithreading approach)

I wanted to give a shot to Modelling a Call Center from Cracking the Coding Interview. The problem statement is as follows: You have a call center with three levels of employees: Respondent, ...
7
votes
1answer
74 views

Find neighboring PINs on a numeric keypad

I am new to coding and to apply for an internship I need to solve several tasks. This is one of them. I wrote working code, but the program says it takes too long to complete. Help me speed up my code ...
3
votes
1answer
56 views

Comparing algorithms to decode a String

I am writing a function to decode a string, which means performing a string transformation like 3e4f2e --> eeeffffee. I have ...
6
votes
4answers
126 views

LeetCode ZigZag helper function code

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) ...
2
votes
2answers
145 views

Ruby implementation for Hacker Rank connected cells in a grid

https://www.hackerrank.com/challenges/connected-cell-in-a-grid/problem problem statement: Consider a matrix where each cell contains either a 1 or a 0. Any cell containing a 1 is called a ...
3
votes
1answer
68 views

System Dependency Manager - Ruby

I recently got a prompt when looking for a job. To spare any details, the company decided not to get back to me, so because I did not get a code-review/feedback from them, I was wondering if someone ...
8
votes
2answers
252 views

Function invocation every second time

Recently I got test task at the project, it is fairly simple: ...
6
votes
4answers
844 views

Maximum character insertion

I would like to know any suggestions about to improve my code and/or get a better approach for this problem solution and your rating of my approach to the problem.(besides removing the ...
3
votes
1answer
198 views

Jumping on the clouds

I have started the Hackerrank interview preparation kit. The first problem I have solved with Swift is as follows: Emma is playing a new mobile game that starts with consecutively numbered clouds. ...
3
votes
2answers
245 views

Calculate the largest palindromic number from the product of two 6-digit numbers (100000 to 999999)

Are there any efficient ways to solve this problem, for example using bitwise operator? ...
7
votes
5answers
202 views

String combinations of 0 and 1

I was asked this question in an interview: Given a string s consisting of 0, 1 and ...
7
votes
6answers
1k views

Find max number you can create from an array of numbers

Was asked this in an interview yesterday: You are given an array of numbers (not digits, but numbers: e.g. 9, 23, 184, 102, etc.) - you need to construct the largest number from it. For example: you ...
3
votes
1answer
67 views

Find minimal number of days to meet all your friends

I was asked this in an interview yesterday: You get an array of segments (segment contains 2 numbers, representing days count (say in a month, but could be in a year, etc.): start, end). You need to ...
3
votes
1answer
88 views

Find the largest product of an array

This task is taken from www.interviewbit.com Given an array of integers, return the highest product possible by multiplying 3 numbers from the array Input: ...
3
votes
3answers
249 views

Frequency analysis based anagram checker

I uploaded code solutions for some problems of the book Cracking the Coding Interview, 6th Edition to GitHub, I would like to know your rating and potential improvement of the code I wrote. Here is ...
6
votes
2answers
105 views

Find matching dictionary words given a Scrabble tray

This is a question I was asked in an interview, below is a cleaned-up copy of the answer I gave. Apparently this answer was not satisfactory. How can it be improved? Question: Given a dictionary of ...
2
votes
3answers
139 views

The last standing gunman in a circle

I don't know why in most of the interviews, interviewers are asking this question commonly. The question is: There are n number of persons standing in a circle. ...
1
vote
1answer
148 views

Rotate matrix clockWise and counter clockWise

This code is a mix of the same question one time rotating to the right and one time to the left. I tried to simplify the code since I'm struggling with all of the indexing here. https://leetcode.com/...
3
votes
1answer
60 views

CareerCup (Bloomberg): Check if string is valid based on brackets

The goal of this problem is to determine if a string with brackets is valid. Below is a summary of the question from careercup. Check if string s is valid based on brackets ...
2
votes
2answers
70 views

Validating that a Java program has two equal-length arguments

I'm writing a small almost one method Java class for a job application and the advice given was to write it as though it was a piece of commercial software. The ...
2
votes
0answers
204 views

Event management system in C++

I have this question asked as home assignment for an interview. I submitted my solution and did not get selected. Wanted to know your feedback for the solution. Question: Write a very simple ...
7
votes
1answer
149 views

Build a set of REST interfaces using Symfony framework

I have got a technical challenge from a company but they reject my code and I'm not sure how to do this challenge in a more efficient way so I'm here to get some guidance. The Technical challenge was:...
4
votes
2answers
105 views

Find the in-order successor of a given node in a binary search tree

I have an implementation of an algorithm to return the in-order successor of a given node in a binary search tree. We are allowed to assume that each node in the BST has a reference to its parent node....
1
vote
1answer
78 views

T-SQL query Choose name of clients, concluded more than one loan agreement in 2010

QUESTION: Choose the name of clients, concluded more than one loan agreement in 2010, as the numbers and dates of issue of these contracts. Sort by name of the client and date of issue of the loan. ...
3
votes
1answer
32 views

T-SQL Query remove duplicates except for original row from the table

Question: There is an Exam_Merge table into which to import records from a similarly structured table in another database. In this case, the Exam_Merge table contains the values of the primary key ID ...
4
votes
1answer
181 views

SQL query to count loans issued during each week

Calculate the number of loans issued by the Regional offices for each business week in the period from 38 to 40 business week of 2011 inclusive. Sort by name of the regional unit, business week. ...
7
votes
1answer
210 views

Drone Delivery Scheduling Service

I recently did a interview with WalmartLabs. I was tasked with a take home assignment. I didn't sign a NDA and a team at WalmartLabs said I could post the code on GitHub. I was tasked with developing ...
5
votes
1answer
100 views

PHP program to validate phone numbers from a file

As part of job interview, I was asked to write a cli script that takes a list of phone numbers to validate from a file and as an option in the command line. It will then produce a CSV file with three ...
2
votes
0answers
143 views

Longest Palindrome Substring: Where is the dynamic programming? [closed]

In this LeetCode problem, Longest Palindromic Substring, it is listed under Dynamic Programming for Google interview preparation. My understanding of dynamic programming is roughly "recursion + ...
3
votes
1answer
78 views

Adding two numbers represented as linked lists

I have some imminent interviews and want to sharpen my game before going into them. I'm running through some practice problems. This LeetCode challenge is to add two numbers represented as linked ...
1
vote
2answers
146 views

Leetcode - find if BST is valid or not

Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node'...
3
votes
2answers
99 views

Leetcode - First Unique Character in a String

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: ...
1
vote
1answer
41 views

Leetcode - product of array except self

Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Example: ...
1
vote
2answers
175 views

Leeetcode - Best time to buy and sell stock to get maximum profit

Question Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy one and sell one ...