Questions tagged [interview-questions]
This tag is for questions that came up in an interview.
29
questions with no upvoted or accepted answers
4
votes
0
answers
120
views
Implement a micro service in Rust
Last year I tried to implement a micro service architecture in Rust. It was asked as a homework question in an employment interview process to be completed in a few days. The imagined use case was a ...
3
votes
0
answers
651
views
Async FIFO processing of database writes - naive implementation in .Net 6
One of the companies I was recently interviewing with gave me a following task to implement in a day or two using .Net, just to see where my coding abilities are at:
Implement a Web API that gets ...
3
votes
0
answers
98
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
0
answers
154
views
Interview: Appointment reservations
I have received this question during an interview I did earlier, but I found that my solution might not be correct. And I would like to know whatever there is a better way to solve this.
Question:
...
3
votes
0
answers
913
views
Find redundant braces in an input string
I am solving interview questions from here.
Problem : Write a program to validate if the input string has redundant braces
Return 0/1 :
...
3
votes
0
answers
2k
views
Robot on a Grid: Find a path between two corners with forbidden cells on the road
Problem statement
The problem is defined in the book as following:
8.2 Robot in a Grid Imagine a robot sitting on the upper left corner of grid with r rows and <...
2
votes
0
answers
68
views
Coding style of solution of the "Regular Expression Matching" problem on LeetCode
"Regular Expression Matching" is a hard problem on LeetCode (problem #10):
Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:
...
2
votes
0
answers
622
views
Cron expression parser
Problem
Write a command line application or script which parses a cron string and expands each field
to show the times at which it will run.
~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find"...
2
votes
0
answers
57
views
Rainfall challenge: procedural implementation
This evening I have seen the text of the Rainfall Challenge posted seven years ago by Hunter McMillen. I did not look at his solution (besides, I have no clue about perl), but I was intrigued by the ...
2
votes
0
answers
67
views
Find room required for lectures
I have implemented a code to resolve following interview question. Please advice how it can be improved folks. Thanks in advance.
Given an array of time intervals (start, end) for classroom lectures
(...
2
votes
0
answers
84
views
Find the largest contiguous sum of two or more integers in an array of positive or negative integers?
I received an interview question: Find the largest contiguous sum of two or more integers in an array of positive or negative integers.
I wrote a brute force solution, which is slow at O(n^2). Is ...
2
votes
0
answers
97
views
Create array given number of larger elements to right of each member
I want to improve on my original solution to this problem,
my solution is O(n^2) and I think it's possible to solve in less time
You have two arrays: A and B. A contains ints and B has pairs: (...
2
votes
0
answers
74
views
LeetCode: Number of enclaves C#
https://leetcode.com/problems/number-of-enclaves/
Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land)
A move consists of walking from one land square 4-directionally to ...
2
votes
0
answers
6k
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 ...
2
votes
0
answers
317
views
KMP algorithm in scala
I implemented KMP pattern matching algorithm in Scala. My code works but it looks more imperative and a scala translation of C/C++ implementation.
I am not able to figure out how to manage multiple ...
2
votes
0
answers
261
views
Implementing key map with expire and size limit
Recently I have been asked to implement a key map with expire time for each key and possibility to limit the number of keys, in Python. I've used a dictionary + heap to store the entries, e.g.:
...
2
votes
0
answers
974
views
Three sum using binary search
Given an array and a value, find all the triplets in the array whose sum is equal to the given value. For example, if the given array is {12, 3, 4, 1, 6, 9} and the ...
2
votes
0
answers
610
views
Leetcode 10: Regular Expression Matching
Problem statement
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching ...
2
votes
0
answers
286
views
Learn trie through Leetcode 212
Problem statement:
Given a 2D board and a list of words from the dictionary, find all words in the board.
Each word must be constructed from letters of sequentially adjacent cell, where "...
2
votes
0
answers
90
views
Time Schedule Intersection version 2
Time schedule intersection
in my original question I gave an answer which has \$O(n^2)\$ complexity.
Here is the new version of the same problem.
I'm trying to get to O(N+K). please review the code ...
2
votes
0
answers
127
views
JavaScript Node/React web developer interview code part 2 RESTful API
I recently applied for a job as a Node/React developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was ...
2
votes
0
answers
250
views
Javascript node/react web developer interview code
I recently applied for a job as a node/react developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was ...
2
votes
0
answers
252
views
Improving time efficiency of finding maximum area rectangles in a histogram
Here's my solution but I am looking for ways to improve the time complexity of solution. Also this question is categorized as being solved by stack so I would like to know how to approach it using ...
1
vote
0
answers
279
views
Find the number of carry operations needed to add two numbers digit by digit
I don't know if my test cases at the bottom cover every case, or if my mathematical logic in the reducer function is exactly right (referring to the math that starts with ...
1
vote
0
answers
212
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 (...
1
vote
0
answers
88
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 ...
1
vote
0
answers
94
views
Automating A Workflow Using Selenium - Best Way To Fetch Elements & Make Code More Generic
I'm a newbie to Selenium and I'm trying to get better at it by taking up interview assignments. This YouTube link describes the workflow that needs to be automated.
The following points are worth ...
1
vote
0
answers
692
views
Symfony controller to register and activate users
I've been in an interview some time ago. They objected my Symfony API code with following line:
Too much code in controller actions. Can be moved to services to keep
the business logic apart ...
1
vote
0
answers
7k
views
Find the shortest path between two points in a 2D matrix with obstacles
I need to find shortest path between two points in a grid given an obstacles..
Given a 2 dimensional matrix where some of the elements are filled
with 1 and rest of the elements are filled. Here ...