You are given an array hours that represents the number of hours an employee worked each day. A day is classified as a tiring day if the employee worked strictly more than 8 hours that day. A well-performing interval is a consecutive sequence of days where the number of tiring days is strictly greater than the number of non-tiring days. Your task is to find the length of the longest well-performing interval. For example, if hours = [9, 9, 6, 0, 6, 6, 9]: Days with hours > 8 are tiring days: positions 0, 1, and 6 (values 9, 9, 9) Days with hours ≤ 8 are non-tiring days: positions 2, 3, 4, 5 (values 6, 0, 6, 6) The interval from index 0 to 2 has 2 tiring days and 1 non-tiring day, making it well-performing The entire array from index 0 to 6 has 3 tiring days and 4 non-tiring days, which is not well-performing The goal is to find the maximum length among all possible well-performing intervals.
Golang Developer Interview Questions
321 golang developer interview questions shared by candidates
Asked to perform binary search on an array and write unit tests for it.
What is SOLID. What is pprof. What is debugging. CAP.
Golang: 1. list all the datatypes in golang 2. what is interface? why do you use it? 3. what are concurrency and parralism and what is the difference between both? 4. difference between goroutines and threads? 5. what are channels for? 6. can you do something in goroutines without channels? 7. difference between arrays and slices? 8. what is a closure? define it. 9. what is the size of int(not int8, int16)? where is the size of int defined? 10. What is runtime? runtime package? 11. how can you get how many cores your computer has? 12. How would you tell a goroutine to use less less core than what you have? 13. how would you determine the type of a variable? which package to use for it? 14. What all types a map can store? 15. What is rune? 16. what are services in golang? 17. Define a singleton? 18. Abstraction? Interfaces? Implementation? 19. When do you use a structure in golang? 20. How do define struct type functions? and how can you access those functions? Can you define such functions to other datatypes as well? 21. Why are there no classes in Go? 22. Compile time and runtime? 23. Do you need to convert the type of a variable of interface{} type passed in a function as an argument? 24. Why are goroutines light-weight? Explain reason. 25. Do threads share memory? how? 26. if capacity is not defined in slice, what would the capacity be? Redis: 1. List all the datatypes in Redis? 2. what all commands u know in redis? 3. what is ttl? 4. how to set ttl in redis? Rabbitmq: 1. what is rabbitmq? 2. where do you use rabbitmq? 3. types 4. fan out type 5. how would you handle an error in rabbitmq? 6. What if you not pass an ack in rabbitmq? Mongodb: 1. what is mongodb? 2. what are documents? 3. how to do crud on data using mongodb? 4. what type of data you store in mongodb? 5. Wrote an update query in mongodb. Programming Question: 1. Given a string "abca" print first non-repetitive letter from this string. 2. func main(){ fmt.Println("2") go func(){ fmt.Println("2") }() } what would be the output? and why? 3. func getType(i interface{}){ } perform functionalities on the basis of type of variable.
ci cd framework you used, microservices, what product looks like
What do you know about SOLID and DDD?
SQL, the difference between when and having.
small project to develop api in go with mongodb.
Pgms on structure and class
How do you apply SOLID principles in your daily tasks?
Viewing 91 - 100 interview questions