r/CS_Questions • • May 05 '17

Top 30 Data Structures Problems for Technical Interview Preparation

Thumbnail
techiedelight.com
17 Upvotes

r/CS_Questions • • Apr 22 '23

I interviewed for a software developer position at a start up and they hired me as a technician. Now they are telling me to wait a year for the title.. Need advice

16 Upvotes

Hi, I got B.S in CS in 2020 and I still have no relevant work experience. I've been looking for an opportunity to get into the field. I started working at a start up about a month ago as a Security Technician because the CEO told me that our client requested 1 senior and 1 junior software engineer for a project that will start sometime in the future. During the interview, he said 'no one knows when the project will start. Maybe 1 day, 1 week, 3month or even 1 year.' Right after that, he asked me when I can start and I told him to give me about a couple weeks. The phone call ended there because he had to leave for a meeting.

The whole interview process was

  1. phone call with HR (Still not sure what his official title is, but this guy is my point of contact)

  2. interview at local starbucks

  3. phone call with the CEO (was supposed to be a zoom call but he was 30min late and it was on phone)

List of things that were discussed during the interview is:

  1. This company (A) is a vendor for a Security Company (B) that is a vendor for a fortune 500 company (C) in US. They deal with physcial security such as employee badge reader, metal detector, etc (if you think you know what this company is, you probably are right. Please don't mention in the comment)

  2. (B) requested 2 software engineers, preferably 1 senior and 1 junior, but they are also considering 2 juniors as an option too. I would be taking 1 junior position and they haven't found anyone else to consider yet.

  3. They don't have an exact start date. (A) wants to hire me immediately as an "investment" and train me so that I can get familiar with the system/ company culture/ etc. My paycheck will be coming out from his pocket as (A) still has not received any budget from (B).

  4. The day after the last phone call with the CEO, I received an offter letter stating:

    1. title: Security Technician

    2. salary: $50,000

    3. Probationary period of 90days

    4. work hours 8 - 5, 1 hour lunch

at this point, I thought the project is about to start, hopefully in less than 3months, and they wanted to call dibs on me. So I didn't ask for further clarification and signed the offer letter.

On day one, the HR guy escorted me into the "office" where it was just enough space to fit in 1 desk, 2 computers, 3 chairs and I was the unexpected 4th person in the room. Then for about 30minutes, the HR guy was explaining the team how I am the reinforcement but not because how (C) was complaining about quality of work being done.

They handed me a hard hat and work gloves and told me to put on smock to go into the field to fix some CCTVs on day 1 which took about 3 hrs. When I came back, all 3 of them were on their phones until 5pm. 4:50 actually, they come 10min late and leave 10 min early. extra hour for lunch.

On day 2, I asked for chair and they told me to steal it from another "office" next door. Literally nothing else.

Day 3, I called the HR guy and asked him for an explanation and he said they plan on keeping me here for 2-3 weeks and they'll train me on Software. and then nothing for rest of the week.

Day 5, on Friday, nothing until 3pm and then the supervisor came and told us to drive over to another office that is located about 15min away with our own cars and install something there. He said it was an urgent request from his upper-up. 2hrs overtime on Friday afternoon, and he said I can take 3hrs off anytime instead of receiving over-time pay.

Fast forward to Wednesday of week4, I asked the other technicians what they know about my onboarding and they said they know that I'm the "software guy" and their best guess is I'll be the computer guy while the others are out in the field messing the wires and doing physical works. The team lead pulled up CMD and asked me if I know how to use it.

They sounded like they had no idea about anything so I called the HR guy again and he said another person who was a formal (A) employee now works for (C), was supposed to train me on software but since he is extremely busy, I would need to drive to another office that is about 3 hrs away to get trained. for a week. He asked if I can drive my personal vehicle for this business trip and they'll get me a hotel room to stay and reimburse for gas/food during the trip so I said yes.

I drove up to this office and turns out, the system admin guy in this office is quitting, and this is his last week. He asked me how long I'm staying in this office and I told him just 1 week. Apparently he was told some other stories.

Later that night, the CEO called me and asked if I can stay in this office until they find a new person, so about 2weeks-month and I told him I'll have to think about it. He also mentioned how he thinks I'll get the project near the end of year, or early next year and I would have to fly to the HQ in different country for about 3months to get trained.

The day after, HR called me and asked me the samething except if I would consider relocating for this position for some compensation and again, I told him I'll think about it.

Near the end of the week, everyone in this office was asking me if I am staying longer, when I'll be back next week, or they'll take me to a bar later and all the stuff. I told them I am leaving on Friday, everything beyond that is uncertainty and I'm pretty sure they got the hint.

I've been asking around for advice but people in my age are telling me that this company is weird and the older ones are saying any job is better than no job and stacking YOE in any field will make me more competitive as whatever I'm trying to be and I feel lost.

I know that the market is terrible as of 2023 q2, and most likely for a year or 2 or even rest of my life. Staying in this company as sys admin or technician for a year (if it really is just 1 year) might be my only ticket into the field in 2024, but I am also condering giving up on becoming a software engineer and look for something else. I like the idea of keeping the job for now and look for something else, or go for Masters but I'm not sure what to do.

TLDR:

  1. I interviewed for SDE job

  2. got hired as technician because project is 3month - 1year away from starting. The CEO is doing me a "favor" for paying me at his own expense as I am a "burden" to the company.

  3. Not getting other interviews

  4. single quotes (' ') are translated and double quotes (" ") are literally what they said

  5. I did my best to leave my personal opinions and feelings away from this post.

I can do schedule shift, relocate to buttfucknowhere, accept minimum wage, work 200hrs for no over-time pay, wear other hats and everything employers demand, but only as Software Engineer. I need that title in writing. I don't want to do any of these for something else.

Should I quit the job?

If somehow they officially give me the "Software Engineer" title, should I clone the software they use/ plan to build and put it on my resume as if that is my experience at this company?

Should I relocate for higher salary?

If I decide to look for something else, should I go back to school?


r/CS_Questions • • Feb 21 '21

How do you debug code?

16 Upvotes

I recently had an interview where I was asked “how do you debug a bug?”. I kind of threw me because I wanted to answer it by saying “by debugging it..”.

I asked for more insight into the question and he said “imagine that you’re getting a 500 error from your web application in production. How you find the issue?”

I started listing the tools I would use Chrome DevTools, Postman, any logs... then I would try and reproduce the bug in a lower level environment and see if there is additional info that we don’t log or show in production. Step thru the code if necessary in Visual Studio once I’ve narrowed down the possible points.

The interviewer seemed ambivalent to my answer...? He just said “Oh. Ok” and moved on. It seemed like he was looking for more, but didn't press it.

Is there a better way to answer this question? This is a .net position


r/CS_Questions • • Sep 01 '16

Passing the Google interview as a software engineer

Thumbnail
youtube.com
16 Upvotes

r/CS_Questions • • Jul 13 '16

Python for Algorithms, Data Structures, and Interviews

Thumbnail
github.com
16 Upvotes

r/CS_Questions • • May 03 '16

Which website(s) do you use to practice interview-like programming questions?

16 Upvotes

More and more companies are asking more realistic questions as oppose to asking you to solve linked-lists etc. Are there any good websites that help strengthen problem solving skills? Especially skills that matter in interviews?


r/CS_Questions • • Jan 23 '16

This is a pretty cool list of fundamental concepts that I feel that a lot of programmers are confused about. If you've always wanted to gain a better understanding of indexing, heap/stack memory, P/NP or just need to brush up these concepts before your interview I would highly recommend this blog.

Thumbnail
theinterviewhacker.com
16 Upvotes

r/CS_Questions • • Apr 02 '19

Feedback on failed technical test

15 Upvotes

Hello all,

I recently did a 'take home' technical test for a company. I feel I did pretty well but was summarily rejected.

I asked the company for feedback as to what was wrong, but never got a reply. I wanted to get some feedback on the code I wrote so that I can learn and grow and prevent any such issues in the future. I hope this is the right place for this, I apologize in advance if it is not (would anyone be able to point me in a direction where I can get feedback on my code?)

Description of technical test

The test seemed relatively simple. It came with two programming tasks.

Task 1:

  • Design and implement an axis aligned 2D rectangle class with copy constructors and assignment operators

  • Algorithm that checks whether a 2d point is in the rectangle

  • Algorithm that checks whether two rectangles intersect/overlap

  • Test code that checks implementation

pastebin(s) of my solution:

main.cpp

AA_Rectangle.h

AA_Rectangle.cpp

Point2D.h

Task 2: Number series

  • Generate a number series in increasing order that can be factored by any combination of 2, 3 and 5.

  • Design an algorithm to find the number occupying the 1500 position in the series. NOTE: the correct answer is 859963392, use this to verify your algorithm.

pastebin of my solution:

main.cpp

PLEASE NOTE

A few things to consider:

  • They didn't really give me any requirements other than the questions. I sent them my solutions as VS Community edition project/solutions, but mentioned that I could provide them in any other format they would need.

  • The position was for a mid-senior level. I genuinely did not find the questions hard. So unless I derped up in some major way, I'm not sure what exactly went wrong. Also, this was the first interview/test screen.

  • They didn't give any time-frame for when they wanted the solution. I got the assessment at the end of business one day, and submitted my solution to them by the next morning (and was rejected by a little after lunch). I was unsure about what they were actually looking for, so decided to go with submitting a working solution rather than over engineering things.

  • I really have no idea of what they didn't like. I suspect the following:

  • maybe my code didn't seem 'senior' or 'professional' enough? e.g. my main functions are very basic.

  • maybe they didn't like that I used inline methods for my Point2D class? I mainly did that to show them that I am familiar with the concept.

  • maybe they didn't like my use of inbuilt functions? Should I have written a proper assert class that writes to the log? Just seemed like so much overkill.

  • maybe something else? const correctness? pointer usage?

  • maybe I come across as too haughty or something with my code comments? I can't help but feel they thought something bad with my commenting.

Anyway, what I am looking for from you all is some brutal and honest feedback. I really need to figure out why my code is getting rejected. From everything I can tell, the code does work, so unless I am missing something critical, I am at a loss as to how to turn this rejection into a learning opportunity.

I am open to any and all feedback. Any help you all can give would be greatly appreciated.

I should be around today to answer any questions, should anyone need any more info or clarification on things.

Thanks for all your help folks!


r/CS_Questions • • Dec 09 '16

Front-end Job Interview Questions

Thumbnail
github.com
15 Upvotes

r/CS_Questions • • Nov 15 '11

Got asked this one in an interview 2 days ago - and on paper!

15 Upvotes

This question is language independent and I hadn't come across this question until 2 days ago. It happened to be the first question out of 5 I had to answer - away from a computer and a familiar IDE. No intellisense or code completion.

I recommend every programmer prep up and learn the answer to this question:

Question: You have 2 analog clocks, both start at the same time of day, one spins clockwise the other anticlockwise, how many times will the backwards clocks time match the normal clocks time? Write a class to demonstrate this, and a test class to prove your results.


r/CS_Questions • • Aug 19 '22

I created a job board that specialized in Software Engineering Jobs. You can search JOBS by locations, skills, levels, and more.

14 Upvotes

r/CS_Questions • • Jun 29 '18

My colleague was asked this question in two interviews within one week. Can anyone explain the solution.

Thumbnail
interviewbit.com
14 Upvotes

r/CS_Questions • • Dec 24 '17

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The parentheses must close in the correct order.

Thumbnail
youtube.com
14 Upvotes

r/CS_Questions • • Feb 17 '17

Example coding interview: Designing Google Docs

Thumbnail
youtube.com
14 Upvotes

r/CS_Questions • • Feb 13 '17

Top Algorithms/Data Structures/Concepts every computer science student should know

Thumbnail
techiedelight.com
14 Upvotes

r/CS_Questions • • Nov 15 '11

Find total number of binary 1's in a range of numbers [Medium]

14 Upvotes

I don't know the answer to this question:

Given a range of integers from a to b in 2's complement, find the total number of times that the bit "1" appears in that range.

Your algorithm must run in sub linear time. (linear to the length of the range).

Here's a linear algorithm to demonstrate the idea:

total=0
for i in range(a,b):
    total+=numOnes(i)

This alg is not good enough since it has to be in sub-linear time.


r/CS_Questions • • Nov 13 '11

Write code to determine if an integer is a power of 2 without loops or recursion

14 Upvotes

r/CS_Questions • • May 25 '23

Back around 2010, Twitter decided to re-architect their tweets database for scale purposes to shard based on tweet ID. They went with app-level sharding - an ID generator (snowflake) and an app (gizzard) to hash the tweet ID and insert to the appropriate db. Why didn't they do let the DB do this?

13 Upvotes

From here:

https://blog.twitter.com/engineering/en_us/a/2013/new-tweets-per-second-record-and-how

It feels a little overkill to write apps for this and an entire unique ID generator. They sharded temporally previously, so the latest data all went to the latest shard and so a tweet spike overloaded this shard, and it makes sense to move to a hash based mechanism to distribute the load evenly. However, Postgres has hash-based partitioning, why didn't they leverage that or another DB that might do this for them?


r/CS_Questions • • Sep 23 '22

How often have you had to use Dynamic Programming in FAANG/Quant interviews?

13 Upvotes

Title. Also, was your code expected to run or was it pseudocode? What approach did you take while explaining your algo?


r/CS_Questions • • Dec 24 '19

JAVA interview question- denied job

13 Upvotes

I was recently contacted by a recruiter about a student position at her company. She sent me the bellow exercise and told me to send back a solution within one hour.

I did just that, and a week later received a negative response. I am completely self taught and therefore have never had any true feedback of my code, so this was a massive blow, considering how easy the exercise is.

I was stumped as I did the exercise the only way I thought possible, so I would love to see how you guys might approach this:

1)Define the classes ‘Vehicle’, ‘Car’, ‘Motorcycle’ (You may need to add classes!)

