Questions tagged [interview-questions]

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

Filter by
Sorted by
Tagged with
-3
votes
0answers
18 views

STRING REVERSAL in PYTHON ( without using inbuilt functions) [closed]

WHAT IS WRONG WITH THE FOLLOWING CODE? IT' GIVING AN ERROR : STRING OUT OF RANGE ...
2
votes
1answer
42 views

Counting the number of click on the entire page

In an interview I was giving the following problem: Count the number of click on on the entire page. Can you think of a better way to do this? ...
1
vote
2answers
56 views

Merge two sorted arrays that can be of different sizes

I think the algorithm implementation itself is reasonably efficient, but I'm not sure about proper use of good practices in software development in the code (variable naming, idioms, comments, error ...
2
votes
1answer
63 views

Propagation in grid

Can I do it with a lower Big O / better code? How can I improve this solution? Task: Let's assume we have a array like this: 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 ...
3
votes
2answers
69 views

Finding average of stream of numbers

A Brief Context I recently gave an interview in a company where I was asked this particular question. After the interview was over, the HR gave the feedback that my solution (is correct ...
2
votes
1answer
60 views

Is there a route to the end of the jump table?

I'm currently learning about Dynamic Programming and solving a "coding question" related to the topic. Given an array of non-negative integers, you are initially positioned at the first index of ...
13
votes
3answers
2k views

Converting Roman numerals to integers

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. ...
1
vote
2answers
120 views

Calculate transaction balances and find duplicate transactions

In an interview I was asked to solve two JavaScript questions. I thought I did pretty well because I: Covered the edge cases Wrote comprehensive tests Documented the code using jsdoc The interviewer ...
4
votes
2answers
111 views

Query and display train and station information

Recently got this coding assignment as the first round of interview at a tech organization. I could get the expected result, however, my code failed the best practices check. Please let me know if it ...
1
vote
0answers
24 views

Wildcard Matching with DFS and FSM

I'm trying to solve Wildcard Matching on Leetcode. I found a great solution using the Finite-state machine. The author builds an FSM and searches with BFS. I rewrite the solution with the same idea (...
2
votes
0answers
62 views

ANDROID - Receive and manage markers in Google Maps

Recently, I've received negative feedback of interview's test. They say that they need somebody with higher technical level, the quality of the task was not good enough. I upload it here, to request ...
3
votes
0answers
68 views

Implement a micro service in Rust

Last year I tried to implement a micro service architecture in Rust. The imagined use case was a small izakaya-shop where digital orders could be given to the kitchen tracked or deleted. Looking for ...
1
vote
1answer
64 views

An app displaying items fetched from JSON, but I think maybe I'm not using best Android development praxis

I have been programming in various languages for a very long time, and this was one of my first attempts to build an Android app. Apparently this was not good enough for the challengee, could somebody ...
3
votes
2answers
156 views

Access a database and an API, uses python generators, and matches the results based on names, interview assignment

Thanks in advance if you are reading this code. I recently submitted this code as part of an interview (took about 4-5 hours). Unfortunately, they did not like the code and I received a form ...
3
votes
1answer
78 views

Find the smallest number of perfect squares that sum to a target

Given a positive integer n, find the smallest number of perfect squares (for example, 1, 4, 9, 16, ...) that sum to n. ...
0
votes
1answer
809 views

Go homework interview challenge for Storj

Last December I interviewed with Storj and was unsuccessful after my code challenge. Storj were good enough to pay me for the time it took to complete the challenge, but have refused to give any kind ...
5
votes
1answer
101 views

Toy Robot Simulator

I know this code worked as I've tested it with the case tests commented below in the code, and even added a few of my own, but the developers who were testing me came back with the following critiques:...
2
votes
2answers
141 views

Convert integer to English words

I was recently asked an interview question with regards to algorithm design. The challenge is as follows: Given a 6 or less digits positive integer (0 - 999999 inclusive), write a function ...
0
votes
3answers
174 views

Facebook coding interview [closed]

I have joined the Facebook interview recently. And the following question has been asked on the coding interview. ...
6
votes
3answers
231 views

Data analysis program for job interview

Before the interview for the Junior (i hope:)) position of Java developer, I was asked to do a test task. Kindly ask you to review my code. Riht now program arguments are hardcoded and not from args[],...
3
votes
1answer
49 views

Traversing from left or from right - Leetcode 140: Word Break II

I have watched Professor Sheep's Leetcode 140: Word Break II YouTube video here CPP code here My own Python translation code is below. I am thinking that the code can be optimized by traversing ...
7
votes
2answers
163 views

Interview Code Test: Webservice Checker

I recently applied for a job as a C# developer. Based on the first phone call, they wanted to check my skills with a code interview in Java. Since I haven't programmed Java for years, I tried my best, ...
5
votes
2answers
2k views

Output the top N toys mentioned most frequently in the quotes

This question was asked during an interview as a software developer: Task: You work on a team whose job is to understand the most sought after toys for the holiday season. A teammate of ...
0
votes
1answer
134 views

Insert a digit to maximize the given number

Was asked in an interview today - You are given an integer (in finite range [-N, N]) and you wish to maximize the number by inserting somewhere the digit '5'. My solution - the idea here is going ...
3
votes
1answer
76 views

Find number of horizontal brush strokes to paint a skyline

Asked in interview today: You want to paint a skyline on your wall using only horizontal brush strokes. You are given an array of numbers, each representing the size of the column/building in that ...
1
vote
0answers
57 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 ...
0
votes
1answer
58 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
81 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
208 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
566 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
130 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
333 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
127 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
436 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
207 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
700 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
117 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
113 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
64 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
183 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
80 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
59 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
142 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
154 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
73 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
253 views

Function invocation every second time

Recently I got test task at the project, it is fairly simple: ...
7
votes
4answers
2k 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
437 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
275 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
206 views

String combinations of 0 and 1

I was asked this question in an interview: Given a string s consisting of 0, 1 and ...

1
2 3 4 5
18