At some point in my professional career, I've been through an endless path of interviews. There were weeks when I had 4-6 offline interviews scheduled and that was not the limit I believe. There were some exceptions, but mostly they were quite standard: 15 minutes HR interview (we've got coffee machine and cookies), ~1h of the technical interview (what is the difference between abstract class and interface questions for an hour), your questions to the company and that's it. You get an offer, decline it and go for the next one.
I want to share how I approach my way to become a better engineer. I see technical interviews as an opportunity to improve my knowledge of the platform, engineering in general, market etc. If there were some questions I didn't know, then it was a good interview. I know where my gaps are and this knowledge comes almost for free. The only price I pay is my time and the stress I might experience during the whole process. However, I know what to learn next.
Attending each interview is stressful. Don't be scared - it's also stressful for an interviewer. Keep balance - don't let him put pressure on you remember the fact that an interviewer is not always the smartest person in the room. You can't be sure he asks you the right questions. You can't be sure he explains the right answers to you afterwards. He's also a human who might be mistaken. But excellence is achieved only with practice - having that in mind you can also start your interviews-journey. You should practice to feel always comfortable and confident during the interviews.
I decided to arrange a list of fancy questions I've been asked during the interviews I had. They might be useful for you.
P.S. I don't really value theoretical questions, but most of the companies I've been to so far ask only those. The best questions are Computer Science fundamentals, practical application of algorithms. The best questions are live coding questions. They give you an insight whether a person is able to think in CS way and communicate thoughts to their team.
- What is a priority queue?
- What is a heap?
- What is B-tree?
- What is a 2-3-tree?
- What is RB-tree? What is AVL-tree?
- What is Set?
- What are HashMap and HashSet? Difference between them
- Implement a linked list during an interview
- Implement a graph during an interview
- Given a stream of Arabic numerals. Find the one that occurs maximum times.
- Reverse a linked list during an interview
- Convert a binary tree into a doubly linked list during an interview
- Find a loop in a linked list during an interview
- Sort an array of integers during an interview
- Search an element in a sorted and shifted array during the interview (5, 6, 1, 2, 3)
- What is in-place sorting algorithm?
- Write an algorithm to rotate an image 90 degrees clockwise
- What is NP problem? How to identify it?
- What is O(n) notation? Come up with some examples
- What is hash collision? What are the ways to handle it?
- What is a good hash function?
- Describe a Travelling Salesman Problem
- What is dynamic programming?
- What is memoization?
- Find intersection between 3 sorted arrays: [2,6,7,8], [3,6,8,10], [4,5,6,8] => [6,8]
- Generate a sequence of unique random numbers.
- OOP
- OOP weaknesses
- procedural/functional/ OO: can you describe them?
- Why OOP was favored by industry for so many years?
- What is the value object? Why should you use them?
- What is IoC?
- What is Dependency Inversion?
- What is Dependency Injection?
- Why are interfaces important?
- What is the difference between an exception and validation error? When exception should be thrown and when you should catch an exception?
- Concurrency
- Why do we need concurrency?
- Multithreading concepts
- What is Thread? What is Task? What is Process?
- What async/await does underneath?
- Difference between optimistic and pessimistic concurrency models
- Difference between being async and concurrent
- Sync primitives - semaphore, mutex, monitor?
- What is lock()? What is lock() underneath?
- Describe a race condition with a real-world example
- What are non-blocking/non-waiting algorithms?
- Which types of threads do we have?
- Where the threads come from?
- Explain the concepts of coupling and cohesion and how they relate to maintainability. As a follow up, please explain afferent coupling and efferent coupling, and how those concepts fit above.
- LINQ, lazy execution, EF limitations.
- What is an ORM? Why is it useful and why not?
- What is refactoring?
- What is covariance? What is contravariance?
- Implement a singleton during the interview
- What is unsafe code? When should you use it?
- What is Garbage Collector? What problem it solves?
- How Garbage Collector works? What are the steps?
- GC Generations
- What is non-deterministic finalization?
- Explain weak references
- Describe the process of memory allocation
- IDisposable and Finalizer
- How is using() construct useful? How can it result in resource leaks?
- Stack/heap. What is stack overflow physically?
- Large object heap
- SIMD
- What are WebSockets? Where can you use them?
- What is the difference between polling and long polling in sockets?
- Design an Instagram
- SOLID
- What are GoF design patterns? Why should you care?
- What's can go wrong with Active Record pattern?
- What do you think about
null
? How to avoid it? - What is composition over inheritance?
- What should you return concrete implementation or abstraction? E.g.
List
orIList
? When you would pick one approach over another? Think about performance as well. - What is the difference between IoC and service locator?
- Name a few anti-patterns
- What is MVC? Explain it using ASP.NET example. Define responsibilities.
- What is MVVM? Define responsibilities for each component.
- Layered architecture
- Explain pub/sub to me
- What is CQRS?
- What is CQS and how it relates to CQRS?
- What is a command in CQRS terms?
- What is the difference between command and event?
- What command handler is and what it does?
- Which type of projects is the best to introduce CQRS?
- Difference between stateful and stateless service.
- What is the blue DDD book?
- What is DDD?
- What is domain model?
- What is anemic domain model? Is it useful?
- What is the bounded context? How to identify a bounded context? Describe the example of two bounded contexts in terms of the same domain.
- What is the difference between a bounded context and a subdomain?
- Aggregate, AggregateRoot, Entity, ValueObject - what are those? Describe difference between them
- What is an ubiquitous language? Why is that important?
- Immutability - what is that? Should commands or events be immutable?
- What is saga? Come up with the real-world example to explain sagas.
- What is event sourcing?
- What is snapshotting in terms of event sourcing?
- What is a projection?
- Describe the role of aggregate in CQRS/ES/DDD environment. Go deep on two-phase commit on writing an event to the event store and publishing event to a bus. Are transactions good candidates for that kind of case? If not, how to avoid transactions in that case?
- Can you send a command to another bounded context in CQRS/ES/DDD environment? Can you publish an event to another bounded context in CQRS/ES/DDD environment?
- What is AOP? Which parts of the system would you move to aspects?
- Messaging patterns
- What is CorrelationId?
- When a retry policy is suitable in general? When should you retry your command/API call?
- How to design against vendor lock-in?
- What is CAP theorem?
- Why CAP theorem is obsolete? Is it?
- What is ACID? Is it still a thing?
- What is eventual consistency?
- Is the use of GUID as IDs a good practice?
- What is sharding?
- What is partitioning?
- How to design a good partitioning?
- What is an index? Clustered/Non-clustered?
- How much clustered indexes might be? What is clustered index physically?
- Explain the difference between index seek and index scan
- How can databases be replicated?
- What is cold data and hot data?
- How would you migrate an application from one database to another, for example from MySQL to PostgreSQL? If you had to manage that project, which issues would you expect to face?
- What is lazy loading? What are the drawbacks of this approach?
- How to find the most expensive queries in an application? How to monitor your database health and load?
- What are database normalizaton rules? Is it acceptable to have denormalized database? If so, in which cases?
- How to do blue-green deployments including database?
- How NoSQL databases scale? How SQL databases scale?
- When to use NoSQL and when to use SQL?
- What is unit test? Academic definition vs real world definition
- What is the difference between unit/integration/automated test? Discuss examples
- What is TDD?
- What is BDD?
- What is performance testing?
- What is load testing?
- What is smoke testing?
- What is regression testing? Is that correct that benchmarking is a part of regression testing process?
- What is chaos testing?
- Why in TDD are tests written before code?
- How to test a distributed system? Which types of test will you write? Which instruments would you use?
- What is a test pyramid?
- How testing frameworks such as xUnit & NUnit know what methods to run?
- What is Docker?
- What is Kubernetes?
- What happens when you run
kubectl run --image=nginx --replicas=3
? - What is green-blue deployment?
- What is CanaryRelease?
- What is the concept of infrastructure as code?
- What is the difference between authorization and authentication?
- What is .NET standard?
- What is merge and rebase, difference between them?
- Git hooks
- Git reset, revert, checkout
- What is the difference between Mongo and Redis?
- What is the difference between queue and topic in messaging systems?
- What is REST? RESTful?
- What is idempotency? in terms of HTTP and/or messaging
- What is RPC? What are the general pitfalls of RPC?
- What is gRPC? When it could be useful?
- What is the difference between RPC and gRPC?
- What is SOAP?
- What is HATEOAS?
- What is HAL?
- What is eventual consistency? BASE?
- What is reactive programming?
- What is tail recursion?
- What is cyclomatic complexity?
- Public API versioning, how to do that right.
- What is feature toggling/flagging? [1] [2] [3]
- What happens when you type 'google.com' into the browser adress bar and press Enter?
- What is public IP, private IP? NAT? IPv4? IPv6? [0] [1]
- Explain event hub over service bus, consumer groups and other concepts related.
- What is partitioned consumer pattern? Competing Consumer?
- What is tracing, spans, opentracing?
- What is ELK stack?
- What is structured logging? Does it have any advantages over plaintext logging?
- Why does array index start with '0' in most of languages?
- What are dynamic- and static-typed languages? Which one to pick for developing enterprise software? Explain your thoughts.
- What is overengineering? How can it affect enterprise software in a short run and in a long run?
- What is the difference between pattern matching and just a switch clause?
- Pretend you have a time machine and pretend that you have the opportunity to go to a particular point in time during Java's (or C#, Python, Go or whatever) history, and talk with some of the JDK architects. What would you try to convince them of? Removing checked exceptions? Adding unsigned primitives? Adding multiple-inheritance?
- How to explain legacy code to non-technical person e.g. Project Manager or Product Owner? Why it's important to care about legacy code? How would you deal with legacy code?
- When to use cache? When it can be not useful or even dangerous?
- I want to refactor a legacy system. You want to rewrite it from scratch. Argument. Then, switch our roles.
- What is GOTO statement? What's wrong with it? Do we still have GOTO statements or something similar to them in modern programming languages?
- What is monorepo and what is multirepo? When it's better to chose one over another? [0] [1]
- What motivates you?
- What do you think of technical conferences/meetups? Are they important and why?
- Why are you looking for a job?
- Tell about your last project
- What are you learning right now? Teach me this.
- Last book you read
- How much time do you need to start working full time for us?
- What do you do when you get stuck on some problem for too long?
- Tell me your 3 best/last failures
- Describe what Human Resources means to you.
- What is broken around you?
- When was the last time when you did not agree with some blog post/book/video? What was that and why you did not agree?
- When was the last time when you shared the knowledge with somebody else? Did you like it? Why did you do that?
- Explain me your learning process, validation of the information and using it in practice.
Don't ask them if you just wanna make an impression because you will. And it's gonna be a freaking bad impression - asking by template without any enthusiasm. What I really like to do is to start doing 96 and after recruiter asked you "Where do you see yourself in 5 years" it's totally reasonable to ask where the company sees itself in 5 years.
- What project I will start with? Describe the problem it solves. Describe the technical stack chosen, why it is like that and which tasks I will be asked to solve there.
- Do you have any code review process?
- What is the structure of environment I will be working in? Will I have managers attached to me and, if so, then how much? Who will provide me with the work to do?
- Will I have an ability to communicate with the client side? How much time will I communicate in English everyday?
- Which instruments does your company use for development? Is there any limitations?
- What level of responsibilities will I have?
- Why have you left your last company for this?
- How do you train/ramp up engineers who are new to the team?
- Who is your ideal candidate and how can I make myself more like them?
- Describe what Human Resources means to you.
- How do you find the best talents? Are you focused on acquiring the best ones?
- Do you have shower to use at your place? Does anyone use it?
- Do you have library at your place? Name a few books there.
- Does project offers any business trips/onsites?
- Do you have any teambuildings and what they look like?
- Do you know anything about your employees hobbies? What they are interested in?
- Do you have any internal tech talks to improve technical expertise of your employees? If so, who is in charge for that?
- Do you use any time logging system?
- Describe the paid vacations policy.
- Describe the process of salary review/performance review. What are the factors included in forming my salary?
- Do you have any competence matrix?
- Will I be able to work remotely? If so, then how much time/month?
- How flexible the schedule is?
- How often will I have to over-time and how it's payed?
- Which devices will I be provided to work with - laptops/PCs, monitors, smartphones for testings etc.
- Do you provide any insurance? If so, describe it briefly.
- Do you offer parking space for your employees? For car/bike.
- Do you have any probationary period for new employees?
- Do you have something like 13th salary or premiums?
- What are the weaknesses of the organization?
- What do you consider as the strongest advantage of your company over others?
- What are the education opportunities?
- How often are 1:1s conducted?
- What opportunities are available to switch roles? How does this work?