Car and Motorcycle can have Fuel or Electric Engine.

For each class provide the method toString() which prints the object type and its data.

Each class also has:

Members:

  1. Number of wheels.

  2. Engine type.

Methods:

  1. The method getNumberOfWheels() that return the number of wheels.

  2. The method getAmountOfEnergy() that return the amount of fuel / battery left in the engine.

2)Write a Main class that defines the following 4 vehicles in a list

  1. car with 4 wheels and fuel engine that have 20 liters left.

  2. car with 4 wheels and electric engine that have 40% left in the battery.

  3. Motorcycle with 2 wheels and fuel engine that have 5 liters left.

  4. Motorcycle with 2 wheels and electric engine that have 80% left in the battery.

3)Add a method to the Main class that sorts the list of vehicles in descending order, so that:

  1. fuel engines are prioritized over electric engines

  2. energy values are prioritized as highest first

for example: (7 liters -> 2 liters -> 25% -> 10%)

4) Print the sorted list of vehicles by calling the toString() method of every object in a loop


r/CS_Questions • • Nov 10 '16

What are 10 questions I should be able to answer in an interview as a junior developer?

13 Upvotes

Got an interview next week, trying to prep myself. What are some common questions?


r/CS_Questions • • Oct 13 '16

40 Interview Questions asked at Startups in Machine Learning / Data Science

Thumbnail
analyticsvidhya.com
13 Upvotes

r/CS_Questions • • Nov 16 '11

An element occurs more than n/2 times in a sequence of length n. Find it.

13 Upvotes

r/CS_Questions • • Nov 15 '11

Amazon job interview question

13 Upvotes

Question 1 you are given a M x N matrix with 0's and 1's Find the largest rectangular submatrix with 1's only

Question 2 you are given a M x N matrix with real numbers(postive and negative) Find the rectangular submatrix such that the sum of all the elements in this submatrix is the largest, compared with the sum of any other submatrix.


r/CS_Questions • • Nov 13 '11

Typical Google interview question: Word splitting.

13 Upvotes

Your input is a string with no spaces (e.g. "newyorknewyork", "hedgehog", or "brain"). You're also provided with a dictionary (you decide the interface for it).

Your algorithm must find out whether the string can be split in multiple words (e.g. hedgehog can, brain cannot) and, if so, output one such splitting. The cost in time cannot be exponential with the size of the input string.

Alternatively, your output has to be what is the greatest number of words in which you can split the given string. (E.g. newyorknewyork -> 4).

EDIT: "brain" == "bra" + "in", as MSAV (or his algorithm ;p) pointed out. You guys can come up with an example that does work hehe

EDIT2: Clarification: the whole input string needs to be used. E.g. "cars" cannot be split in "car" + "s" because "s" isn't a valid word.

EDIT3: Corncob List of 58,000 words: http://www.mieliestronk.com/wordlist.html (by CaptShocker, for those who want to try it "live" :) - but it should be solvable without ready access to a dictionary, so don't worry about it, it's just nice to have it handy).